gnutls_x509_crt_import(3)

✨ gnutls_x509_crt_import(3) ✨

okay bestie, so this is a page from the gnutls manual β€” the gnutls_x509_crt_import(3) one πŸ’– β€” and it's literally the glow-up moment where your raw cert bytes become a real, native gnutls certificate object. no cap. let's get into it πŸ¦‹


🌸 NAME 🌸

gnutls_x509_crt_import β€” it's an API function, and it's the one that pulls your DER/PEM cert into gnutls-land πŸŽ€


🫢 SYNOPSIS 🫢

#include <gnutls/x509.h>

int gnutls_x509_crt_import(gnutls_x509_crt_t cert, const gnutls_datum_t
* data, gnutls_x509_crt_fmt_t format);

πŸ’… ARGUMENTS πŸ’…

  • gnutls_x509_crt_t cert β€” the place where the parsed certificate gets stored. it's giving "the data to store the parsed certificate", and honestly that's the whole vibe ✨
  • const gnutls_datum_t * data β€” your cert, either DER or PEM encoded. come as you are, both formats welcome πŸ₯°
  • gnutls_x509_crt_fmt_t format β€” and you gotta tell it which one: it's one of DER or PEM. no guessing games here, bestie, you pick πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

so what this function does is literally convert the DER or PEM encoded Certificate you hand it into the native gnutls_x509_crt_t format ✨ and the output lands in cert β€” that's where it's stored, periodt πŸ’…

and if your Certificate is PEM encoded? heads up: it should have a header of "X509 CERTIFICATE", or "CERTIFICATE". that's the vibe check your PEM has to pass πŸŽ€


πŸ‘‘ RETURNS πŸ‘‘

on success, GNUTLS_E_SUCCESS (0) is returned πŸ₯³ otherwise you get a negative error value β€” aka it did not slay, and you should go check what happened 😭


πŸ› REPORTING BUGS πŸ›

found a bug? do NOT suffer in silence, bestie, report it πŸ’Œ


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. iconic behaviour honestly 🫢


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

and that's the whole page, bestie β€” this one's from gnutls 3.8.13, brought to you by the fine folks maintaining the gnutls_x509_crt_import(3) page in the gnutls manual πŸ’– go forth and parse those certs, you've got this πŸŒŸπŸŽ€

πŸ“¦ where this page comes from