gnutls_ocsp_req_get_cert_id(3)
π gnutls_ocsp_req_get_cert_id β the manual page, but make it make sense π
okay bestie, so this is a page from the gnutls manual, and today's main character is gnutls_ocsp_req_get_cert_id(3). she's an API function. she's a little niche. she's everything if you're poking at OCSP requests. let's get into it π¦
β¨ NAME β¨
gnutls_ocsp_req_get_cert_id β API function π
πΈ SYNOPSIS πΈ
#include <gnutls/ocsp.h>
int gnutls_ocsp_req_get_cert_id(gnutls_ocsp_req_const_t req, unsigned
indx, gnutls_digest_algorithm_t * digest, gnutls_datum_t *
issuer_name_hash, gnutls_datum_t * issuer_key_hash, gnutls_datum_t *
serial_number);
like yes she takes six arguments. she's high maintenance. she's worth it. π
π«Ά ARGUMENTS π«Ά
gnutls_ocsp_req_const_t reqβ this one should contain agnutls_ocsp_req_ttype. it's your request, queen, hand her over.unsigned indxβ Specifies which extension OID to get. Use(0)to get the first one. π (yes that is literally what the docs say, i'm not making it up, i would never)gnutls_digest_algorithm_t * digestβ an output variable that gets thegnutls_digest_algorithm_thash algorithm. she's writing back to you, bestie.gnutls_datum_t * issuer_name_hashβ output buffer with the hash of issuer's DN πgnutls_datum_t * issuer_key_hashβ output buffer with the hash of issuer's public key πgnutls_datum_t * serial_numberβ output buffer with the serial number of the certificate to check π
π DESCRIPTION π
so basically, this function will return the certificate information of the indx'ed request in the OCSP request. it's giving "let me look inside this request and pull out the cert tea". β
the information returned corresponds to the CertID structure, and here it is in all her glory:
CertID ::= SEQUENCE {
hashAlgorithm AlgorithmIdentifier, issuerNameHash OCTET
STRING, -- Hash of Issuer's DN issuerKeyHash OCTET STRING, -- Hash
of Issuers public key serialNumber CertificateSerialNumber }
ngl that formatting is a whole journey, but every bit of it matters βhashAlgorithm,issuerNameHash(hash of Issuer's DN),issuerKeyHash(hash of Issuers public key), andserialNumber(CertificateSerialNumber). no cap. π§
and the best part? each of the pointers to output variables may be NULL to indicate that the caller is not interested in that value. so if you don't care about, say, the serial number, just pass NULL and move on with your life. lowkey iconic of the API designers honestly. π
β RETURNS β
- On success,
GNUTLS_E_SUCCESS(0) is returned π - otherwise, a negative error code is returned π
- and if you have reached the last
CertIDavailable,GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLEwill be returned π« (that's your "you've hit the end, bestie, go home" signal)
π REPORTING BUGS π
found a bug? don't suffer in silence, that's not the vibe. 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. periodt. π
π 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 version 3.8.13, and the page itself is gnutls_ocsp_req_get_cert_id(3) β go forth and read those CertIDs, you absolute icon πβ¨π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms