gnutls_pkcs11_...ached_extension(3)

✨ gnutls_pkcs11_copy_attached_extension ✨

okay bestie, so this one lives in the gnutls manual, section 3, and it's literally called gnutls_pkcs11_copy_attached_extension β€” yes the whole vibe is "copy an attached extension into a PKCS 11 token" and honestly? iconic. πŸŽ€


🌸 NAME 🌸

gnutls_pkcs11_copy_attached_extension β€” it's an API function, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/pkcs11.h>

int gnutls_pkcs11_copy_attached_extension(const char * token_url,
gnutls_x509_crt_t crt, gnutls_datum_t * data, const char * label,
unsigned int flags);

πŸ’– ARGUMENTS πŸ’–

  • const char * token_url β€” a PKCS 11 URL that specifies a token. it's giving "where are we putting this" energy ✨
  • gnutls_x509_crt_t crt β€” an X.509 certificate object πŸŽ€
  • gnutls_datum_t * data β€” the attached extension, right there in your hands
  • const char * label β€” a name to be used for the attached extension, and lowkey it may be NULL 🫢
  • unsigned int flags β€” one of GNUTLS_PKCS11_OBJ_FLAG_* (pick from that family, bestie)

🌈 DESCRIPTION 🌈

so this function will copy the attached extension sitting in data for the certificate you passed in crt, and it drops it into the PKCS 11 token specified by the URL β€” and yes, typically a trust module πŸ‘‘

the extension has to be in RFC5280 Extension format, periodt. no other format, no exceptions. πŸ“œ


⭐ RETURNS ⭐

on success you get GNUTLS_E_SUCCESS (0) back πŸ₯³ β€” otherwise it returns a negative error value, which is the universe saying "not today" 😭


🧚 SINCE 🧚

3.3.8 β€” a whole era πŸ’œ


πŸ™ˆ REPORTING BUGS πŸ™ˆ

spotted a bug? don't be shy, 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: be nice, 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/

ok bestie that's the whole thing, every flag, every argument, every caveat β€” nothing skipped, nothing invented, just vibes and accuracy πŸ’…

gnutls version 3.8.13, and this page is dated with the same release β€” mwah, love that for us πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from