gnutls_pkcs12_export2(3)

πŸ’– gnutls_pkcs12_export2(3) β€” the gnutls manual, bestie edition πŸ’–

okay so you're here for gnutls_pkcs12_export2, a function in the gnutls manual, and honestly? she's a whole vibe. let's get into it πŸŽ€


✨ NAME ✨

gnutls_pkcs12_export2 β€” API function. yes bestie, that's the whole name, she's lowkey mysterious like that πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/pkcs12.h>

int gnutls_pkcs12_export2(gnutls_pkcs12_t pkcs12, gnutls_x509_crt_fmt_t
format, gnutls_datum_t * out);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • gnutls_pkcs12_t pkcs12 β€” a pkcs12 type, aka the little bundle of joy you're about to yeet out into the world ✨
  • gnutls_x509_crt_fmt_t format β€” the format of the output params. it's giving one of PEM or DER, pick your fighter, no in-between 🫢
  • gnutls_datum_t * out β€” will contain a structure PEM or DER encoded. this is where the goods land, bestie πŸ“¦

πŸ’œ DESCRIPTION πŸ’œ

so basically: this function will export the pkcs12 structure to DER or PEM format. that's it, that's the job, and she does it flawlessly, periodt πŸ‘‘

The output buffer is allocated using gnutls_malloc(). noting this fr fr β€” so you're gonna want to free it properly when you're done, iykyk.

If the structure is PEM encoded, it will have a header of "BEGIN PKCS12". iconic header, no cap 🌈


⭐ RETURNS ⭐

In case of failure a negative error code will be returned, and 0 on success. so like β€” negative means 😭, zero means πŸ₯³. check it every time, don't be messy.


πŸŽ€ SINCE πŸŽ€

3.1.3 β€” she's been around a minute, a true veteran of the codebase πŸ’–


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? Report bugs to <bugs@gnutls.org>. don't suffer in silence bestie, tell the devs 🫢

Home page: https://www.gnutls.org


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. slay, that's the license, keep the receipt πŸ’…


🌈 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/

like genuinely go read it, it's the main character of documentation 🧚


reminder bestie: the buffer comes from gnutls_malloc(), so treat it like the precious thing it is and free it when you're done. no leaks in this household πŸ’€

and that's the whole page!! this came from the gnutls manual, version 3.8.13, and the page itself is gnutls_pkcs12_export2(3). ty for reading my little info dump, go export something gorgeous πŸ“πŸ’œ

πŸ“¦ where this page comes from