gnutls_tpm_privkey_generate(3)
π gnutls_tpm_privkey_generate π
okay bestie, welcome to the gnutls manual β yes, that's the manual name, she's iconic, she's been here forever π
β¨ NAME β¨
gnutls_tpm_privkey_generate β an API function, and she's the one who makes your TPM chip β¨birthβ¨ a private key
πΈ SYNOPSIS πΈ
#include <gnutls/tpm.h>
int gnutls_tpm_privkey_generate(gnutls_pk_algorithm_t pk, unsigned int
bits, const char * srk_password, const char * key_password,
gnutls_tpmkey_fmt_t format, gnutls_x509_crt_fmt_t pub_format,
gnutls_datum_t * privkey, gnutls_datum_t * pubkey, unsigned int flags);
like, look at all those arguments. she's high maintenance but she's worth it π
π¦ ARGUMENTS π¦
okay so let's meet the cast, one by one, no skips:
gnutls_pk_algorithm_t pkβ the public key algorithm, aka what flavor of key we're making hereunsigned int bitsβ the security bits, the ~strength~ numberconst char * srk_passwordβ a password to protect the exported key. it's optional, so no pressure bestie π«Άconst char * key_passwordβ the password for the TPM. also optional πgnutls_tpmkey_fmt_t formatβ the format of the private keygnutls_x509_crt_fmt_t pub_formatβ the format of the public keygnutls_datum_t * privkeyβ the generated key, the moment we've all been waiting for πgnutls_datum_t * pubkeyβ the corresponding public key, and heads up, it may be nullunsigned int flagsβ should be a list ofGNUTLS_TPM_*flags
π DESCRIPTION π
so what does she actually do? This function will generate a private key in the TPM chip. and no, the key does not leave home β the private key will be generated within the chip and will be exported in a wrapped with TPM's master key form. yes, "wrapped with TPM's master key form", that's the vibe, that's the whole point π₯
Furthermore, the wrapped key can be protected with the provided password β you know, that srk_password we met up there.
lowkey important note:bitsin TPM is a quantized value. If the input value is not one of the allowed values, then it will be quantized to one of512,1024,2048,4096,8192and16384. so don't come in here with your random little numbers and expect them to survive, bestie π she's rounding you to the nearest one of those, periodt.
Allowed flags are:
(that's it. that's the list. she said "allowed flags are:" and thenβ¦ nothing. iconic honestly π)
β RETURNS β
On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so if you see a negative number, that's your sign, it's giving "something went wrong" π
π SINCE π
3.1.0 β she's been around, she's a veteran, main character energy from day one π
π REPORTING BUGS π
found a bug? don't be shy, tell the girlies:
- 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.
(so like, copy it, share it, remix it β just keep the receipts, bestie π)
π 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/
iykyk β go read the whole Texinfo manual, she's long but she's thorough πΈ
okay that's the whole page, we ate and left no crumbs π
this was gnutls manual, version 3.8.13 β thanks for reading bestie, go generate some keys in your TPM and slay β¨ππ¦
π¦ 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