gnutls_x509_crq_import(3)

πŸ’– gnutls_x509_crq_import β€” like, the glow-up ritual for a certificate request πŸ’–

okay bestie, so this is a page from the gnutls manual, and today's main character is gnutls_x509_crq_import(3). she takes your raw bytes and turns them into a whole actual object, no cap. let's get into it πŸ¦‹


✨ NAME ✨

gnutls_x509_crq_import β€” an API function. that's it, that's the name, she's literally just a function living her life πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_crq_import(gnutls_x509_crq_t crq, const gnutls_datum_t *
data, gnutls_x509_crt_fmt_t format);

yes she's a C function, yes you have to #include <gnutls/x509.h>, yes the return type is int. we move 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_crq_t crq β€” this is the lil container where the parsed certificate request gets stored. think of it as the cute little box you're putting the gift into 🎁
  • const gnutls_datum_t * data β€” the DER or PEM encoded certificate. your raw bytes, your source material, the before picture πŸ“Έ
  • gnutls_x509_crt_fmt_t format β€” one of DER or PEM. pick your encoding, bestie, there are exactly two and you must choose 🌈

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: this function converts the given DER or PEM encoded certificate request into a gnutls_x509_crq_t type. the output gets stored in crq β€” like, that's where it lands, that's its new home ✨

⚠️ and listen, this part matters: if the Certificate is PEM encoded it should have a header of "NEW CERTIFICATE REQUEST". not "certificate request", not "CSR", not whatever you feel like typing at 3am. that exact string, or it's not gonna vibe. πŸ™ˆ

⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (which is 0, iconic) is returned. otherwise you get a negative error value β€” so like, if it's negative, something went wrong and it's not your moment 😭


🌈 REPORTING BUGS 🌈

found a bug? spill. report bugs to <bugs@gnutls.org> β€” they wanna hear it 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, go off, share it, remix 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/

that's the whole rabbit hole, bestie, go read it πŸ•³οΈπŸ’–


and that's the page!! mwah πŸ’‹

this was the gnutls manual, version 3.8.13, for gnutls_x509_crq_import(3) β€” thanks for coming to my ted talk, ily, bye πŸŽ€πŸ’œπŸ¦‹

πŸ“¦ where this page comes from