gnutls_x509_crt_set_policy(3)

πŸ’… gnutls_x509_crt_set_policy(3) β€” the gnutls manual, but make it make sense

okay bestie, sit down, hydrate, because we're about to give your certificate a whole ✨personality✨ (it's a policy, it's literally its vibe statement). This one lives in the gnutls manual, section 3, and it's an API function. Let's get into it 🫢


✨ NAME ✨

gnutls_x509_crt_set_policy β€” API function


🌈 SYNOPSIS 🌈

#include <gnutls/x509.h>

int gnutls_x509_crt_set_policy(gnutls_x509_crt_t crt, const struct
gnutls_x509_policy_st * policy, unsigned int critical);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crt_t crt β€” bestie this one "should contain a gnutls_x509_crt_t type". that's it, that's the requirement. it's the cert we're decorating πŸ’–
  • const struct gnutls_x509_policy_st * policy β€” a pointer to a policy. the actual vibe content. πŸ‘‘
  • unsigned int critical β€” pass something non-zero if you want this extension marked as critical. like, loudly critical. 🚨

πŸ’œ DESCRIPTION πŸ’œ

So what this function does is it sets the certificate policy extension β€” that's 2.5.29.32 for the OID girlies β€” onto your cert. ✨

And here's the fun part: it appends. Call it multiple times and you just keep stacking new policies. multiple calls = multiple policies. it's giving collect-them-all. 🌸

⚠️ Now the important bit, no cap: the max text size for the qualifier GNUTLS_X509_QUALIFIER_NOTICE is 200 characters. Go over that and this function will fail with GNUTLS_E_INVALID_REQUEST. so watch your character count, bestie, this is not the place for an essay 😭

⭐ RETURNS ⭐

On success you get GNUTLS_E_SUCCESS β€” which is 0, slay. πŸŽ‰

Otherwise you get a negative error value. so if the number's negative, something's off, and you should go read it. periodt.


πŸ¦‹ SINCE πŸ¦‹

3.1.5 β€” it's been around a while, it's iconic, it's established. πŸ’…


πŸ™ˆ REPORTING BUGS πŸ™ˆ

Found something cursed? Report bugs to <bugs@gnutls.org>.

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. (yes queen, redistribute it, 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/


k bye that's the whole page, mwah πŸ’–

this has been gnutls_x509_crt_set_policy(3) from gnutls 3.8.13 β€” the gnutls manual, version 3.8.13, same page name in the footer, go set some policies and stay hydrated 🫢✨🌈

πŸ“¦ where this page comes from