OpenBSD manual page server

Manual Page Search Parameters

ASN1_ITEM_PACK(3) Library Functions Manual ASN1_ITEM_PACK(3)

ASN1_item_pack, ASN1_item_unpackpack an ASN.1 object into an ASN1_STRING

#include <openssl/asn1.h>

ASN1_STRING *
ASN1_item_pack(void *val_in, const ASN1_ITEM *it, ASN1_STRING **string_out);

void *
ASN1_item_unpack(const ASN1_STRING *string_in, const ASN1_ITEM *it);

() encodes the object pointed to by val_in into DER format using ASN1_item_i2d(3) and stores the encoded form in **string_out. If string_out or *string_out is a NULL pointer, a new ASN1_STRING object is allocated and returned.

() interprets the data in string_in as a DER- or BER-encoded byte array and decodes one value of the type it into a newly allocated object using ASN1_item_d2i(3).

ASN1_item_pack() returns the modified or new object or NULL if memory allocation or encoding fails.

ASN1_item_unpack() returns the new object or NULL if memory allocation or decoding fails.

ASN1_item_d2i(3), ASN1_item_new(3), ASN1_STRING_new(3)

ASN1_item_pack() and ASN1_item_unpack() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.

See the BUGS section in ASN1_item_i2d(3).

November 15, 2021 OpenBSD-7.6