GNUTLS_X509_PRIVKEY_IMPORT_RSA_RAW(3)

πŸ’– NAME πŸ’–

gnutls_x509_privkey_import_rsa_raw β€” bestie it's an API function, and it's the one that takes your raw RSA numbers and turns them into a whole real key πŸŽ€


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

int gnutls_x509_privkey_import_rsa_raw(gnutls_x509_privkey_t key, const
gnutls_datum_t * m, const gnutls_datum_t * e, const gnutls_datum_t * d,
const gnutls_datum_t * p, const gnutls_datum_t * q, const gnutls_datum_t
* u);

okay so that's a LOT of arguments but we're gonna go through every single one, no skipping, promise 🫢


🌸 ARGUMENTS 🌸

  • gnutls_x509_privkey_t key β€” the lil container where the parsed key is gonna live. it's the data to store the parsed key, like the cute lil box everything gets dropped into πŸ’…
  • const gnutls_datum_t * m β€” holds the modulus. that's the big N energy, literally 🌈
  • const gnutls_datum_t * e β€” holds the public exponent. yes, the famous 65537 one, iykyk ⭐
  • const gnutls_datum_t * d β€” holds the private exponent. secret. do NOT leak this one bestie 😭
  • const gnutls_datum_t * p β€” holds the first prime (p) πŸ“
  • const gnutls_datum_t * q β€” holds the second prime (q) 🧚
  • const gnutls_datum_t * u β€” holds the coefficient πŸ‘‘
fr fr, d, p, q and u are the secret sauce. guard them with your life. πŸ”’

πŸ’– DESCRIPTION πŸ’–

so this function will convert the given RSA raw parameters into the native gnutls_x509_privkey_t format. like, glow-up transformation, raw numbers in, ✨valid key object✨ out.

the output will be stored in key.

that's it, that's the whole vibe. she takes your modular bits and bobs and makes them a real, usable private key. ate πŸ’…


πŸŽ€ RETURNS πŸŽ€

on success, GNUTLS_E_SUCCESS (0) is returned β€” iconic, zero, flawless, no notes ✨

otherwise you get a negative error value. so like, if it's negative, something went sideways and you should go read that error code. not the slay you were hoping for πŸ˜”


πŸ’€ REPORTING BUGS πŸ’€

found a bug? spill the tea to <bugs@gnutls.org> πŸ›

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 ahead, share the love, 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, go visit

https://www.gnutls.org/manual/

and that's the whole page bestie πŸ₯° this is from the gnutls manual, version 3.8.13 β€” mwah, go forth and import those RSA params responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from