gnutls_x509_crq_set_dn_by_oid(3)

πŸ’– gnutls_x509_crq_set_dn_by_oid(3) πŸ’–

okay bestie, welcome to the gnutls manual, section 3 (that's the library-functions section, iykyk) ✨ this one's about naming a certificate request, so like… the ✨identity✨ part. let's get into it 🫢


🌸 NAME 🌸

gnutls_x509_crq_set_dn_by_oid β€” it's an API function, periodt πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

int gnutls_x509_crq_set_dn_by_oid(gnutls_x509_crq_t crq, const char *
oid, unsigned int raw_flag, const void * data, unsigned int
sizeof_data);

she's a little long, but she's iconic πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_x509_crq_t crq β€” this one should contain a gnutls_x509_crq_t type. that's the cert request you're dressing up πŸ’…
  • const char * oid β€” holds an Object Identifier in a (0)-terminated string. yes, a zero-terminated string, like a normal C string bestie 🌈
  • unsigned int raw_flag β€” must be 0, or 1 if the data are DER encoded. so 0 = "here's my nice lil string", 1 = "here's raw DER bytes, don't touch" 😌
  • const void * data β€” a pointer to the input data πŸ‘‘
  • unsigned int sizeof_data β€” holds the size of data. don't forget her, she matters fr fr πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

so the vibe here is: this function sets the part of the name of the Certificate request subject that's specified by the given OID. it's giving "pick which field of the subject name you're filling in" πŸŽ€

the input string should be ASCII or UTF-8 encoded. no random encodings, okay? she's picky 🌸

some helper macros with popular OIDs can be found in gnutls/x509.h β€” go look, they're literally right there 🫢

here's the important part though: with this function you can only set the known OIDs. wanna test if an OID is known? that's gnutls_x509_dn_oid_known(), use her πŸ”

and for OIDs that are not known (by gnutls)? then you gotta properly DER encode your data, and call this function with raw_flag set. no shortcuts, bestie, that's the rule βœ‹

not me making you DER encode your own stuff… but gnutls doesn't know those OIDs so she can't do it for you, that's just the deal πŸ’€

🌟 RETURNS 🌟

on success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value. so if it's negative… something went wrong, bestie 😭


πŸ› REPORTING BUGS πŸ›

found a bug? report it to <bugs@gnutls.org> 🫢 they wanna know, fr fr

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. so like, keep the receipts, that's all she asks πŸ’…


🌈 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/

aaaand that's the whole page, bestie πŸŽ€ this was gnutls_x509_crq_set_dn_by_oid(3) from the gnutls manual, version 3.8.13 β€” slay, go name some certificate requests, mwah πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from