---
name: "libressl-d2i_OCSP_REQUEST"
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_REQUEST"
---

# libressl-d2i\_OCSP\_REQUEST(3)

decode and encode OCSP requests

## NAME

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

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

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

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

## SEE ALSO

ASN1\_item\_d2i(3), OCSP\_CERTID\_new(3), OCSP\_REQUEST\_new(3), OCSP\_SERVICELOC\_new(3)

## STANDARDS

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.
