gnutls_x509_policies_get(3)

πŸ’– gnutls_x509_policies_get β€” the girlies are fetching ONE policy πŸ’…

okay so bestie, this one lives in the gnutls manual (yes, that gnutls β€” the TLS library, the icon, the moment) and it's literally called gnutls_x509_policies_get. It's an API function. No cap. πŸŽ€


✨ NAME ✨

gnutls_x509_policies_get β€” API function πŸ¦‹


🌸 SYNOPSIS 🌸

#include <gnutls/x509-ext.h>

int gnutls_x509_policies_get(gnutls_x509_policies_t policies, unsigned
       int seq, struct gnutls_x509_policy_st * policy);

like, there she is. three arguments, one int return, we love a clean signature πŸ’œ


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_policies_t policies β€” the policies, periodt. this is the whole collection you're digging through.
  • unsigned int seq β€” the index of the name to get πŸ‘‘ i.e. which one you want out of the list.
  • struct gnutls_x509_policy_st * policy β€” will hold the policy. she's an out-param, she's holding the goods, she's doing her thing. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works: this function will return a specific policy as stored in the policies type. Like, you point at index seq and boom, out comes that policy. ✨

⚠️ big vibe-check moment: the returned values should be treated as constant and are valid for the lifetime of policies. Do not be out here editing them, bestie, and don't go using them after policies is gone. It's giving "borrowed, not yours." 😭

Also! The any policy OID is available as the GNUTLS_X509_OID_POLICY_ANY macro. Write that down. πŸ“


🌈 RETURNS 🌈

  • On success, GNUTLS_E_SUCCESS (0) is returned πŸ₯³ slay.
  • GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE if the index is out of bounds β€” aka you asked for a policy that does not exist, and the library is politely telling you no. πŸ’€
  • otherwise, a negative error value. check your errors, always. 🫢

⭐ SINCE ⭐

3.3.0 β€” she's been around a minute, she's a classic, she's an elder icon πŸ’–


πŸ™ˆ REPORTING BUGS πŸ™ˆ

Found a bug? Not the vibe, but tell the people:


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. (fr fr, royalty-free, just keep the notice, that's the whole deal 🌸)


🧚 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 manual page for gnutls_x509_policies_get, from the gnutls 3.8.13 era β€” mwah, take care of her, and remember: check your return values, treat the data as constant, and stay hydrated πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from