gnutls_x509_cr...key_purpose_oid(3)

πŸ’– gnutls_x509_cr...key_purpose_oid(3) πŸ’–

okay bestie, sit down, hydrate, because we're talking about gnutls_x509_crt_set_key_purpose_oid β€” part of the gnutls manual, and honestly? she's a baddie. this is the one that tells a certificate what it's allowed to be used for. main character energy for your X.509 certs, fr fr. πŸŽ€


✨ NAME ✨

gnutls_x509_crt_set_key_purpose_oid β€” it's an API function, periodt. πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crt_set_key_purpose_oid(gnutls_x509_crt_t cert, const
void * oid, unsigned int critical);

like, look at her. three args, one return, no drama. πŸ¦‹


🫢 ARGUMENTS 🫢

  • gnutls_x509_crt_t cert β€” bestie this is your certificate, and it's gotta be of type gnutls_x509_crt_t. no substitutions, no knockoffs, the real thing only. πŸ‘‘
  • const void * oid β€” a pointer to a null terminated string that holds the OID. yes, null terminated, she needs her little \0 at the end or she's lost. 😭
  • unsigned int critical β€” this is the vibe check on your extension: are we marking it critical or not? that's literally it, that's the whole question. ⭐

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea: this function sets the key purpose OIDs of the Certificate. the way that they live inside the Extended Key Usage extension (2.5.29.37) β€” iconic behavior, no cap. and if you want human readable names instead of raw OID strings? go look at the GNUTLS_KP_* definitions. iykyk. πŸ’œ

and listen β€” subsequent calls to this function will append OIDs to the OID list. so it's not a "replace everything" situation, it's a "yes and" situation. every call stacks another one on. so don't call it twice thinking you're overwriting, because you are absolutely not. πŸ™ˆ


🌈 RETURNS 🌈

on success you get GNUTLS_E_SUCCESS (0) and honestly? we love a zero. otherwise you get a negative error code, which is giving "something went wrong, go read the error". 😭


πŸ› REPORTING BUGS πŸ›

found a bug? don't suffer in silence, bestie. report it to <bugs@gnutls.org> β€” they want to hear from you fr fr. 🫢

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 forth and share, 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 page, bestie!! ✨ this one's from gnutls 3.8.13 (source/version, as promised) β€” go set some key purpose OIDs and slay responsibly. mwah. πŸ’‹πŸŽ€

πŸ“¦ where this page comes from