libressl-EXTENDED_KEY_USAGE_new3
X.509 key usage restrictions
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/x509v3.h>
EXTENDED_KEY_USAGE
EXTENDED_KEY_USAGE_new(void);
void
EXTENDED_KEY_USAGE_free(EXTENDED_KEY_USAGE *eku);
Overview
By using the key usage extension, the extended key usage extension, or both of them, X509 end entity certificates may indicate that the key contained in them is only intended to be used for the specified purposes. If both extensions are present, only uses compatible with both extensions are intended.
EXTENDED_KEY_USAGE_new() allocates and initializes an empty EXTENDED_KEY_USAGE object, which is a STACK_OF(ASN1_OBJECT) and represents an ASN.1 ExtKeyUsageSyntax structure defined in RFC 5280 section 4.2.1.12. It can hold key purpose identifiers.
EXTENDED_KEY_USAGE_free() frees eku.
The key usage extension uses the ASN.1 BIT STRING data type and doesn't require any dedicated object.
Return values
EXTENDED_KEY_USAGE_new() returns the new EXTENDED_KEY_USAGE object or NULL if an error occurs.