gnutls_dh_params_export2_pkcs3(3)

✨ NAME ✨

gnutls_dh_params_export2_pkcs3 β€” bestie, it's an API function πŸ’… and it's here to turn your DH params into a PKCS3 DHParams glow-up ✨


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_dh_params_export2_pkcs3(gnutls_dh_params_t params,
gnutls_x509_crt_fmt_t format, gnutls_datum_t * out);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_dh_params_t params β€” okay so this one holds the DH parameters. It's the whole point of the operation, the main character fr πŸ‘‘
  • gnutls_x509_crt_fmt_t format β€” the format of output params. One of PEM or DER. Pick your vibe, bestie, you literally can't have both πŸ’œ
  • gnutls_datum_t * out β€” this is where the output lives. It will contain a PKCS3 DHParams structure, PEM or DER encoded, depending on what you asked for above πŸ¦‹

🧚 DESCRIPTION 🧚

So like. This function will export the given dh parameters to a PKCS3 DHParams structure. No cap. And get this β€” this is the format generated by the "openssl dhparam" tool πŸ”₯ so if you're interoperating with that, you're eating, you're slaying, you're done.

The data in out will be allocated using gnutls_malloc(). Remember that β€” it's yours to free later, so don't ghost it πŸ™ˆ

If the structure is PEM encoded, it will have a header of "BEGIN DH PARAMETERS". Iconic header, honestly. The way that header just announces itself πŸ’–


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error code is returned. So like, zero = slay, negative = not slay 😭 check your return values bestie, always.


🌈 SINCE 🌈

Available since 3.1.3 β€” she's been around a while, she's a legend, periodt πŸ‘‘


🫢 REPORTING BUGS 🫢

Found something cursed? Report bugs to <bugs@gnutls.org> πŸ’Œ they actually want to know.

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. So like, 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/

tl;dr: hand it your params, tell it PEM or DER, catch the datum in out, free it with the right free, check for 0. that's the whole arc, bestie πŸ’–

okay bye ily, this was gnutls version 3.8.13 talking, and the page you just read was gnutls_dh_params_export2_pkcs3(3) β€” stay hydrated and always check your return codes βœ¨πŸ’…πŸŽ€

πŸ“¦ where this page comes from