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 ofPEMorDER. 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 π
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 inout, free it with the right free, check for0. 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
- 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