gnutls_x509_privkey_get_key_id(3)
π gnutls_x509_privkey_get_key_id β the gnutls manual, bestie edition π
okay so this is a page from the gnutls manual (yes the whole manual, we're just vibing with one page of it), and it's all about pulling a lil unique ID out of a private key. let's get into it π«Ά
β¨ NAME β¨
gnutls_x509_privkey_get_key_id β it's an API function, periodt.
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_privkey_get_key_id(gnutls_x509_privkey_t key, unsigned
int flags, unsigned char * output_data, size_t * output_data_size);
look at her. iconic signature. π
π ARGUMENTS π
gnutls_x509_privkey_t keyβ bestie this is a key. that's the whole description. a key. πunsigned int flagsβ should be one of the flags fromgnutls_keyid_flags_t, no cap, pick from that list.unsigned char * output_dataβ this is where the key ID is gonna land. it will contain the key ID. manifesting β¨size_t * output_data_sizeβ holds the size ofoutput_data, and heads up, it will be replaced by the actual size of parameters. so it's not staying the same, it's getting a glow-up.
π¦ DESCRIPTION π¦
so this function returns a unique ID that depends on the public key parameters. the way that it works is it's derived from the public key params, so if you're like "hmm does this certificate correspond to this key??" β you can use this ID to check that. vibe check for certs fr fr.
now the important part, and not me being dramatic, this is genuinely important: if the buffer you provided is not long enough to hold the output, then *output_data_size gets updated and you get GNUTLS_E_SHORT_MEMORY_BUFFER back. so she tells you how much room she actually needs. π
and the output will normally be a SHA-1 hash output, which is 20 bytes. twenty. bytes. remember that number. π
β RETURNS β
on success you get GNUTLS_E_SUCCESS (that's 0) returned to you, slay. otherwise you get a negative error value. negative = not slay. π
π REPORTING BUGS π
found a bug? don't suffer in silence bestie, report it 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.
(translation: go off, share it, just keep the notice. we love a permissive queen. π )
π₯ 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, then go visit:
https://www.gnutls.org/manual/
iykyk, that's where the whole manual lives. π§
and that's the page!! this was gnutls 3.8.13, manual page gnutls_x509_privkey_get_key_id(3), and honestly? she ate. stay hydrated, read your manpages, and remember: 20 bytes. πβ¨π
π¦ 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