GNUTLS_X509_PRIVKEY_IMPORT_DH_RAW(3)
β¨ gnutls_x509_privkey_import_dh_raw β¨
okay bestie, so this one is a page from the gnutls manual β specifically gnutls_x509_privkey_import_dh_raw(3) π
πΈ NAME πΈ
gnutls_x509_privkey_import_dh_raw β it's an API function, and it's the one that scoops up your raw Diffie-Hellman bits and drops them into a real key π
π¦ SYNOPSIS π¦
#include <gnutls/x509.h>
int gnutls_x509_privkey_import_dh_raw(gnutls_x509_privkey_t key, const
gnutls_dh_params_t params, const gnutls_datum_t * y, const
gnutls_datum_t * x);
no cap, that's the whole signature. write it down, copy it exactly, do not freestyle it π«Ά
π ARGUMENTS π
gnutls_x509_privkey_t keyβ the place where the parsed key is gonna live. it's literally the data to store the parsed key. that's its whole job. main character energy honestly πconst gnutls_dh_params_t paramsβ this one holds thegnutls_dh_params_t. yes, it holds the thing it's named after. iconic behaviour πconst gnutls_datum_t * yβ holds the y, and it's optional β¨ (so if you don't have a y, you're not in trouble, bestie)const gnutls_datum_t * xβ holds the x. this one you need. no optional tag on this one, nope π
π DESCRIPTION π
so the way that this works: gnutls_x509_privkey_import_dh_raw converts the Diffie-Hellman raw parameters you hand it into the native gnutls_x509_privkey_t format. glow up moment π«
and the output? it gets stored in key. that's the whole vibe. you give it raw DH stuff, it gives you a native privkey. periodt.
β RETURNS β
if everything slays, you get GNUTLS_E_SUCCESS (which is 0) back π₯³
otherwise? you get a negative error value. so like, anything less than zero means something went sideways. vibe check failed, bestie π
π REPORTING BUGS π
found a bug? don't suffer in silence, fr fr. report it to:
<bugs@gnutls.org>
home page is right here: https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
and the licensing bit, verbatim because it matters: 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 keep the receipts, okay? π§
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. so if the /usr/share/doc/gnutls/ directory does not contain the HTML form, go visit:
https://www.gnutls.org/manual/
π tiny reminder:yis optional,xis not, and a negative return value is never a good sign. stay safe out there π«Ά
okay that's the whole page!! this was gnutls 3.8.13 doing its thing, from the gnutls manual set β love you, go import some DH keys responsibly π β¨πΈ
π¦ 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