D2I_ASN1_SEQUENCE_ANY(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… D2I_ASN1_SEQUENCE_ANY(3) bestie era πŸ’…

okay so welcome to the D2I_ASN1_SEQUENCE_ANY(3) page from the Library Functions Manual, where we’re literally decoding and encoding ASN.1 sequences and sets. no cap, this is the whole squad’s page. πŸ¦‹βœ¨

✨ NAME ✨

  • d2i_ASN1_SEQUENCE_ANY, i2d_ASN1_SEQUENCE_ANY, d2i_ASN1_SET_ANY, i2d_ASN1_SET_ANY β€” decode and encode ASN.1 sequences and sets

πŸŽ€ SYNOPSIS πŸŽ€

library β€œlibcrypto” #include <openssl/asn1.h>

ASN1_SEQUENCE_ANY *
d2i_ASN1_SEQUENCE_ANY(ASN1_SEQUENCE_ANY **val_out,
    const unsigned char **der_in, long length);

int
i2d_ASN1_SEQUENCE_ANY(const ASN1_SEQUENCE_ANY *val_in,
    unsigned char **der_out);

ASN1_SEQUENCE_ANY *
d2i_ASN1_SET_ANY(ASN1_SEQUENCE_ANY **val_out,
    const unsigned char **der_in, long length);

int
i2d_ASN1_SET_ANY(const ASN1_SEQUENCE_ANY *val_in,
    unsigned char **der_out);

πŸ’– DESCRIPTION πŸ’–

These functions decode and encode ASN.1 sequences and sets, which are also represented by the V_ASN1_SEQUENCE and V_ASN1_SET type identifier constants, respectively. yes, respectively matters, bestie. πŸ’… For the full semantics, examples, caveats, and bugs, please go read ASN1_item_d2i(3) β€” that’s where the details live. πŸ‘‘

The type ASN1_SEQUENCE_ANY is defined as STACK_OF(ASN1_TYPE). and here’s the lowkey important bit: whether such an object represents a sequence or a set is not stored in the object itself β€” it needs to be remembered separately. not me reminding you, but like… remember it separately, fr fr. πŸ™ˆ

Like for d2i_ASN1_TYPE(3) and i2d_ASN1_TYPE(3), the type of the individual values contained in the sequence or set is not specified when calling the functions. It might vary among the members, and it is stored together with each value in each ASN1_TYPE object contained in the sequence or set. periodt. πŸ’…βœ¨

🌸 RETURN VALUES 🌸

  • d2i_ASN1_SEQUENCE_ANY() β€” returns an ASN1_SEQUENCE_ANY object or NULL if an error occurs.
  • i2d_ASN1_SEQUENCE_ANY() β€” returns the number of bytes written or a negative value if an error occurs.

πŸ¦‹ SEE ALSO πŸ¦‹

πŸ‘‘ HISTORY πŸ‘‘

d2i_ASN1_SEQUENCE_ANY(), i2d_ASN1_SEQUENCE_ANY(), d2i_ASN1_SET_ANY(), and i2d_ASN1_SET_ANY() first appeared in OpenSSL 1.0.0 and have been available since OpenBSD 4.9. iconic behavior, honestly. ⭐


xoxo, your Debian girlie β€” source/version: Debian, date: June 8, 2025, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from