gnutls_ocsp_resp_get_single(3)

πŸ’… gnutls_ocsp_resp_get_single β€” bestie edition ✨

okay so this is a page from the gnutls manual, and it's all about gnutls_ocsp_resp_get_single(3). yes it's a mouthful. no we're not renaming it. periodt.


🌸 NAME 🌸

gnutls_ocsp_resp_get_single β€” it's an API function, bestie. that's the whole name section. slay.


πŸ¦‹ SYNOPSIS πŸ¦‹

so the way you summon this thing is:

#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);

look at her. eleven params. main character energy fr fr. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

every single one, no skips, we don't do that here:

  • gnutls_ocsp_resp_const_t resp β€” this one should hold a gnutls_ocsp_resp_t type. it's the thing you're interrogating.
  • unsigned indx β€” which response number you want. use (0) to get the first one. yes, zero-indexed, like a normal person. ✨
  • gnutls_digest_algorithm_t * digest β€” output variable that gets the gnutls_digest_algorithm_t hash algorithm. it's giving "here's the algo".
  • gnutls_datum_t * issuer_name_hash β€” output buffer holding the hash of the issuer's DN. 🫢
  • gnutls_datum_t * issuer_key_hash β€” output buffer with the hash of the issuer's public key. key girl.
  • gnutls_datum_t * serial_number β€” output buffer with the serial number of the certificate you wanna check.
  • unsigned int * cert_status β€” the certificate status, a gnutls_ocsp_cert_status_t enum. vibe check but for certs.
  • time_t * this_update β€” the time at which the status is known to be correct. like "as of rn, this is true".
  • time_t * next_update β€” when newer info will be available, or (time_t)-1 if it's unspecified. no cap, that's the sentinel. πŸ™ˆ
  • time_t * revocation_time β€” when cert_status is GNUTLS_OCSP_CERT_REVOKED, this holds the time of revocation. πŸ’€ moment tbh.
  • unsigned int * revocation_reason β€” the revocation reason, a gnutls_x509_crl_reason_t enum.

🌈 DESCRIPTION 🌈

so this function returns the certificate information of the indx'ed response inside the Basic OCSP Response resp. the info you get back corresponds to the OCSP SingleResponse structure, except the final singleExtensions. she's not included. we don't talk about her.

also! every single one of those pointers to output variables can be NULL if you're just not interested in that value. lowkey the most chill part of this API. like "no thoughts, don't need it". 🧚


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error code, which is the universe telling you no. 😭

and if you've reached the last CertID available? you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE back. that's the "bestie there is no more" signal. πŸ“


πŸ”₯ REPORTING BUGS πŸ”₯

found a bug? spill. report it to <bugs@gnutls.org>.

home page is over at https://www.gnutls.org. go touch grass there. 🌸


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. that's the license vibe, keep the receipts. ✨


πŸ’œ 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, go visit:

https://www.gnutls.org/manual/
not me telling you to actually read the docs. but like. read the docs. πŸ“š

aaaand that's the whole page, bestie!! this was gnutls 3.8.13, gnutls_ocsp_resp_get_single(3), and honestly? iconic. go get those OCSP responses. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from