D2I_AUTHORITY_KEYID(3)

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

🌸 NAME 🌸

okay so this is the D2I_AUTHORITY_KEYID(3) page from the Library Functions Manual β€” literally the decode-and-encode besties for X.509 authority key identifiers. We're talking d2i_AUTHORITY_KEYID and i2d_AUTHORITY_KEYID, and they handle the ASN.1 AuthorityKeyIdentifier structure. πŸ’…βœ¨


✨ SYNOPSIS ✨

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

AUTHORITY_KEYID *
d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **val_out,
    const unsigned char **der_in, long length);

int
i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *val_in, unsigned char **der_out);

no cap, those signatures are the whole mood. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So d2i_AUTHORITY_KEYID() and i2d_AUTHORITY_KEYID() decode and encode an ASN.1 AuthorityKeyIdentifier structure defined in RFC 5280 section 4.2.1.1. That's the vibe. πŸŽ€

For details about the semantics, examples, caveats, and bugs, see ASN1_item_d2i(3) β€” all the deep lore lives over there, iykyk. πŸ’–


πŸŽ€ RETURN VALUES πŸŽ€

  • d2i_AUTHORITY_KEYID() returns an AUTHORITY_KEYID object or NULL if an error occurs. iconic when it works, NULL when it doesn't 😭
  • i2d_AUTHORITY_KEYID() returns the number of bytes successfully encoded or a negative value if an error occurs. positive byte count = slay, negative = not the moment πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

these are your next reads, bestie, fr fr. ✨


🌈 STANDARDS 🌈

RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile:

  • section 4.2.1.1: Certificate Extensions: Authority Key Identifier
  • section 5.2.1: CRL Extensions: Authority Key Identifier

periodt. πŸ’œ


πŸ’œ HISTORY πŸ’œ

d2i_AUTHORITY_KEYID() and i2d_AUTHORITY_KEYID() first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6. ancient icons, honestly πŸ‘‘πŸ”₯


and that's the whole page! source/version check: this one's from the Debian build, dated June 8, 2025 β€” D2I_AUTHORITY_KEYID(3) signing off πŸ’…βœ¨

πŸ“¦ where this page comes from