ASN1_OBJECT_NEW(3) BSD Library Functions Manual ASN1_OBJECT_NEW(3)
ASN1_OBJECT_new, ASN1_OBJECT_free — ASN.1 object identifiers
ASN1_OBJECT_new() 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 ASN1_OBJECT_new() directly.
ASN1_OBJECT_free() 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_OBJECT_new() and ASN1_OBJECT_free() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.
BSD March 27, 2018 BSD