gnutls_pkcs11_copy_x509_crt2(3)

✨ gnutls_pkcs11_copy_x509_crt2 β€” NAME ✨

okay so bestie πŸ’– this is gnutls_pkcs11_copy_x509_crt2, an API function living in the gnutls manual (section 3, the library-functions girlies). It's the one that copies a cert into a PKCS 11 token, and yes she serves. πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_copy_x509_crt2(const char * token_url,
gnutls_x509_crt_t crt, const char * label, const gnutls_datum_t * cid,
unsigned int flags);

that signature is copy-pasted exactly, no cap, don't let anyone tell you otherwise πŸ’…


🫢 ARGUMENTS 🫢

  • const char * token_url β€” a PKCS 11 URL that specifies a token. that's the where, bestie. πŸ“
  • gnutls_x509_crt_t crt β€” the certificate you're copying. the whole point of the mission. 🌟
  • const char * label β€” the name to be used for the stored data. this is what you're calling it. name her, she deserves it. ✨
  • 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 like, hand it an ID or hand it nothing and it'll do the math itself, main character energy fr fr πŸ”₯
  • unsigned int flags β€” one of GNUTLS_PKCS11_OBJ_FLAG_*. pick your flag, girlie. 🚩

πŸ’– DESCRIPTION πŸ’–

This function will copy a certificate into a PKCS 11 token specified by a URL. periodt.

Valid flags to mark the certificate:

  • 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 four, no more no less, that's the vibe check and she passed. πŸ’―


πŸ¦‹ RETURNS πŸ¦‹

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value.

so 0 means slay, negative means we're crying in the group chat 😭


⭐ SINCE ⭐

3.4.0 β€” she's been iconic since day one, lowkey a legend. πŸ‘‘


πŸ› REPORTING BUGS πŸ›

Report bugs to <bugs@gnutls.org>.

Home page: https://www.gnutls.org

if something's broken, tell the maintainers, not me, I'm just the messenger bestie 🫢

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.

like, free to share, just keep the receipts, that's the rule. πŸ’œ


🌈 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/

go read it, iykyk πŸ“šβœ¨


and that's the whole page bestie πŸ’– written for the gnutls manual, version 3.8.13, page gnutls_pkcs11_copy_x509_crt2(3) β€” go forth and copy those certs, you absolute icon πŸ‘‘πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from