gnutls_pubkey_export(3)
π gnutls_pubkey_export(3) β the gnutls girlies' guide
okay bestie, sit down, hydrate, because we're exporting public keys today and honestly? it's giving iconic. this one lives in the gnutls manual, section 3, and it's about getting your public key out of a gnutls_pubkey_t and into the world. no cap.
β¨ NAME β¨
gnutls_pubkey_export β literally just an API function, that's the whole name, she's lowkey humble π
πΈ SYNOPSIS πΈ
#include <gnutls/abstract.h>
int gnutls_pubkey_export(gnutls_pubkey_t key, gnutls_x509_crt_fmt_t
format, void * output_data, size_t * output_data_size);
there she is. four arguments, one int return, zero drama (mostly). π¦
π«Ά ARGUMENTS π«Ά
gnutls_pubkey_t keyβ holds the certificate. yes, the doc says "certificate" even though we're exporting a public key, that's just how the original rolls, i don't make the rules πgnutls_x509_crt_fmt_t formatβ the format of output params. one ofPEMorDER. pick your fighter. β¨void * output_dataβ will contain a certificate PEM or DER encoded. this is where the goods land. π§size_t * output_data_sizeβ holds the size ofoutput_data(and will be replaced by the actual size of parameters). she comes in as your buffer size and leaves as the real size. main character energy, honestly. π
π DESCRIPTION π
this function will export the public key to DER or PEM format. the contents of the exported data is the SubjectPublicKeyInfo X.509 structure. periodt. that's the whole shape of it.
now, the important part, listen up bestie: if the buffer provided is not long enough to hold the output, then *output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. so like. she tells you how much room she needs and then bounces. π
and if the structure is PEM encoded, it will have a header of "BEGIN CERTIFICATE". yes. even for a public key. i know. we don't question the ancestors. π
β RETURNS β
in case of failure a negative error code will be returned, and 0 on success. zero is the happy number. anything negative is a vibe check that you did not pass. π
π SINCE π
2.12.0 β she's been around, she's got history, she's a legacy icon fr fr. ποΈ
π REPORTING BUGS π
report bugs to <bugs@gnutls.org>.
home page: https://www.gnutls.org
not me asking you to file a good bug report, but likeβ¦ please file a good bug report. the maintainers deserve it. π«Ά
π 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, 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/
iykyk. go read the Texinfo. it's the source of truth and she's thorough. πβ¨
and that's the whole page, bestie!! every flag, every argument, every error code, every copyright line β all present and accounted for. we ate and left zero crumbs. π
sign-off time: this was the gnutls manual, page gnutls_pubkey_export(3), version 3.8.13 β stay exported, stay iconic, and remember: 0 means success and you are that girl. πππ
π¦ 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