gnutls_ocsp_req_add_cert_id(3)

✨ gnutls_ocsp_req_add_cert_id ✨

okay bestie so you're deep in the gnutls manual (the 3.8.13 era, iconic) and you landed on this page, and honestly? it's giving "one tiny function that does one very specific thing" and i'm obsessed πŸ’–


🌸 NAME 🌸

gnutls_ocsp_req_add_cert_id β€” it's an API function, no cap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/ocsp.h>

int gnutls_ocsp_req_add_cert_id(gnutls_ocsp_req_t req,
gnutls_digest_algorithm_t digest, const gnutls_datum_t *
issuer_name_hash, const gnutls_datum_t * issuer_key_hash, const
gnutls_datum_t * serial_number);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_ocsp_req_t req β€” should contain a gnutls_ocsp_req_t type. yeah literally, that's the whole vibe of this one πŸ’…
  • gnutls_digest_algorithm_t digest β€” the hash algorithm, and it's a gnutls_digest_algorithm_t value. pick your fave ✨
  • const gnutls_datum_t * issuer_name_hash β€” hash of issuer's DN. the name hash, not the key one, don't mix them up bestie 😭
  • const gnutls_datum_t * issuer_key_hash β€” hash of issuer's public key. yep, the key one πŸ—οΈ
  • const gnutls_datum_t * serial_number β€” serial number of certificate to check. the specific cert you're side-eyeing πŸ‘€

πŸ’– DESCRIPTION πŸ’–

so this function will add another request to the OCSP request for a particular certificate having the issuer name hash of issuer_name_hash and issuer key hash of issuer_key_hash (both hashed using digest) and serial number serial_number. like, you're stacking requests, one cert at a time, and it's lowkey satisfying πŸ“

the information needed corresponds to the CertID structure, and here it is in all its glory:

CertID      ::=     SEQUENCE {
hashAlgorithm       AlgorithmIdentifier, issuerNameHash      OCTET
STRING, -- Hash of Issuer's DN issuerKeyHash       OCTET STRING, -- Hash
of Issuers public key serialNumber   CertificateSerialNumber }

(that comment about the hash of the issuer's DN and the hash of the issuer's public key is doing a lot of heavy lifting in one long line, but we love it anyway πŸ’€)


πŸ”₯ RETURNS πŸ”₯

on success, GNUTLS_E_SUCCESS (0) is returned β€” slay πŸŽ‰ otherwise a negative error code is returned. so like, check your return value, fr fr. don't just vibe past a negative number πŸ™ˆ


🌈 REPORTING BUGS 🌈

found something cursed? report bugs to <bugs@gnutls.org>. they wanna hear it 🫢

home page: https://www.gnutls.org


copyright Β© 2001-2023 Free Software Foundation, Inc., and others. periodt.

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. so like, go off, just 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, visit

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

and that's the whole page, bestie 🧚 this was gnutls_ocsp_req_add_cert_id(3) from the gnutls 3.8.13 release β€” main character energy from start to finish, no notes πŸ’…βœ¨

πŸ“¦ where this page comes from