gnutls_privkey_import_x509(3)

✨ gnutls_privkey_import_x509(3) ✨

okay so bestie, we're in the gnutls manual and today's main character is gnutls_privkey_import_x509 πŸ’– it's an API function, it's iconic, and it's here to move your private key into its abstract-era glow-up. let's get into it 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_import_x509(gnutls_privkey_t pkey,
gnutls_x509_privkey_t key, unsigned int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_privkey_t pkey β€” the private key πŸ’… this is the destination, the one getting the glow-up.
  • gnutls_x509_privkey_t key β€” the private key that's getting imported, aka the source, the one doing the arriving.
  • unsigned int flags β€” the flags for the import, the little settings that decide how this whole thing goes down ✨

πŸ’– DESCRIPTION πŸ’–

so what this function does is it takes the private key you hand it and imports it into the abstract gnutls_privkey_t type. that's the whole vibe. it's giving "move over, we're abstract now" πŸ¦‹

⚠️ IMPORTANT BESTIE ⚠️ the gnutls_x509_privkey_t object must not be deallocated during the lifetime of this structure. like, do not free it while this thing is still alive, fr fr. that's a real one 😭

and the flags situation? it might be zero, or it might be one of GNUTLS_PRIVKEY_IMPORT_AUTO_RELEASE and GNUTLS_PRIVKEY_IMPORT_COPY. pick your fighter πŸ’…


🌈 RETURNS 🌈

on success you get GNUTLS_E_SUCCESS (0) back, slay ✨ otherwise you get a negative error value, which is the "not me getting a negative number" moment πŸ™ˆ


⭐ SINCE ⭐

2.12.0 β€” an elder, an OG, we respect her πŸ‘‘


πŸ› REPORTING BUGS πŸ›

found a bug? report it to <bugs@gnutls.org>. don't be shy, they wanna know 🫢

home page: https://www.gnutls.org


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. periodt πŸ’œ


πŸ‘€ 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/

and that's the whole page bestie, no cap πŸŽ€ this was gnutls_privkey_import_x509(3) from the gnutls manual, version 3.8.13 β€” ty for reading, mwah πŸ’–πŸ§šπŸŒΈ

πŸ“¦ where this page comes from