gnutls_x509_ext_export_policies(3)

✨ gnutls_x509_ext_export_policies ✨

okay bestie, gather round πŸ’– this one lives in the gnutls manual (section 3, the library-functions girlies), and it's genuinely such a useful little function. no cap.


🌸 NAME 🌸

gnutls_x509_ext_export_policies β€” it's an API function, and it's here to turn your policies into certificate policy extension bytes πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/x509-ext.h>

int gnutls_x509_ext_export_policies(gnutls_x509_policies_t policies,
gnutls_datum_t * ext);

πŸ’… ARGUMENTS πŸ’…

  • gnutls_x509_policies_t policies β€” a pointer to an initialized policies. like, it has to be initialized, okay? don't come at it with a random uninitialized struct, that's not the vibe πŸ™ˆ
  • gnutls_datum_t * ext β€” this is where the DER-encoded extension data lands. and listen β€” you MUST free it using gnutls_free(). do not forget. forgetting is giving memory leak energy and we do not stan πŸ’€

πŸ‘‘ DESCRIPTION πŸ‘‘

so what does this actually do? it takes the policies you handed it and converts them into a certificate policy DER-encoded extension, specifically the OID 2.5.29.32. iconic extension, no notes ✨

and the ext data? that gets allocated using gnutls_malloc(). so yeah, that's why you free it with gnutls_free() β€” matching allocator, matching freer, that's the rule 🫢


🌈 RETURNS 🌈

on success you get GNUTLS_E_SUCCESS (which is 0) back. slay πŸŽ‰ anything else means a negative error value, so like… check it. fr fr.


⭐ SINCE ⭐

3.3.0 β€” she's been around a while, a true veteran πŸ’œ


πŸ“ REPORTING BUGS πŸ“

found a bug? don't suffer in silence, 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. (yes, that's the whole thing, and yes, it's very generous of them πŸ’–)


πŸ”₯ 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 was gnutls version 3.8.13 talking, dropping the gnutls_x509_ext_export_policies(3) knowledge straight into your group chat. go export those policies and free that ext, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from