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 ofGNUTLS_KEY_*. pick your usage vibe from that family. πunsigned int flagsβ one of theGNUTLS_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 π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms