gnutls_pkcs11_privkey_generate(3)

πŸ’– gnutls_pkcs11_privkey_generate(3) πŸ’–

okay so bestie, welcome to the gnutls manual β€” this one's from the gnutls gang, and today's main character is gnutls_pkcs11_privkey_generate. she's an API function. she makes keys. inside tokens. she does NOT let them leave. we love a homebody queen πŸ‘‘


✨ NAME ✨

gnutls_pkcs11_privkey_generate β€” literally just an API function, that's the whole name, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_privkey_generate(const char * url,
gnutls_pk_algorithm_t pk, unsigned int bits, const char * label,
unsigned int flags);

like. look at her. five arguments. she's doing the most and honestly? slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • const char * url β€” the token URL, aka the address of the little token house where the key is gonna live 🏠
  • gnutls_pk_algorithm_t pk β€” the public key algorithm, so she knows what flavour of crypto we're serving today
  • unsigned int bits β€” the security bits, aka how beefy we're going πŸ”₯
  • const char * label β€” a label. just a lil name tag so you can find her later 🏷️
  • unsigned int flags β€” should be zero. that's it. zero. nothing else. don't be spicy with this one πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: this function generates a private key in the token that you specified with url.

and the iconic part β€” the key gets generated within the token and it is not exportable. she stays in the house. forever. no cap, you cannot take her out. that's the whole point of the vibe. πŸ”’βœ¨


⭐ RETURNS ⭐

if everything goes right, you get GNUTLS_E_SUCCESS (which is 0, the good number, the green flag 🟒).

otherwise? a negative error value. so if it's negative, something went sideways, and you should go look at that 😭


πŸ¦‹ SINCE πŸ¦‹

3.0 β€” she's been around, she's a veteran, she's got seniority πŸ’…


πŸ‘‘ REPORTING BUGS πŸ‘‘

found a bug? do NOT gatekeep, tell the devs:


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. (basically: share the love, 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, go visit:

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

and that's the whole page bestie, no crumbs left, every flag and path accounted for 🧚

this has been gnutls version 3.8.13 bringing you gnutls_pkcs11_privkey_generate (3) β€” stay encrypted, stay unbothered, and may all your return values be 0 πŸŒΈπŸ’–πŸŽ€

πŸ“¦ where this page comes from