gnutls_pkcs11_copy_x509_privkey2(3)
π gnutls_pkcs11_copy_x509_privkey2 β the glow-up edition
okay so bestie, welcome to the gnutls manual, section 3. today's main character is gnutls_pkcs11_copy_x509_privkey2, and she is literally the "put your private key on a token" girlie. sit down, hydrate, let's go. π«Ά
β¨ NAME β¨
gnutls_pkcs11_copy_x509_privkey2 β it's an API function, bestie. that's the whole name. iconic, short, no notes. π
πΈ SYNOPSIS πΈ
#include <gnutls/pkcs11.h>
int gnutls_pkcs11_copy_x509_privkey2(const char * token_url,
gnutls_x509_privkey_t key, const char * label, const gnutls_datum_t *
cid, unsigned int key_usage, unsigned int flags);
that's the whole vibe check right there. six arguments, one int coming back at you. β¨
π ARGUMENTS π
const char * token_urlβ a PKCS 11 URL that specifies a token. like, which token are we sliding into? this one. ποΈgnutls_x509_privkey_t keyβ a private key. your little secret. π€«const char * labelβ a name to be used for the stored data. give it a cute nickname, it deserves one. π·οΈconst gnutls_datum_t * cidβ the CKA_ID to set for the object -if it'sNULL, the ID will be derived from the public key. so like, leave itNULLand the universe figures it out for you. β¨unsigned int key_usageβ one ofGNUTLS_KEY_*. pick your fighter. π₯unsigned int flagsβ one ofGNUTLS_PKCS11_OBJ_*flags. seasoning, basically. π§
π DESCRIPTION π
so what does she do? this function will copy a private key into a PKCS 11 token specified by a URL. that's it, that's the job. lowkey powerful, highkey necessary. π
and here's the tea you actually need: since 3.6.3, the objects are marked as sensitive by default β unless GNUTLS_PKCS11_OBJ_FLAG_MARK_NOT_SENSITIVE is specified. so like, by default she's private-private. no cap. π
fr fr, don't go flipping that sensitivity flag unless you actually know what you're doing, bestie. the default is the default for a reason. π
β RETURNS β
on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value, which is the function's way of being like "girl, no". π
π¦ SINCE π¦
3.4.0 β she's been around a minute. vintage but still serving. π
π REPORTING BUGS π
found a bug? don't be shy, report bugs to <bugs@gnutls.org>.
home page: https://www.gnutls.org
they wanna hear from you, for real. π«Ά
π 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. so like, share it, remix it, 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/
that's your homework, bestie. go read. π
and that's the whole page! this was gnutls_pkcs11_copy_x509_privkey2, page 3 of the gnutls manual, brought to you by gnutls 3.8.13. thanks for scrolling with me, mwah πβ¨
π¦ 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