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 the gnutls_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 Β© 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: y is optional, x is 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