gnutls_pubkey_export2(3)
β¨ gnutls_pubkey_export2 β¨
okay bestie, gather round, because this one lives in the gnutls manual (yes, the whole big Texinfo situation, we'll get there) and it is genuinely one of the cutest little utility functions in the abstract.h family. it's giving "let me hand you your public key in a tidy format" energy and honestly? obsessed. π
π NAME π
gnutls_pubkey_export2 β an API function π¦
πΈ SYNOPSIS πΈ
#include <gnutls/abstract.h>
int gnutls_pubkey_export2(gnutls_pubkey_t key, gnutls_x509_crt_fmt_t
format, gnutls_datum_t * out);
like yes, it's a mouthful, but look at her, she's doing her best and she's slaying π
π«Ά ARGUMENTS π«Ά
gnutls_pubkey_t keyβ holds the certificate. that's the thing you're exporting from, your little key holder, your main character β¨gnutls_x509_crt_fmt_t formatβ the format of the output params, and it's one ofPEMorDER. no in-between, no third option, pick a lane bestie πgnutls_datum_t * outβ this is where the goods land. it will contain a certificate,PEMorDERencoded π
π DESCRIPTION π
so here's the tea: this function will export the public key to DER or PEM format. periodt.
and what's actually inside that exported data? it's the SubjectPublicKeyInfo X.509 structure. that's the whole vibe. no cap.
the output buffer is allocated using gnutls_malloc(), so like, that memory is yours to deal with (iykyk) π
and if the structure is PEM encoded, it will have a header of "BEGIN CERTIFICATE". iconic header, honestly. π₯
β RETURNS β
in case of failure, a negative error code gets returned. on success you get 0. simple as that, bestie, no plot twists π
π¦ SINCE π¦
3.1.3 β an elder, but a beloved one π
π REPORTING BUGS π
found something cursed? don't suffer in silence, tell the devs:
- 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.
(translation: go off, share 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/
and that's the whole page, bestie!! this was gnutls_pubkey_export2(3) from the gnutls manual, version 3.8.13 β mwah, take care, go export something pretty π
β¨π«Ά
π¦ 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