gnutls_dh_params_export_pkcs3(3)
β¨ gnutls_dh_params_export_pkcs3(3) β¨
okay bestie, welcome to the gnutls manual, section 3 β this is the one about gnutls_dh_params_export_pkcs3, and yes it's a whole API function, and yes it's lowkey iconic π
πΈ NAME πΈ
gnutls_dh_params_export_pkcs3 β an API function, no cap. it takes your DH params and yeets them out into PKCS3 format π¦
π SYNOPSIS π
#include <gnutls/gnutls.h>
int gnutls_dh_params_export_pkcs3(gnutls_dh_params_t params,
gnutls_x509_crt_fmt_t format, unsigned char * params_data, size_t *
params_data_size);
like literally just include <gnutls/gnutls.h> and you're in π
β ARGUMENTS β
gnutls_dh_params_t paramsβ this is where your DH parameters live. it holds them. that's its whole job π«Άgnutls_x509_crt_fmt_t formatβ the format you want the output in. it's one ofPEMorDER, pick your fighter β¨unsigned char * params_dataβ this buffer is gonna contain a PKCS3DHParamsstructure, encoded as PEM or DER πsize_t * params_data_sizeβ holds the size ofparams_datagoing in, and gets replaced by the actual size of the parameters coming out. it's giving glow-up, it changes π₯
π DESCRIPTION π
so what does this function actually do? it exports the dh parameters you hand it into a PKCS3 DHParams structure. and not just any random format β this is the exact format that the "openssl dhparam" tool generates, so you know it's legit π
and here's the thing: if the buffer you provided is not long enough to hold the output, you're not getting a silent truncation situation, no ma'am β instead GNUTLS_E_SHORT_MEMORY_BUFFER gets returned, and you go make your buffer bigger π
also, if the structure ends up PEM encoded, it will have a header of "BEGIN DH PARAMETERS". periodt. that's the header. don't argue with it π
π¦ RETURNS π¦
on success, GNUTLS_E_SUCCESS (0) is returned. slay β¨ otherwise you get a negative error code back, which is the universe telling you something went wrong π
π REPORTING BUGS π
found a bug? don't suffer in silence, bestie β report it to <bugs@gnutls.org>. π§
home page: https://www.gnutls.org β go, look, it's giving official π
π 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. fr fr, go forth and redistribute π
π 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/
and that's the whole page, bestie π«Ά this came to you from gnutls, version 3.8.13, and it's gnutls_dh_params_export_pkcs3(3) β go export those params, you're the main character now π
β¨
π¦ 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