GNUTLS_X509_CRT_GET_AUTHORITY_KEY_ID(3)

πŸ’… gnutls_x509_crt_get_authority_key_id(3)

okay bestie, so this one lives in the gnutls manual, and it's literally the function that goes "hey, what's the authority key id on this cert?" Let's get into it 🫢


✨ NAME ✨

gnutls_x509_crt_get_authority_key_id β€” it's an API function, no cap 🌸


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

int gnutls_x509_crt_get_authority_key_id(gnutls_x509_crt_t cert, void *
id, size_t * id_size, unsigned int * critical);

like. she's a mouthful but she's iconic πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crt_t cert β€” this one should contain a gnutls_x509_crt_t type. that's the cert you're interrogating, periodt.
  • void * id β€” the place where the identifier will be copied. yes, the place. you bring the buffer, she fills it πŸ“
  • size_t * id_size β€” holds the size of the id field. she needs to know how much room she's working with.
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical. (may be null β€” so if you don't care, you can just pass NULL and vibe 🌈)

πŸ’– DESCRIPTION πŸ’–

So what does she actually do? This function will return the X.509v3 certificate authority's key identifier. Slay.

Where does she get it? From the X.509 Authority Key identifier extension field β€” that's 2.5.29.35, write it down bestie, it comes up.

⚠️ okay this is the important part, don't scroll past it: this function only returns the keyIdentifier field of the extension. and it'll give you GNUTLS_E_X509_UNSUPPORTED_EXTENSION if the extension contains the name and serial number of the certificate instead. In that case, gnutls_x509_crt_get_authority_key_gn_serial() may be used. like, different function, different job, iykyk 😭

🌟 RETURNS 🌟

On success, GNUTLS_E_SUCCESS (0) is returned πŸŽ‰

  • if the extension isn't there, you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE β€” she's not mad, it's just not present πŸ’€
  • otherwise, a negative error value. negative = bad vibes, check it.

πŸ› REPORTING BUGS πŸ›

Found a bug? Don't be shy, report bugs to <bugs@gnutls.org>. 🫢

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


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. (yes that's the whole legal bit, keep it, it's required, no skips πŸ’œ)


🌈 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 one's from gnutls 3.8.13 β€” go forth and read those authority key ids, you've got this, main character energy only πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from