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 type gnutls_x509_crt_t. yes queen, the actual cert you're messing with πŸ‘‘
  • const gnutls_x509_spki_t spki β€” a SubjectPublicKeyInfo structure of type gnutls_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:


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