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 a gnutls_ocsp_req_t type. 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 a gnutls_digest_algorithm_t value. 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 digest algorithm β€” normally GNUTLS_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:

They wanna hear from you, fr fr πŸ’Œ


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