gnutls_x509_crq_get_dn_by_oid(3)
gnutls_x509_crq_get_dn_by_oid π
okay bestie, this one lives in the gnutls manual, section 3, and it's literally the glow-up that pulls one specific piece of a certificate request's subject name out by OID. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
gnutls_x509_crq_get_dn_by_oid β API function πΈ
β¨ SYNOPSIS β¨
#include <gnutls/x509.h>
int gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq_t crq, const char *
oid, unsigned indx, unsigned int raw_flag, void * buf, size_t *
buf_size);
no cap, that's the whole signature, character for character π
β¨ ARGUMENTS β¨
gnutls_x509_crq_t crqβ should contain agnutls_x509_crq_ttype. that's the cert request you're snooping on, bestie πconst char * oidβ holds an Object Identifier in a null terminated string. give it the OID of the thing you want, as a null-terminated string, periodt.unsigned indxβ In case multiple same OIDs exist in the RDN, this specifies which to get. Use(0)to get the first one. so if the RDN is giving duplicate-OID energy, this is your picker π¦unsigned int raw_flagβ If non-zero returns the raw DER data of the DN part. raw mode. unfiltered. feral β¨void * bufβ a pointer to a structure to hold the name (may beNULL). yes,NULLis allowed, she's flexible πsize_t * buf_sizeβ initially holds the size ofbuf. you tell her how much room she's got, she'll tell you if it wasn't enough π
β¨ DESCRIPTION β¨
This function will extract the part of the name of the Certificate request subject, specified by the given OID. The output will be encoded as described in RFC2253. The output string will be ASCII or UTF-8 encoded, depending on the certificate data. so like, sometimes plain ASCII, sometimes UTF-8 β it depends on what the certificate data is serving π
Some helper macros with popular OIDs can be found in gnutls/x509.h. If raw flag is (0), this function will only return known OIDs as text. Other OIDs will be DER encoded, as described in RFC2253 -- in hex format with a 'using gnutls_x509_dn_oid_known().
ngl the manpage source literally trails off mid-sentence right there after that stray'β I'm not going to invent an ending for it, I'm just your faithful messenger π what I can tell you is what it actually says: known OIDs come back as text when raw flag is(0), and other OIDs come back DER encoded per RFC2253, in hex format, with a'... and then the sentence just leaves the chat. iconic behaviour, honestly π
β¨ RETURNS β¨
GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not long enough, and in that case the * buf_size will be updated with the required size. On success 0 is returned.
so: buffer too smol? you get the error and she updates * buf_size with exactly how much room she needs. then you come back with a bigger buffer and slay π zero means we ate.
β¨ REPORTING BUGS β¨
Report bugs to <bugs@gnutls.org>.
Home page: https://www.gnutls.org
found something cursed? tell the gnutls girlies, they want to know π«Ά
β¨ COPYRIGHT β¨
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. (free to share, just keep the receipts, bestie π)
β¨ 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/
that's the whole page, no crumbs left behind π this was gnutls version 3.8.13, served fresh from the gnutls 3 manpage collection, and yes the copyright is Β© 2001-2023 Free Software Foundation, Inc., and others β mwah, bye bestie πβ¨
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms