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 of PEM or DER, 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 of output_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 Β© 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