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

# libressl-OCSP\_response\_status(3)

OCSP response functions

## NAME

**OCSP\_RESPONSE\_new**, **OCSP\_RESPONSE\_free**, **OCSP\_RESPBYTES\_new**, **OCSP\_RESPBYTES\_free**, **OCSP\_BASICRESP\_new**, **OCSP\_BASICRESP\_free**, **OCSP\_RESPDATA\_new**, **OCSP\_RESPDATA\_free**, **OCSP\_RESPID\_new**, **OCSP\_RESPID\_free**, **OCSP\_response\_create**, **OCSP\_response\_status**, **OCSP\_response\_status\_str**, **OCSP\_response\_get1\_basic**, **OCSP\_basic\_sign** – OCSP response functions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/ocsp.h\>**

*OCSP\_RESPONSE* *\**\

**OCSP\_RESPONSE\_new**(*void*);

*void*\

**OCSP\_RESPONSE\_free**(*OCSP\_RESPONSE \*resp*);

*OCSP\_RESPBYTES* *\**\

**OCSP\_RESPBYTES\_new**(*void*);

*void*\

**OCSP\_RESPBYTES\_free**(*OCSP\_RESPBYTES \*respbytes*);

*OCSP\_BASICRESP* *\**\

**OCSP\_BASICRESP\_new**(*void*);

*void*\

**OCSP\_BASICRESP\_free**(*OCSP\_BASICRESP \*bs*);

*OCSP\_RESPDATA* *\**\

**OCSP\_RESPDATA\_new**(*void*);

*void*\

**OCSP\_RESPDATA\_free**(*OCSP\_RESPDATA \*respdata*);

*OCSP\_RESPID* *\**\

**OCSP\_RESPID\_new**(*void*);

*void*\

**OCSP\_RESPID\_free**(*OCSP\_RESPID \*respid*);

*OCSP\_RESPONSE* *\**\

**OCSP\_response\_create**(*int status*, *OCSP\_BASICRESP \*bs*);

*int*\

**OCSP\_response\_status**(*OCSP\_RESPONSE \*resp*);

*const* *char* *\**\

**OCSP\_response\_status\_str**(*long code*);

*OCSP\_BASICRESP* *\**\

**OCSP\_response\_get1\_basic**(*OCSP\_RESPONSE \*resp*);

*int*\

**OCSP\_basic\_sign**(*OCSP\_BASICRESP \*bs*, *X509 \*signer*, *EVP\_PKEY \*key*, *const EVP\_MD \*dgst*, *STACK\_OF(X509) \*certs*, *unsigned long flags*);

## DESCRIPTION

**OCSP\_RESPONSE\_new**() allocates and initializes an empty *OCSP\_RESPONSE* object, representing an ASN.1 *OCSPResponse* structure defined in RFC 6960. **OCSP\_RESPONSE\_free**() frees *resp*.

**OCSP\_RESPBYTES\_new**() allocates and initializes an empty *OCSP\_RESPBYTES* object, representing an ASN.1 *ResponseBytes* structure defined in RFC 6960. Such an object is used inside *OCSP\_RESPONSE*. **OCSP\_RESPBYTES\_free**() frees *respbytes*.

**OCSP\_BASICRESP\_new**() allocates and initializes an empty *OCSP\_BASICRESP* object, representing an ASN.1 *BasicOCSPResponse* structure defined in RFC 6960. *OCSP\_RESPBYTES* contains the DER-encoded form of an *OCSP\_BASICRESP* object. **OCSP\_BASICRESP\_free**() frees *bs*.

**OCSP\_RESPDATA\_new**() allocates and initializes an empty *OCSP\_RESPDATA* object, representing an ASN.1 *ResponseData* structure defined in RFC 6960. Such an object is used inside *OCSP\_BASICRESP*. **OCSP\_RESPDATA\_free**() frees *respdata*.

**OCSP\_RESPID\_new**() allocates and initializes an empty *OCSP\_RESPID* object, representing an ASN.1 *ResponderID* structure defined in RFC 6960. Such an object is used inside *OCSP\_RESPDATA*. **OCSP\_RESPID\_free**() frees *respid*.

**OCSP\_response\_create**() creates an *OCSP\_RESPONSE* object for *status* and optionally including the basic response *bs*.

**OCSP\_response\_status**() returns the OCSP response status of *resp*. It returns one of the values OCSP\_RESPONSE\_STATUS\_SUCCESSFUL, OCSP\_RESPONSE\_STATUS\_MALFORMEDREQUEST, OCSP\_RESPONSE\_STATUS\_INTERNALERROR, OCSP\_RESPONSE\_STATUS\_TRYLATER, OCSP\_RESPONSE\_STATUS\_SIGREQUIRED, or OCSP\_RESPONSE\_STATUS\_UNAUTHORIZED.

**OCSP\_response\_status\_str**() converts one of the *status* codes returned by **OCSP\_response\_status**() to a string consisting of one word.

**OCSP\_response\_get1\_basic**() decodes and returns the *OCSP\_BASICRESP* object contained in *resp*. It is only called if the status of a response is OCSP\_RESPONSE\_STATUS\_SUCCESSFUL.

**OCSP\_basic\_sign**() signs the OCSP response *bs* using the certificate *signer*, the private key *key*, the digest *dgst*, and the additional certificates *certs*. If the *flags* option OCSP\_NOCERTS is set, then no certificates will be included in the request. If the *flags* option OCSP\_RESPID\_KEY is set, then the responder is identified by key ID rather than by name.

## RETURN VALUES

**OCSP\_RESPONSE\_new**() and **OCSP\_response\_create**() return a pointer to an *OCSP\_RESPONSE* object or NULL if an error occurred.

**OCSP\_BASICRESP\_new**() and **OCSP\_response\_get1\_basic**() return a pointer to an *OCSP\_BASICRESP* object or NULL if an error occurred.

**OCSP\_RESPBYTES\_new**(), **OCSP\_RESPDATA\_new**(), and **OCSP\_RESPID\_new**() return a pointer to an empty *OCSP\_RESPBYTES*, *OCSP\_RESPDATA*, or *OCSP\_RESPID* object, respectively, or NULL if an error occurred.

**OCSP\_response\_status**() returns a status value.

**OCSP\_response\_status\_str**() returns a pointer to a static string.

**OCSP\_basic\_sign**() return 1 on success or 0 on failure.

## SEE ALSO

EVP\_DigestInit(3), OCSP\_cert\_to\_id(3), OCSP\_request\_add1\_nonce(3), OCSP\_REQUEST\_new(3), OCSP\_resp\_find\_status(3), OCSP\_sendreq\_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.
