gnutls_ocsp_resp_get_certs(3)
β¨ gnutls_ocsp_resp_get_certs β¨
okay bestie, so this one lives in the gnutls manual, section 3 (that's the library-functions section, iykyk π ), and it's about pulling certificates out of an OCSP response. yes it's as niche as it sounds and yes it's iconic. let's go π¦
πΈ NAME πΈ
gnutls_ocsp_resp_get_certs β it's an API function babes, that's the whole vibe π
β¨ SYNOPSIS β¨
#include <gnutls/ocsp.h>
int gnutls_ocsp_resp_get_certs(gnutls_ocsp_resp_const_t resp,
gnutls_x509_crt_t ** certs, size_t * ncerts);
π ARGUMENTS π
gnutls_ocsp_resp_const_t respβ this one should contain agnutls_ocsp_resp_ttype. like, that's its whole job. hand it the response, bestie π«Άgnutls_x509_crt_t ** certsβ this is where a newly allocated array ofgnutls_x509_crt_tcertificates lands. fresh out the box, no cap β¨size_t * ncertsβ an output variable holding the number of allocated certs. the receipts, basically π§Ύ
π DESCRIPTION π
so what does this function actually do. it will extract the X.509 certificates found in the Basic OCSP Response. that's the tea. the certs output variable is gonna hold a newly allocated zero-terminated array stuffed with X.509 certificates π
now listen, this part matters. every single certificate in the array needs to be de-allocated with gnutls_x509_crt_deinit(), and the array itself must be freed using gnutls_free(). both. you don't get to skip one. that's the rules, periodt π
okay and here's the cute flexible bit: both the certs and ncerts variables may be NULL. when that happens the function still works as normal, it just won't return the NULL-d information. so you can use it to get only the number of certificates, or to just get the certificate array without its size. choose your own adventure, bestie π
ngl, if you pass NULL you're literally saying "no thank you, I don't want that info" and the function respects it. it's very unbothered of it π
β RETURNS β
On success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value and you're gonna have to deal with that. sorry bestie π
π REPORTING BUGS π
found a bug? report bugs to <bugs@gnutls.org>. π
home page is right here: https://www.gnutls.org β go look, it's giving official ποΈ
π 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. so like, take it, remix it, just don't erase the credits π«Άβ¨
π₯ SEE ALSO π₯
the full documentation for gnutls is maintained as a Texinfo manual. and if the /usr/share/doc/gnutls/ directory does not contain the HTML form, then bestie you go visit:
https://www.gnutls.org/manual/
and that's the whole page, mwah π this was gnutls_ocsp_resp_get_certs(3) from the gnutls manual, version 3.8.13, brought to you by the gnutls crew. go forth and de-allocate your certificates, bestie, I believe in you π¦ππ
π¦ 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