gnutls_privkey_import_pkcs11(3)

✨ gnutls_privkey_import_pkcs11 ✨

okay bestie, so this is a page from the gnutls manual, section 3 (the library-functions girlies πŸ’…), and it's literally about yeeting a PKCS#11 private key into the abstract key world. stay with me, it's cute, I promise 🫢


🌸 NAME 🌸

gnutls_privkey_import_pkcs11 β€” the API function that does exactly what it says on the tin πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/abstract.h>

int gnutls_privkey_import_pkcs11(gnutls_privkey_t pkey,
gnutls_pkcs11_privkey_t key, unsigned int flags);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_privkey_t pkey β€” the private key. the destination, the main character, the one getting the glow-up ✨
  • gnutls_pkcs11_privkey_t key β€” the private key that's getting imported. it's the one being moved in 🏠
  • unsigned int flags β€” flags for the import, bestie. they control the vibe of the whole operation πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so basically this function imports the private key you hand it into the abstract gnutls_privkey_t type. glow-up complete, she's abstract now πŸ‘‘

⚠️ lowkey important: the gnutls_pkcs11_privkey_t object must not be deallocated during the lifetime of this structure. like, do not free her while she's still being used, that's not the vibe. fr fr. 🫣

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


🌈 RETURNS 🌈

slay on success: GNUTLS_E_SUCCESS (0) comes back at you. otherwise? a negative error value, which is giving "something went wrong" energy 😭


⭐ SINCE ⭐

2.12.0 β€” she's been iconic for a while now, no cap 🧚


πŸ’€ REPORTING BUGS πŸ’€

found a bug? not me gatekeeping the address:


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, that's the whole thing, and yes, it's giving generous queen πŸ‘‘)


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

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


okay that's the whole page, you ate that πŸ“ thanks for reading, ily, go import some keys responsibly πŸ’œ

β€” brought to you by the gnutls manual, version 3.8.13 πŸ’…βœ¨ mwah, bye!!

πŸ“¦ where this page comes from