gnutls_x509_ex...rt_key_purposes(3)

πŸ’– gnutls_x509_ext_import_key_purposes β€” the manual, but make it cute πŸ’–

okay bestie, so this is a page from the gnutls manual, and it's all about one lil function that does one lil job. let's get into it ✨


πŸŽ€ NAME πŸŽ€

gnutls_x509_ext_import_key_purposes β€” it's an API function, that's the whole name, no notes πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509-ext.h>

int gnutls_x509_ext_import_key_purposes(const gnutls_datum_t * ext,
gnutls_x509_key_purposes_t p, unsigned int flags);

there she is. that's the whole signature, don't touch it 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const gnutls_datum_t * ext β€” the DER-encoded extension data. that's the raw bytes you're handing over, bestie πŸ’œ
  • gnutls_x509_key_purposes_t p β€” the key purposes. this is where the good stuff lands.
  • unsigned int flags β€” should be zero. like, zero. that's it. that's the whole requirement.

✨ DESCRIPTION ✨

okay so here's the vibe: this function will extract the key purposes out of the DER-encoded ExtKeyUsageSyntax PKIX extension you passed in, and drop them into a gnutls_x509_key_purposes_t type. iconic behavior honestly πŸ”₯

πŸ’€ real talk though: the data must be initialized. not optional. do that first or it's giving chaos.

🌈 RETURNS 🌈

on success you get GNUTLS_E_SUCCESS (which is 0, the good number, the slay number) πŸŽ‰

otherwise? a negative error value. so like, if it's negative, something went wrong, and that's your sign πŸ™ˆ


⭐ SINCE ⭐

3.3.0 β€” she's been around a minute, lowkey a legend πŸ‘‘


πŸ“ REPORTING BUGS πŸ“

found a bug? don't be shy, tell the gnutls girlies:


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 page, no cap πŸ’… mwah! this one came from the gnutls manual, version 3.8.13, and yeah it's literally titled gnutls_x509_ext_import_key_purposes(3) β€” go forth and parse those key purposes, bestie 🫢✨

πŸ“¦ where this page comes from