D2I_OCSP_REQUEST(3)

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

πŸ¦‹ D2I_OCSP_REQUEST(3) πŸ¦‹

okay so this is the D2I_OCSP_REQUEST(3) page from the Library Functions Manual, and it's literally all about decoding and encoding OCSP request structures. bestie, it's giving ASN.1 glam πŸ’…βœ¨

✨ NAME ✨

The whole squad: d2i_OCSP_REQUEST, i2d_OCSP_REQUEST, d2i_OCSP_SIGNATURE, i2d_OCSP_SIGNATURE, d2i_OCSP_REQINFO, i2d_OCSP_REQINFO, d2i_OCSP_ONEREQ, i2d_OCSP_ONEREQ, d2i_OCSP_CERTID, i2d_OCSP_CERTID, d2i_OCSP_SERVICELOC, and i2d_OCSP_SERVICELOC β€” all here to decode and encode OCSP requests. no cap 🫢

🌸 SYNOPSIS 🌸

This is a libcrypto moment, and the header situation is exactly this:

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

OCSP_REQUEST *
d2i_OCSP_REQUEST(OCSP_REQUEST **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_REQUEST(OCSP_REQUEST *val_in, unsigned char **der_out);

OCSP_SIGNATURE *
d2i_OCSP_SIGNATURE(OCSP_SIGNATURE **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_SIGNATURE(OCSP_SIGNATURE *val_in, unsigned char **der_out);

OCSP_REQINFO *
d2i_OCSP_REQINFO(OCSP_REQINFO **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_REQINFO(OCSP_REQINFO *val_in, unsigned char **der_out);

OCSP_ONEREQ *
d2i_OCSP_ONEREQ(OCSP_ONEREQ **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_ONEREQ(OCSP_ONEREQ *val_in, unsigned char **der_out);

OCSP_CERTID *
d2i_OCSP_CERTID(OCSP_CERTID **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_CERTID(OCSP_CERTID *val_in, unsigned char **der_out);

OCSP_SERVICELOC *
d2i_OCSP_SERVICELOC(OCSP_SERVICELOC **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_SERVICELOC(OCSP_SERVICELOC *val_in, unsigned char **der_out);

πŸ’… DESCRIPTION πŸ’…

These functions decode and encode ASN.1 structures used for OCSP requests. For all the details about the semantics, examples, caveats, and bugs, go see ASN1_item_d2i(3) β€” that's the main character for the fine print, iykyk. πŸ‘‘

  • d2i_OCSP_REQUEST() and i2d_OCSP_REQUEST() β€” decode and encode an ASN.1 OCSPRequest structure defined in RFC 6960 section 4.1.1.
  • d2i_OCSP_SIGNATURE() and i2d_OCSP_SIGNATURE() β€” decode and encode an ASN.1 Signature structure defined in RFC 6960 section 4.1.1.
  • d2i_OCSP_REQINFO() and i2d_OCSP_REQINFO() β€” decode and encode an ASN.1 TBSRequest structure defined in RFC 6960 section 4.1.1.
  • d2i_OCSP_ONEREQ() and i2d_OCSP_ONEREQ() β€” decode and encode an ASN.1 Request structure defined in RFC 6960 section 4.1.1.
  • d2i_OCSP_CERTID() and i2d_OCSP_CERTID() β€” decode and encode an ASN.1 CertID structure defined in RFC 6960 section 4.1.1.
  • d2i_OCSP_SERVICELOC() and i2d_OCSP_SERVICELOC() β€” decode and encode an ASN.1 ServiceLocator structure defined in RFC 6960 section 4.4.6.

πŸ‘‘ RETURN VALUES πŸ‘‘

  • d2i_OCSP_REQUEST(), d2i_OCSP_SIGNATURE(), d2i_OCSP_REQINFO(), d2i_OCSP_ONEREQ(), d2i_OCSP_CERTID(), and d2i_OCSP_SERVICELOC() β€” return an object of the respective type, or NULL if an error occurs. so if you get NULL, that's the vibe check failing 😭
  • i2d_OCSP_REQUEST(), i2d_OCSP_SIGNATURE(), i2d_OCSP_REQINFO(), i2d_OCSP_ONEREQ(), i2d_OCSP_CERTID(), and i2d_OCSP_SERVICELOC() β€” return the number of bytes successfully encoded, or a negative value if an error occurs. negative? yeah, that's the "something went wrong" signal, no cap πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

🌈 STANDARDS 🌈

The official standard energy is:

RFC 6960: X.509 Internet Public Key Infrastructure Online Certificate Status Protocol, section 4.1: Request Syntax

πŸ“ HISTORY πŸ“

These functions first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. vintage but still iconic, fr fr 🌸


source/version: Debian πŸŽ€ date: June 8, 2025 β€” and that's the D2I_OCSP_REQUEST(3) page, bestie. bye and slay your ASN.1 πŸ’–βœ¨

πŸ“¦ where this page comes from