---
name: "libressl-d2i_OCSP_RESPONSE"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-d2i_OCSP_RESPONSE"
---

# libressl-d2i\_OCSP\_RESPONSE(3)

decode and encode OCSP responses

## NAME

**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**, **i2d\_OCSP\_CRLID** – decode and encode OCSP responses

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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 details about the semantics, examples, caveats, and bugs, see ASN1\_item\_d2i(3).

**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

**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.

**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

ASN1\_item\_d2i(3), OCSP\_CRLID\_new(3), OCSP\_REQUEST\_new(3), OCSP\_RESPONSE\_new(3), OCSP\_SINGLERESP\_new(3)

## 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.
