D2I_OCSP_REQUEST(3)
π¦ 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()andi2d_OCSP_REQUEST()β decode and encode an ASN.1OCSPRequeststructure defined in RFC 6960 section 4.1.1.d2i_OCSP_SIGNATURE()andi2d_OCSP_SIGNATURE()β decode and encode an ASN.1Signaturestructure defined in RFC 6960 section 4.1.1.d2i_OCSP_REQINFO()andi2d_OCSP_REQINFO()β decode and encode an ASN.1TBSRequeststructure defined in RFC 6960 section 4.1.1.d2i_OCSP_ONEREQ()andi2d_OCSP_ONEREQ()β decode and encode an ASN.1Requeststructure defined in RFC 6960 section 4.1.1.d2i_OCSP_CERTID()andi2d_OCSP_CERTID()β decode and encode an ASN.1CertIDstructure defined in RFC 6960 section 4.1.1.d2i_OCSP_SERVICELOC()andi2d_OCSP_SERVICELOC()β decode and encode an ASN.1ServiceLocatorstructure 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(), andd2i_OCSP_SERVICELOC()β return an object of the respective type, orNULLif an error occurs. so if you getNULL, that's the vibe check failing πi2d_OCSP_REQUEST(),i2d_OCSP_SIGNATURE(),i2d_OCSP_REQINFO(),i2d_OCSP_ONEREQ(),i2d_OCSP_CERTID(), andi2d_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
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms