gnutls_pkcs7_get_attr(3)

πŸ’– gnutls_pkcs7_get_attr(3) β€” the gnutls manual, bestie edition πŸ’–

okay so we're diving into the gnutls manual and this specific page is all about gnutls_pkcs7_get_attr, an API function. sit down, grab a boba, we're getting a PKCS 7 attribute out of a list and it's gonna be ✨flawless✨


🌸 NAME 🌸

gnutls_pkcs7_get_attr β€” literally just an API function, that's the whole name, no notes πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/pkcs7.h>

int gnutls_pkcs7_get_attr(gnutls_pkcs7_attrs_t list, unsigned idx, char
** oid, gnutls_datum_t * data, unsigned flags);

like, copy that exactly bestie, don't freestyle it 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_pkcs7_attrs_t list β€” a list of existing attributes, or NULL if you want the very first one. starting fresh, main character energy πŸ‘‘
  • unsigned idx β€” the index of the attribute you're trying to get. which one? that one. 🎯
  • char ** oid β€” the OID of the attribute. and it's read-only, so don't even think about touching it πŸ™ˆ
  • gnutls_datum_t * data β€” the raw data of the attribute. raw. unfiltered. πŸ“
  • unsigned flags β€” zero, or GNUTLS_PKCS7_ATTR_ENCODE_OCTET_STRING. those are the options, that's it, periodt πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does this do? it will get a PKCS 7 attribute from the provided list. simple. iconic. obsessed.

here's the tea though: the OID is a constant string, but data will be allocated and it must be deinitialized by the caller. not me reminding you to clean up after yourself 😭 free your data, bestie, it's the right thing to do.


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned β€” slay! πŸŽ‰

otherwise you get a negative error value, which is giving less slay but still informative.

and specifically: GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned if there are no data in the current index. empty. void. nothing there. πŸ’€


🌈 SINCE 🌈

3.4.2 β€” she's been around, she's a veteran, respect her πŸ’œ


🫢 REPORTING BUGS 🫢

found a bug? don't suffer in silence, tell the 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. so like, go off, share 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/


lowkey the whole vibe here is: grab the attribute, check your return value, free your data, and move on with your life. no cap. πŸ”₯

and that's the page, bestie!! this was gnutls_pkcs7_get_attr(3) from gnutls version 3.8.13 β€” she ate, she left no crumbs, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from