gnutls_x509_crt_get_policy(3)

✨ gnutls_x509_crt_get_policy(3) ✨

okay bestie, so this is a page from the gnutls manual β€” like, the official docs for the gnutls library β€” and it's all about pulling a certificate policy out of an X.509 cert. it's giving very "let me peek inside this certificate real quick" energy πŸ’…


🌸 NAME 🌸

gnutls_x509_crt_get_policy β€” API function


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/x509.h>

int gnutls_x509_crt_get_policy(gnutls_x509_crt_t crt, unsigned indx,
struct gnutls_x509_policy_st * policy, unsigned int * critical);

πŸ’– ARGUMENTS πŸ’–

  • gnutls_x509_crt_t crt β€” should contain a gnutls_x509_crt_t type. yes literally, that's the vibe, it's the certificate you're interrogating πŸ•΅οΈβ™€οΈ
  • unsigned indx β€” this specifies which policy to return. use (0) to get the first one. so like, index 0 is your main character, and everything after is the supporting cast ✨
  • struct gnutls_x509_policy_st * policy β€” a pointer to a policy structure. this is where the tea gets poured β˜•
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical. so if this comes back non-zero, bestie, the cert is being serious about it 🚨

πŸ¦‹ DESCRIPTION πŸ¦‹

this function will extract the certificate policy (extension 2.5.29.32) specified by the given index. slay, we love a targeted extraction πŸ’–

the policy returned by this function must be deinitialized by using gnutls_x509_policy_release(). not me stressing this β€” it's literally in the docs. clean up after yourself, periodt 🧹

🌈 RETURNS 🌈

  • on success, GNUTLS_E_SUCCESS (0) is returned πŸ‘‘
  • GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE if the extension is not present (so like, the policy said "i'm not coming to the function today" 😭)
  • otherwise a negative error value πŸ’€

⭐ SINCE ⭐

3.1.5 β€” old money, iconic, been here since forever πŸŽ€


🫢 REPORTING BUGS 🫢

found a bug? 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. no cap, you can share this fr fr πŸ’…


🧚 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 came straight out of the gnutls manual, version 3.8.13, for gnutls_x509_crt_get_policy(3) β€” go forth and extract those policies, you've got this πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from