gnutls_privkey_export_pkcs11(3)

✨ gnutls_privkey_export_pkcs11 ✨

okay bestie, welcome to the gnutls manual, section 3 πŸŽ€ this one's called gnutls_privkey_export_pkcs11 and it's literally the glow-up spell that turns your abstract private key into a PKCS#11 one πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_export_pkcs11(gnutls_privkey_t pkey,
gnutls_pkcs11_privkey_t * key);

like. that's it. that's the whole vibe πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_privkey_t pkey β€” the private key itself, the main character πŸ‘‘
  • gnutls_pkcs11_privkey_t * key β€” the spot where the exported key gets dropped off, aka the location for the key to be exported πŸ’–

πŸ’« DESCRIPTION πŸ’«

so basically this function converts the abstract private key you hand it into a gnutls_pkcs11_privkey_t type ✨

important bestie: the key must be of type GNUTLS_PRIVKEY_PKCS11. no cap. if it isn't, this whole thing is not gonna slay for you 😭

and the key that comes back in key? you must deinitialize it with gnutls_pkcs11_privkey_deinit(). it's giving "you broke it, you clean it up" 🧹 don't just leave it there, that's so not the move πŸ™ˆ


🫢 RETURNS 🫢

on success, GNUTLS_E_SUCCESS (0) is returned πŸ’š otherwise you get a negative error value, which is the code equivalent of "it's not you, it's the parameters" πŸ’€


🌈 SINCE 🌈

3.4.0 β€” she's been iconic since day one, fr fr ⭐


πŸ¦‹ REPORTING BUGS πŸ¦‹

found a bug? tell the girlies at bugs@gnutls.org πŸ“§

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 πŸ’– (yes, you can share it, go off, 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/

and that's a wrap, babe πŸŽ€ this was gnutls_privkey_export_pkcs11 from the gnutls 3.8.13 era, page 3 of the manual, and honestly? she ate πŸ’… go forth and deinit your keys, ily 🫢✨

πŸ“¦ where this page comes from