---
name: "gnutls_ocsp_resp_get_single"
section: "3"
platform: "linux"
package: "gnutls"
version: "3.8.13-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gnutls_ocsp_resp_get_single"
---

# gnutls\_ocsp\_resp\_get\_single(3)

API function

## NAME

gnutls\_ocsp\_resp\_get\_single - API function

## SYNOPSIS

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

**int gnutls\_ocsp\_resp\_get\_single(gnutls\_ocsp\_resp\_const\_t** *resp***, unsigned** *indx***, gnutls\_digest\_algorithm\_t \*** *digest***, gnutls\_datum\_t \*** *issuer\_name\_hash***, gnutls\_datum\_t \*** *issuer\_key\_hash***, gnutls\_datum\_t \*** *serial\_number***, unsigned int \*** *cert\_status***, time\_t \*** *this\_update***, time\_t \*** *next\_update***, time\_t \*** *revocation\_time***, unsigned int \*** *revocation\_reason***);**

## ARGUMENTS

- gnutls\_ocsp\_resp\_const\_t resp

  should contain a **gnutls\_ocsp\_resp\_t** type

- unsigned indx

  Specifies response number to get. Use (0) to get the first one.

- gnutls\_digest\_algorithm\_t \* digest

  output variable with **gnutls\_digest\_algorithm\_t** hash algorithm

- gnutls\_datum\_t \* issuer\_name\_hash

  output buffer with hash of issuer's DN

- gnutls\_datum\_t \* issuer\_key\_hash

  output buffer with hash of issuer's public key

- gnutls\_datum\_t \* serial\_number

  output buffer with serial number of certificate to check

- unsigned int \* cert\_status

  a certificate status, a **gnutls\_ocsp\_cert\_status\_t** enum.

- time\_t \* this\_update

  time at which the status is known to be correct.

- time\_t \* next\_update

  when newer information will be available, or (time\_t)-1 if unspecified

- time\_t \* revocation\_time

  when  *cert\_status* is **GNUTLS\_OCSP\_CERT\_REVOKED**, holds time of revocation.

- unsigned int \* revocation\_reason

  revocation reason, a **gnutls\_x509\_crl\_reason\_t** enum.

## DESCRIPTION

This function will return the certificate information of the\
  *indx* 'ed response in the Basic OCSP Response  *resp* .  The information returned corresponds to the OCSP SingleResponse structure except the final singleExtensions.

Each of the pointers to output variables may be NULL to indicate that the caller is not interested in that value.

## RETURNS

On success, **GNUTLS\_E\_SUCCESS** (0) is returned, otherwise a negative error code is returned.  If you have reached the last CertID available **GNUTLS\_E\_REQUESTED\_DATA\_NOT\_AVAILABLE** will be returned.

## REPORTING BUGS

Report bugs to \<bugs@gnutls.org\>.\
 Home page: https://www.gnutls.org

## COPYRIGHT

Copyright © 2001-2023 Free Software Foundation, Inc., and others.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

## SEE ALSO

The full documentation for **gnutls** is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form visit

- https://www.gnutls.org/manual/
