OpenBSD manual page server

Manual Page Search Parameters

ASN1_OBJECT_NEW(3) Library Functions Manual ASN1_OBJECT_NEW(3)

ASN1_OBJECT_new, ASN1_OBJECT_freeASN.1 object identifiers

#include <openssl/asn1.h>



() allocates and initializes an empty ASN1_OBJECT object, representing an ASN.1 OBJECT IDENTIFIER. It can hold a short name, a long name, a numeric identifier (NID), and a sequence of integers identifying a node in the International Object Identifier tree as specified in ITU-T recommendation X.660. The new object is marked as dynamically allocated.

Application programs normally use utility functions like OBJ_nid2obj(3) rather than using () directly.

() has the following effects:

All data contained in a that is marked as dynamically allocated is freed, and the respective fields of a become empty. Contained data not marked as dynamically allocated remains intact.

If the object a itself is marked as dynamically allocated, it is freed. Otherwise, the pointer a remains valid.

If a is a NULL pointer or if neither the object itself nor any of its content is marked as dynamically allocated, no action occurs.

If the allocation fails, ASN1_OBJECT_new() returns NULL and sets an error code that can be obtained by ERR_get_error(3). Otherwise it returns a pointer to the new object.

ASN1_TYPE_get(3), d2i_ASN1_OBJECT(3), OBJ_nid2obj(3)

ASN1_OBJECT_new() and ASN1_OBJECT_free() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.

June 6, 2019 OpenBSD-current