gnutls_pkcs12_export(3)
β¨ gnutls_pkcs12_export(3) β¨
okay bestie, grab your strawberry matcha π because we're diving into the gnutls manual and this one is genuinely so cute. it's gnutls_pkcs12_export, living in the gnutls manual pages, and it does exactly one thing: it takes your pkcs12 vibe and turns it into bytes you can actually write somewhere. iconic behavior tbh π
π NAME π
gnutls_pkcs12_export β API function. that's it, that's the name, no notes β¨
π¦ SYNOPSIS π¦
#include <gnutls/pkcs12.h>
int gnutls_pkcs12_export(gnutls_pkcs12_t pkcs12, gnutls_x509_crt_fmt_t
format, void * output_data, size_t * output_data_size);
like. look at her. four args, one job, zero drama π«Ά
πΈ ARGUMENTS πΈ
gnutls_pkcs12_t pkcs12β a pkcs12 type, aka your main character, the thing you're exporting πgnutls_x509_crt_fmt_t formatβ the format of output params. literally one ofPEMorDER, pick your fighter π₯void * output_dataβ will contain a structure PEM or DER encoded. this is where the good stuff lands β¨size_t * output_data_sizeβ holds the size ofoutput_data(and will be replaced by the actual size of parameters). so it's an in-and-out situation, very versatile of her π
π DESCRIPTION π
This function will export the pkcs12 structure to DER or PEM format. slay.
If the buffer provided is not long enough to hold the output, then *output_data_size will be updated and GNUTLS_E_SHORT_MEMORY_BUFFER will be returned. so like, she's not gonna crash out, she's just gonna tell you the actual size you need and hand you back an error code. no cap, very polite of her π
If the structure is PEM encoded, it will have a header of "BEGIN PKCS12". periodt π
bestie heads up: that short-buffer thing is not a fail-fail, it's a "try again with a bigger buffer" moment. *output_data_size gets rewritten with the size you actually need, so read it back before you retry π₯
π RETURNS π
In case of failure a negative error code will be returned, and 0 on success. zero is the happy number, negative is the "aww" number π
π§ REPORTING BUGS π§
Found a bug? not me manifesting but okay, 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. iconic and generous fr fr π
β 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 whole thing, it's giving encyclopedia but make it cute πβ¨
and that's the whole page, bestie! this one came from gnutls 3.8.13, page gnutls_pkcs12_export(3) π go forth and export your pkcs12 structures responsibly ππ¦
π¦ 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