gnutls_pkcs11_copy_x509_privkey(3)

πŸ’– gnutls_pkcs11_copy_x509_privkey β€” the tea β˜•

okay bestie, welcome to the gnutls manual, specifically the page for gnutls_pkcs11_copy_x509_privkey(3). yes it's a mouthful, no we are not shortening it, it's iconic and it knows it. πŸ’…

This one is an API function, and it's about moving your private key into a PKCS 11 token. Very "handing your diary to a locked safe" energy. Let's go. ✨


✨ NAME ✨

gnutls_pkcs11_copy_x509_privkey β€” API function


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_copy_x509_privkey(const char * token_url,
gnutls_x509_privkey_t key, const char * label, unsigned int key_usage,
unsigned int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • const char * token_url β€” a PKCS 11 URL that points at a token. it's literally the address of where you want the goods to land. πŸ“
  • gnutls_x509_privkey_t key β€” the private key itself. the main character, tbh. πŸ‘‘
  • const char * label β€” the name you wanna give to the stored data. yes, you get to name it. choose wisely, it's giving baby-name energy. 🍼
  • unsigned int key_usage β€” one of GNUTLS_KEY_*. pick your usage vibe from that family. πŸ”‘
  • unsigned int flags β€” one of the GNUTLS_PKCS11_OBJ_* flags. you know the drill. 🚩

πŸ’œ DESCRIPTION πŸ’œ

so what does this do? it copies a private key into a PKCS 11 token, and that token is specified by a URL. that's the whole plot. simple, effective, slay. πŸ’–

Since 3.6.3, the objects are marked as sensitive by default β€” unless you specify GNUTLS_PKCS11_OBJ_FLAG_MARK_NOT_SENSITIVE. so if you don't want them sensitive you have to actively say so. no cap, that's the rule. 🫢


⭐ RETURNS ⭐

on success you get GNUTLS_E_SUCCESS (that's 0, bestie), and otherwise you get a negative error value. so if the number is negative, that's your sign something went sideways. 😭


🌸 SINCE 🌸

2.12.0 β€” an elder, lowkey. it's been doing this since way back. πŸ’€


πŸ™ˆ REPORTING BUGS πŸ™ˆ

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

Report bugs to <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. (very generous of them, honestly. we love a permissive 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, visit

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


okay that's the whole page, bestie!! you understood it, i'm so proud. this was the gnutls manual, version 3.8.13, page gnutls_pkcs11_copy_x509_privkey(3). mwah, go copy some keys responsibly. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from