D2I_POLICYINFO(3)

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

πŸ’… D2I_POLICYINFO(3) β€” decode & encode X.509 certificate policies πŸŽ€

okay bestie, welcome to the D2I_POLICYINFO(3) library-functions manual page. This is the whole vibe: X.509 certificate policies, decoded and encoded, no cap. ✨


🏷️ NAME 🏷️

d2i_POLICYINFO, i2d_POLICYINFO, d2i_CERTIFICATEPOLICIES, i2d_CERTIFICATEPOLICIES, d2i_POLICYQUALINFO, i2d_POLICYQUALINFO, d2i_USERNOTICE, i2d_USERNOTICE, d2i_NOTICEREF, i2d_NOTICEREF β€” decode and encode X.509 certificate policies πŸ’–


✨ SYNOPSIS ✨

First the library/header combo, literally:

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

And here are the signatures, copied exactly because we do not play with function signatures:

       POLICYINFO *
       d2i_POLICYINFO(POLICYINFO **val_out, const unsigned char **der_in,
           long length);

       int
       i2d_POLICYINFO(POLICYINFO *val_in, unsigned char **der_out);

       CERTIFICATEPOLICIES *
       d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **val_out,
           const unsigned char **der_in, long length);

       int
       i2d_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES *val_in,
           unsigned char **der_out);

       POLICYQUALINFO *
       d2i_POLICYQUALINFO(POLICYQUALINFO **val_out,
           const unsigned char **der_in, long length);

       int
       i2d_POLICYQUALINFO(POLICYQUALINFO *val_in, unsigned char **der_out);

       USERNOTICE *
       d2i_USERNOTICE(USERNOTICE **val_out, const unsigned char **der_in,
           long length);

       int
       i2d_USERNOTICE(USERNOTICE *val_in, unsigned char **der_out);

       NOTICEREF *
       d2i_NOTICEREF(NOTICEREF **val_out, const unsigned char **der_in,
           long length);

       int
       i2d_NOTICEREF(NOTICEREF *val_in, unsigned char **der_out);

πŸ¦‹ DESCRIPTION πŸ¦‹

These functions decode and encode X.509 certificate policies. For details about the semantics, examples, caveats, and bugs, see ASN1_item_d2i(3). πŸ‘€

  • d2i_POLICYINFO() and i2d_POLICYINFO() decode and encode an ASN.1 PolicyInformation structure defined in RFC 5280 section 4.2.1.4. 🌸
  • d2i_CERTIFICATEPOLICIES() and i2d_CERTIFICATEPOLICIES() decode and encode an ASN.1 CertificatePolicies structure defined in RFC 5280 section 4.2.1.4. πŸŽ€
  • d2i_POLICYQUALINFO() and i2d_POLICYQUALINFO() decode and encode an ASN.1 PolicyQualifierInfo structure defined in RFC 5280 section 4.2.1.4. πŸ¦‹
  • d2i_USERNOTICE() and i2d_USERNOTICE() decode and encode an ASN.1 UserNotice structure defined in RFC 5280 section 4.2.1.4. πŸ’œ
  • d2i_NOTICEREF() and i2d_NOTICEREF() decode and encode an ASN.1 NoticeReference structure defined in RFC 5280 section 4.2.1.4. ⭐

🫢 RETURN VALUES 🫢

  • The decode besties β€” d2i_POLICYINFO(), d2i_CERTIFICATEPOLICIES(), d2i_POLICYQUALINFO(), d2i_USERNOTICE(), and d2i_NOTICEREF() β€” return a POLICYINFO, CERTIFICATEPOLICIES, POLICYQUALINFO, USERNOTICE, or NOTICEREF object, respectively, or NULL if an error occurs. 😭
  • The encode besties β€” i2d_POLICYINFO(), i2d_CERTIFICATEPOLICIES(), i2d_POLICYQUALINFO(), i2d_USERNOTICE(), and i2d_NOTICEREF() β€” return the number of bytes successfully encoded or a negative value if an error occurs. πŸ’€

πŸ”— SEE ALSO πŸ”—

Go peek at ASN1_item_d2i(3), POLICYINFO_new(3), and X509_EXTENSION_new(3). πŸ‘‘


πŸ“œ STANDARDS πŸ“œ

RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2.1.4: Certificate Policies β€” yes, that exact one. 🌈


πŸ•°οΈ HISTORY πŸ•°οΈ

These functions first appeared in OpenSSL 0.9.3 and have been available since OpenBSD 2.6. 🧚


xoxo bestie, this page is serving Debian source/version realness with a June 8, 2025 date stamp β€” D2I_POLICYINFO(3) out. πŸ’–πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from