GNUTLS_X509_CRQ_GET_ATTRIBUTE_DATA(3)

πŸ’– gnutls_x509_crq_get_attribute_data β€” bestie's guide to pulling attribute data out of a cert request πŸ’–

okay so this one lives in the gnutls manual, and if you're reading this you're probably deep in certificate request (CRQ) land and need to grab an attribute's data. no worries, I got you 🫢


✨ NAME ✨

gnutls_x509_crq_get_attribute_data β€” literally just an API function, that's the whole vibe


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crq_get_attribute_data(gnutls_x509_crq_t crq, unsigned
indx, void * data, size_t * sizeof_data);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crq_t crq β€” this should contain a gnutls_x509_crq_t type. like, that's what it's for, bestie.
  • unsigned indx β€” tells you which attribute number you want. use (0) to get the very first one. zero-indexed, iconic behavior πŸ’…
  • void * data β€” a pointer to a structure that's gonna hold the data (may be null, so like, it's allowed to be a little nothing)
  • size_t * sizeof_data β€” at the start, this holds the size of oid

πŸ’œ DESCRIPTION πŸ’œ

so this function returns the requested attribute data inside the certificate request. the attribute data gets stored as a string in the buffer you handed over. slay.

quick note though β€” use gnutls_x509_crq_get_attribute_info() to extract the OID. and if you'd rather get your data indexed by the attribute OID instead of by sequence, use gnutls_x509_crq_get_attribute_by_oid() instead. pick your fighter, both are valid 🌈


⭐ RETURNS ⭐

on success you get GNUTLS_E_SUCCESS (0) back, and otherwise a negative error code if something went wrong. 😭

and if you've reached the last extension available, GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. that's not a bug, that's just the end of the line, bestie.


πŸ¦‹ SINCE πŸ¦‹

2.8.0 β€” old money, she's been here a minute πŸ‘‘


πŸ“ 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 really, 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/


no cap: every flag, every argument, every error code stayed exactly where it was. the vibes are new, the facts are untouched. periodt. πŸ’…

okay bye bestie, this was gnutls version 3.8.13 from the gnutls manual β€” go read your attributes, you absolute main character ✨🫢

πŸ“¦ where this page comes from