|D2I_ASN1_OBJECT(3)||Library Functions Manual||D2I_ASN1_OBJECT(3)|
i2d_ASN1_OBJECT — decode and
encode ASN.1 object identifiers
**val_out, unsigned char **der_in,
*val_in, unsigned char **der_out);
These functions decode and encode ASN.1 object identifiers. For details about the semantics, examples, caveats, and bugs, see ASN1_item_d2i(3).
If reusing an existing object is attempted
but the *val_out passed in points to an object that is
not marked as dynamically allocated, then the existing object is left
behaves as if *val_out would have been
NULL: A new object is allocated and a pointer to it
is both stored in *val_out and returned.
d2i_ASN1_OBJECT() returns an
ASN1_OBJECT object or
an error occurs.
i2d_ASN1_OBJECT() returns the number of
bytes successfully encoded or a value <= 0 if an error occurs.
ITU-T Recommendation X.690, also known as ISO/IEC 8825-1: Information technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER), section 8.19: Encoding of an object identifier value
i2d_ASN1_OBJECT() first appeared in SSLeay 0.5.1 and
have been available since OpenBSD 2.4.
d2i_ASN1_OBJECT() never sets the long and
short names of the object, not even if the object identifier matches one
that is built into the library. To find the names of an object identifier
parsed from DER or BER input, call
OBJ_obj2nid(3) on the returned
object, and then OBJ_nid2sn(3) and
OBJ_nid2ln(3) on the result.
When reusing a dynamically allocated object that contains dynamically allocated names, the old names are not freed and the memory containing them is leaked.
|December 8, 2021||OpenBSD-current|