D2I_OCSP_RESPONSE(3)

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

πŸ’– NAME πŸ’–

Okay bestie, this is the D2I_OCSP_RESPONSE(3) manual page, and the whole squad is: d2i_OCSP_RESPONSE, i2d_OCSP_RESPONSE, d2i_OCSP_RESPBYTES, i2d_OCSP_RESPBYTES, d2i_OCSP_BASICRESP, i2d_OCSP_BASICRESP, d2i_OCSP_RESPDATA, i2d_OCSP_RESPDATA, d2i_OCSP_RESPID, i2d_OCSP_RESPID, d2i_OCSP_SINGLERESP, i2d_OCSP_SINGLERESP, d2i_OCSP_CERTSTATUS, i2d_OCSP_CERTSTATUS, d2i_OCSP_REVOKEDINFO, i2d_OCSP_REVOKEDINFO, d2i_OCSP_CRLID, and i2d_OCSP_CRLID β€” decode and encode OCSP responses. That's the vibe. πŸ’…

✨ SYNOPSIS ✨

Here's the exact API lineup, no cap. The library is libcrypto, and you'll need #include <openssl/ocsp.h>. 🫢

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

OCSP_RESPONSE *
d2i_OCSP_RESPONSE(OCSP_RESPONSE **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_RESPONSE(OCSP_RESPONSE *val_in, unsigned char **der_out);

OCSP_RESPBYTES *
d2i_OCSP_RESPBYTES(OCSP_RESPBYTES **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_RESPBYTES(OCSP_RESPBYTES *val_in, unsigned char **der_out);

OCSP_BASICRESP *
d2i_OCSP_BASICRESP(OCSP_BASICRESP **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_BASICRESP(OCSP_BASICRESP *val_in, unsigned char **der_out);

OCSP_RESPDATA *
d2i_OCSP_RESPDATA(OCSP_RESPDATA **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_RESPDATA(OCSP_RESPDATA *val_in, unsigned char **der_out);

OCSP_RESPID *
d2i_OCSP_RESPID(OCSP_RESPID **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_RESPID(OCSP_RESPID *val_in, unsigned char **der_out);

OCSP_SINGLERESP *
d2i_OCSP_SINGLERESP(OCSP_SINGLERESP **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_SINGLERESP(OCSP_SINGLERESP *val_in, unsigned char **der_out);

OCSP_CERTSTATUS *
d2i_OCSP_CERTSTATUS(OCSP_CERTSTATUS **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_CERTSTATUS(OCSP_CERTSTATUS *val_in, unsigned char **der_out);

OCSP_REVOKEDINFO *
d2i_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO **val_out,
    const unsigned char **der_in, long length);

int
i2d_OCSP_REVOKEDINFO(OCSP_REVOKEDINFO *val_in, unsigned char **der_out);

OCSP_CRLID *
d2i_OCSP_CRLID(OCSP_CRLID **val_out, const unsigned char **der_in,
    long length);

int
i2d_OCSP_CRLID(OCSP_CRLID *val_in, unsigned char **der_out);

🌸 DESCRIPTION 🌸

These functions decode and encode ASN.1 structures used for OCSP responses. For the deep lore β€” semantics, examples, caveats, and bugs β€” see ASN1_item_d2i(3). That's the source of truth, bestie. ✨

  • d2i_OCSP_RESPONSE() and i2d_OCSP_RESPONSE() β€” decode and encode an ASN.1 OCSPResponse structure defined in RFC 6960 section 4.2.1. πŸ’–
  • d2i_OCSP_RESPBYTES() and i2d_OCSP_RESPBYTES() β€” decode and encode an ASN.1 ResponseBytes structure defined in RFC 6960 section 4.2.1. πŸŽ€
  • d2i_OCSP_BASICRESP() and i2d_OCSP_BASICRESP() β€” decode and encode an ASN.1 BasicOCSPResponse structure defined in RFC 6960 section 4.2.1. πŸ¦‹
  • d2i_OCSP_RESPDATA() and i2d_OCSP_RESPDATA() β€” decode and encode an ASN.1 ResponseData structure defined in RFC 6960 section 4.2.1. 🌸
  • d2i_OCSP_RESPID() and i2d_OCSP_RESPID() β€” decode and encode an ASN.1 ResponderID structure defined in RFC 6960 section 4.2.1. 🫢
  • d2i_OCSP_SINGLERESP() and i2d_OCSP_SINGLERESP() β€” decode and encode an ASN.1 SingleResponse structure defined in RFC 6960 section 4.2.1. 😭
  • d2i_OCSP_CERTSTATUS() and i2d_OCSP_CERTSTATUS() β€” decode and encode an ASN.1 CertStatus structure defined in RFC 6960 section 4.2.1. πŸ”₯
  • d2i_OCSP_REVOKEDINFO() and i2d_OCSP_REVOKEDINFO() β€” decode and encode an ASN.1 RevokedInfo structure defined in RFC 6960 section 4.2.1. πŸ‘‘
  • d2i_OCSP_CRLID() and i2d_OCSP_CRLID() β€” decode and encode an ASN.1 CrlID structure defined in RFC 6960 section 4.4.2. 🌈

πŸ¦‹ RETURN VALUES πŸ¦‹

The d2i_... girlies are the decoders: d2i_OCSP_RESPONSE(), d2i_OCSP_RESPBYTES(), d2i_OCSP_BASICRESP(), d2i_OCSP_RESPDATA(), d2i_OCSP_RESPID(), d2i_OCSP_SINGLERESP(), d2i_OCSP_CERTSTATUS(), d2i_OCSP_REVOKEDINFO(), and d2i_OCSP_CRLID() return an object of the respective type or NULL if an error occurs. 😭

The i2d_... crew are the encoders: i2d_OCSP_RESPONSE(), i2d_OCSP_RESPBYTES(), i2d_OCSP_BASICRESP(), i2d_OCSP_RESPDATA(), i2d_OCSP_RESPID(), i2d_OCSP_SINGLERESP(), i2d_OCSP_CERTSTATUS(), i2d_OCSP_REVOKEDINFO(), and i2d_OCSP_CRLID() return the number of bytes successfully encoded or a negative value if an error occurs. πŸ”₯

πŸŽ€ SEE ALSO πŸŽ€

Go touch grass in these other pages, bestie:

🌈 STANDARDS 🌈

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

🧚 HISTORY 🧚

These functions first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. History ate, no crumbs. πŸ‘‘


Source/version/date sign-off: Debian, June 8, 2025 β€” D2I_OCSP_RESPONSE(3). Bye bestie, go encode responsibly! πŸ’œ

πŸ“¦ where this page comes from