gnutls_pkcs11_copy_pubkey(3)

πŸ’– gnutls_pkcs11_copy_pubkey(3) πŸ’–

okay bestie, welcome to the gnutls manual, this one's gnutls_pkcs11_copy_pubkey and it's literally the "put my public key on a token" button. let's get into it 🫢


✨ NAME ✨

gnutls_pkcs11_copy_pubkey β€” an API function, and yes she's serving exactly what the name says πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_copy_pubkey(const char * token_url, gnutls_pubkey_t
pubkey, const char * label, const gnutls_datum_t * cid, unsigned int
key_usage, unsigned int flags);

there she is. six arguments. no cap. πŸ“


πŸŽ€ ARGUMENTS πŸŽ€

  • const char * token_url β€” a PKCS 11 URL that specifies a token. like, which token are we talking to, bestie? πŸ”‘
  • gnutls_pubkey_t pubkey β€” the public key you wanna copy. the main character of this whole function tbh πŸ‘‘
  • const char * label β€” the name that's gonna be used for the stored data. her government name ✨
  • const gnutls_datum_t * cid β€” the CKA_ID to set for the object -if NULL, the ID will be derived from the public key. so either you hand it over or it just figures itself out, we love an independent queen πŸ¦‹
  • unsigned int key_usage β€” one of GNUTLS_KEY_*. pick your usage, periodt 🌈
  • unsigned int flags β€” one of GNUTLS_PKCS11_OBJ_FLAG_*. flag girlies rise 😌

πŸ’œ DESCRIPTION πŸ’œ

so this function will copy a public key object into a PKCS 11 token specified by a URL. it's giving "move in, make yourself at home" 🏠

valid flags to mark the key:

  • GNUTLS_PKCS11_OBJ_FLAG_MARK_TRUSTED
  • GNUTLS_PKCS11_OBJ_FLAG_MARK_PRIVATE
  • GNUTLS_PKCS11_OBJ_FLAG_MARK_CA
  • GNUTLS_PKCS11_OBJ_FLAG_MARK_ALWAYS_AUTH

those are the ones allowed for marking, don't go inventing your own, bestie πŸ™ˆ


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value, which is the universe's way of saying "not today" 😭


πŸ¦‹ SINCE πŸ¦‹

3.4.6 β€” vintage but still iconic, we stan a classic πŸ’–


πŸ’€ REPORTING BUGS πŸ’€

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

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. so like, go off, 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/

and that's the whole vibe check bestie 🫢 this was gnutls version 3.8.13, page gnutls_pkcs11_copy_pubkey(3) β€” go forth and copy those public keys, you absolute legend πŸ’…πŸŒΈπŸ’–

πŸ“¦ where this page comes from