gnutls_x509_crt_set_spki(3)
β¨ gnutls_x509_crt_set_spki β¨
okay bestie, buckle up π we're in the gnutls manual, and this lil function is called gnutls_x509_crt_set_spki. it's an API function, it lives in the gnutls section, and it's about to let you hand a certificate its very own SubjectPublicKeyInfo. no cap.
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
int gnutls_x509_crt_set_spki(gnutls_x509_crt_t crt, const
gnutls_x509_spki_t spki, unsigned int flags);
likeβ¦ three arguments, one int back. simple. iconic. π
π ARGUMENTS π
gnutls_x509_crt_t crtβ a certificate of typegnutls_x509_crt_t. yes queen, the actual cert you're messing with πconst gnutls_x509_spki_t spkiβ a SubjectPublicKeyInfo structure of typegnutls_x509_spki_t. this is the glow-up you're giving the cert β¨unsigned int flagsβ must be zero. literally zero. nothing else. not one bit of drama allowed π«
π« DESCRIPTION π«
so the way that this works is: this function will set the certificate's subject public key information explicitly. like, you're not letting it guess, you're telling it. main character energy fr fr.
and why would you even do that? because bestie, this is intended to be used in the cases where a single public key (e.g., RSA) can be used for multiple signature algorithms (RSA PKCS1-1.5, and RSA-PSS). one key, multiple algorithms, we love a versatile icon π
π
ok so if you wanna export the public key β i.e., the SubjectPublicKeyInfo part β check gnutls_pubkey_import_x509(). that's your girl for that π«Ά
π¦ RETURNS π¦
On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value.
soβ¦ 0 = slay, anything negative = we're crying π
β SINCE β
3.6.0 β she's been here a minute, an OG π
π REPORTING BUGS π
found a bug? don't just post about it, actually tell the devs:
- 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.
(translation: you can share this file, 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/
iykyk, the Texinfo manual is where the deep lore lives π
and that's the whole page bestie!! this was gnutls 3.8.13, page gnutls_x509_crt_set_spki(3), and yeah the date slot on this one was giving absolutely nothing (empty, as usual, we don't question it π). go set that SPKI, stay hydrated, and remember: flags is zero, periodt. ππ¦πΈ
π¦ 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