gnutls_x509_crt_get_key_id(3)
π gnutls_x509_crt_get_key_id β bestie edition β¨
okay so this page lives in the gnutls manual (yeah, the whole gnutls docs set, section 3, the library-functions corner) and it's literally about pulling a key ID out of a certificate. sit down, hydrate, let's go π«Ά
πΈ NAME πΈ
gnutls_x509_crt_get_key_id β the API function that gets you that key ID, no cap
β¨ SYNOPSIS β¨
#include <gnutls/x509.h>
int gnutls_x509_crt_get_key_id(gnutls_x509_crt_t crt, unsigned int
flags, unsigned char * output_data, size_t * output_data_size);
π ARGUMENTS π
gnutls_x509_crt_t crtβ holds the certificate, bestie. that's the one we're reading from πunsigned int flagsβ should be one of the flags fromgnutls_keyid_flags_t. pick one, don't be chaotic πunsigned char * output_dataβ will contain the key ID. this is where the magic lands β¨size_t * output_data_sizeβ holds the size ofoutput_data(and will be replaced by the actual size of parameters). yes, it gets overwritten, it's giving in-and-out energy π
π DESCRIPTION π
this function will return a unique ID that depends on the public key parameters. that's the whole vibe β same key params, same ID.
this ID can be used in checking whether a certificate corresponds to the given private key. so like, "is this cert the one that matches my key?" β that's the question it answers, and it answers it slayfully π
if the buffer provided is not long enough to hold the output, then *output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. so it tells you how much room you actually needed, which is honestly so thoughtful of it π
the output will normally be a SHA-1 hash output, which is 20 bytes. twenty. bytes. periodt.
β RETURNS β
in case of failure a negative error code will be returned, and 0 on success. zero is the happy number, negative is the "not me crying in errno" number π
π₯ REPORTING BUGS π₯
found a bug? don't gatekeep it, tell the people:
- 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. so like, go off, just keep the receipt π§Ύπ
π 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/
fr fr, go read the full Texinfo manual if you want the deep lore. this page is the group chat summary, not the whole syllabus π
and that's the page bestie!! π
β¨ this was gnutls 3.8.13, dated with all the love, brought to you by the gnutls_x509_crt_get_key_id(3) girlies. mwah, go get that key ID ππ¦πΈ
π¦ 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