gnutls_certificate_get_crt_raw(3)
π gnutls_certificate_get_crt_raw(3) π
okay bestie, so this one lives in the gnutls manual and it's genuinely such a handy lil function. it's an API function, and it's about pulling raw certs out of your credentials object. let's get into it π
β¨ NAME β¨
gnutls_certificate_get_crt_raw β API function
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int gnutls_certificate_get_crt_raw(gnutls_certificate_credentials_t sc,
unsigned idx1, unsigned idx2, gnutls_datum_t * cert);
π¦ ARGUMENTS π¦
gnutls_certificate_credentials_t scβ bestie this is agnutls_certificate_credentials_ttype, that's the whole vibe.unsigned idx1β the index of the certificate chain, like, if multiple chains are present. multiple? yes queen, pick one.unsigned idx2β the index of the certificate in the chain. and listen: zero gives you the server's certificate.0= main character energy πgnutls_datum_t * certβ this is gonna hold the DER encoded certificate. it's the output, it's the moment β¨
π DESCRIPTION π
so what does it actually do? it returns the DER encoded certificate of the server, or literally any other certificate on its certificate chain β which one you get depends on idx2. slay.
β οΈ okay important, no cap: the returned data should be treated as constant and is only accessible during the lifetime of sc. do not go freeing it, do not go outliving your credentials object, that's not the move. π
and idx1 matches the value from gnutls_certificate_set_x509_key() and friends. the functions. the little squad. iykyk π
β RETURNS β
- on success, you get
GNUTLS_E_SUCCESS(0) back. we love a zero. π - otherwise it's a negative error value, as per usual.
- and if the indexes are out of bounds? you get
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLEreturned. so if you're out here asking for a cert that doesn't exist... that's the answer bestie π
π SINCE π
3.2.5 β an elder, honestly. been here since 3.2.5 and still serving. periodt.
π«Ά REPORTING BUGS π«Ά
found a bug? don't suffer in silence, tell the gnutls girlies:
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
π 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.
π§ 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 babes π this was gnutls 3.8.13 hitting you with gnutls_certificate_get_crt_raw(3), straight from the gnutls manual. go forth and grab those raw certs responsibly, ily, bye π¦πΈβ¨
π¦ 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