GNUTLS_X509_CRQ_GET_EXTENSION_BY_OID(3)

✨ gnutls_x509_crq_get_extension_by_oid(3) ✨

okay bestie, welcome to the gnutls corner of the manual, section 3 πŸ’– this one lives in the gnutls manual and it's genuinely so useful, i promise.


🌸 NAME 🌸

gnutls_x509_crq_get_extension_by_oid β€” it's an API function, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/x509.h>

int gnutls_x509_crq_get_extension_by_oid(gnutls_x509_crq_t crq, const
                                         char * oid, unsigned indx, void * buf,
                                         size_t * buf_size, unsigned int *
                                         critical);

like. look at her. six arguments. main character energy fr fr πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crq_t crq β€” should contain a gnutls_x509_crq_t type. that's the certificate request you're digging through 🫢
  • const char * oid β€” holds an Object Identifier in a null terminated string. yes it has to be null terminated, don't play with her πŸ™ˆ
  • unsigned indx β€” in case multiple same OIDs exist in the extensions, this specifies which to get. use (0) to get the first one. so if you've got a lil collection of the same OID, this is your picker ✨
  • void * buf β€” a pointer to a structure to hold the name (may be null). may be null!! she's flexible πŸ’œ
  • size_t * buf_size β€” initially holds the size of buf
  • unsigned int * critical β€” will be non-zero if the extension is marked as critical. so if this comes back with something in it, that extension is critical, pay attention bestie 😭

πŸ’– DESCRIPTION πŸ’–

this function will return the extension specified by the OID in the certificate. the extensions will be returned as binary data DER encoded</>, in the provided buffer.

that's it. that's the whole vibe. you give her an OID, she hands you back DER-encoded binary bytes in your buffer πŸ“


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned πŸ’š otherwise a negative error code in case of an error.

and if the certificate does not contain the specified extension, you get GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE β€” which is basically gnutls gently saying "girl, that's not in here" 😭 not a crash, just a negative number.


🌈 SINCE 🌈

2.8.0 β€” she's been around a minute, an icon, a legend πŸ‘‘


🧚 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. slay, that's the license, keep the notice 🫢


πŸ¦„ 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/

ok that's the whole page bestie, every flag, every error code, every copyright line, all of it πŸ’… now go read your certificate requests ✨

gnutls version 3.8.13 β€” mwah, love u, bye πŸŽ€πŸ’–πŸŒΈ

πŸ“¦ where this page comes from