gnutls_pcert_import_rawpk(3)

πŸ’– gnutls_pcert_import_rawpk β€” bestie edition πŸ’–

okay so this is a page from the gnutls manual, and the function we're hyping up today is gnutls_pcert_import_rawpk. yes it's an API function, yes it's lowkey niche, and yes we're gonna make it make sense. πŸŽ€


✨ SYNOPSIS ✨

#include <gnutls/abstract.h>

int gnutls_pcert_import_rawpk(gnutls_pcert_st * pcert, gnutls_pubkey_t
       pubkey, unsigned int flags);

like, that's the whole vibe. one include, one function call, three args. slay. πŸ’…


🌸 ARGUMENTS 🌸

  • gnutls_pcert_st * pcert β€” bestie, this is the pcert struct you're importing the data into. it's the destination. the main character, honestly.
  • gnutls_pubkey_t pubkey β€” the raw public key, in gnutls_pubkey_t format, that's getting imported. it's the guest of honor. 🫢
  • unsigned int flags β€” zero for now. that's it. that's the whole thing. no flags, no options, nothing. it's giving "reserved for later." 😭

πŸ’œ DESCRIPTION πŸ’œ

so this convenience function does one (1) thing and it does it well: it imports β€” aka converts β€” the raw public key pubkey you hand it into a gnutls_pcert_st structure. glow-up complete. ✨

⚠️ okay listen, two things you CANNOT skip: 1. after you're done, you must deinitialize that structure with gnutls_pcert_deinit(). clean up after yourself, bestie. 2. the pubkey you passed in must not be deinitialized by you. nope. it's now associated with the pcert structure you gave it, and it gets deinitialized with it. so if you deinit it yourself you're double-dipping and that's not the move. πŸ™ˆ

🌈 RETURNS 🌈

on success you get GNUTLS_E_SUCCESS (0) back. anything else? a negative error value. so like, if (ret < 0) β€” you know the drill. πŸ‘‘


⭐ SINCE ⭐

3.6.6 β€” so it's been around a minute. vintage, but make it fresh. πŸ¦‹


πŸŽ€ REPORTING BUGS πŸŽ€

found a bug? don't suffer in silence, tell the people:


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. fr fr, that's the whole deal. πŸ’–


πŸ”₯ 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, go visit:

https://www.gnutls.org/manual/

iykyk. go read the docs, bestie, they ate. πŸ’…


and that's the page!! this was gnutls version 3.8.13, page gnutls_pcert_import_rawpk(3) β€” mwah, take care of your pcerts and deinit responsibly. bye bestie 🫢✨

πŸ“¦ where this page comes from