gnutls_pubkey_set_spki(3)

πŸ’– gnutls_pubkey_set_spki β€” from the gnutls manual πŸ’–

okay bestie, pull up a chair, we're reading the gnutls manual together and honestly? this one's a little gem πŸŽ€

✨ NAME ✨

gnutls_pubkey_set_spki β€” it's an API function, periodt πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_pubkey_set_spki(gnutls_pubkey_t pubkey, const
                           gnutls_x509_spki_t spki, unsigned int flags);

like, three arguments, one include, very demure, very mindful πŸ¦‹


🫢 ARGUMENTS 🫢

  • gnutls_pubkey_t pubkey β€” a public key, and its type is literally gnutls_pubkey_t. no notes πŸ’–
  • const gnutls_x509_spki_t spki β€” a SubjectPublicKeyInfo structure, typed as gnutls_pubkey_spki_t. yes, the param says gnutls_x509_spki_t and the description says gnutls_pubkey_spki_t β€” that's what the page says, don't @ me, I'm just the messenger πŸ™ˆ
  • unsigned int flags β€” must be zero. zero. z e r o. that's the whole vibe check πŸ‘‘

πŸ’« DESCRIPTION πŸ’«

This function will set the public key information. πŸ’…

The provided spki must be initialized. not optional, not "ehh probably fine", it must be initialized. iykyk 😭


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so if it's not zero and it's negative, that's your sign something went sideways πŸ’€


🌈 SINCE 🌈

3.6.0 β€” vintage, but make it iconic πŸ‘‘


πŸŽ€ REPORTING BUGS πŸŽ€

Found a bug? spill the tea, bestie:


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: free to copy, just keep the receipts 🧾✨)


πŸ”₯ 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/

lowkey the whole page in one breath: init your spki, pass 0 for flags, get GNUTLS_E_SUCCESS (0) or a negative error back. that's it. that's the function. slay πŸ’…

and that's a wrap, bestie β€” this one came straight out of the gnutls manual, version 3.8.13, dated gnutls, and you understood every single word of it fr fr πŸ¦‹πŸ’–

πŸ“¦ where this page comes from