gnutls_ocsp_req_add_cert(3)
β¨ NAME β¨
gnutls_ocsp_req_add_cert β it's an API function bestie, and it's literally the one that adds a cert to your OCSP request π
This lil cutie lives in the gnutls manual, so if you're ever lost just remember: you're reading gnutls, and gnutls is your friend π«Ά
πΈ SYNOPSIS πΈ
Okay so first you gotta pull in the header, no cap:
#include <gnutls/ocsp.h>
And here's the function itself, character for character, don't @ me:
int gnutls_ocsp_req_add_cert(gnutls_ocsp_req_t req,
gnutls_digest_algorithm_t digest, gnutls_x509_crt_t issuer,
gnutls_x509_crt_t cert);
She returns an int, she takes four things, she's booked and busy π
π ARGUMENTS π
Four args, four vibes, let's go:
gnutls_ocsp_req_t reqβ bestie this one should contain agnutls_ocsp_req_ttype. Like, that's the whole assignment. She's the request you're building up πgnutls_digest_algorithm_t digestβ the hash algorithm, and it's agnutls_digest_algorithm_tvalue. Pick your fighter πgnutls_x509_crt_t issuerβ the issuer of the subject certificate. The parent, the origin story, the one who signed off πgnutls_x509_crt_t certβ the certificate you're requesting status for. This is the main character of the operation, fr fr β
π¦ DESCRIPTION π¦
So here's the tea: this function adds another request to the OCSP request for a particular certificate. One more, always room for one more, she's collecting them like stickers π
Now the way the fields get populated, listen up because this part is lowkey important. The issuer name hash, issuer key hash, and serial number fields are populated as follows:
- The issuer name and the serial number are taken from
cert. - The issuer key is taken from
issuer. - The hashed values will be hashed using the
digestalgorithm β normallyGNUTLS_DIG_SHA1.
So like, cert gives you the name and the serial, issuer gives you the key, and digest decides how everything gets hashed. It's giving teamwork, it's giving division of labour, it's iconic β¨
Ngl the GNUTLS_DIG_SHA1 thing is just "normally" β that's what the docs say, so that's what I'm telling you, periodt.
π RETURNS π
On success, GNUTLS_E_SUCCESS (0) is returned π
Otherwise you get a negative error code. Negative. As in, not the vibe. Check your error codes bestie π
π REPORTING BUGS π
Found a bug? Don't suffer in silence, tell the people:
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
They wanna hear from you, fr fr π
π 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.
(Translation: you can copy and share this file however you want, no payment needed, just keep the copyright notice and this notice attached. Slay, honestly π«Ά)
π 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/
Go read it, she's thorough, she's detailed, she ate π
Okay that's the whole page, and yes I remembered every single detail because I would never do you like that π
This was gnutls version 3.8.13, and the page itself is gnutls_ocsp_req_add_cert(3) β from the gnutls manual, obviously. Byeeee, go add some certs to that OCSP request π¦β¨
π¦ 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