gnutls_privkey_import_rsa_raw(3)

✨ NAME ✨

gnutls_privkey_import_rsa_raw β€” it's an API function, bestie πŸ’…

This one lives in the gnutls manual, and it's all about taking your raw RSA numbers and making them into a real, usable key. iykyk πŸŽ€


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_import_rsa_raw(gnutls_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, const gnutls_datum_t * e1, const gnutls_datum_t * e2);

🫢 ARGUMENTS 🫢

okay so, meet the whole squad, every single one of them is a const gnutls_datum_t * except the first one, periodt:

  • gnutls_privkey_t key β€” the structure that's gonna hold your parsed key. this is the glow-up container ✨
  • const gnutls_datum_t * m β€” holds the modulus, no cap
  • const gnutls_datum_t * e β€” holds the public exponent
  • const gnutls_datum_t * d β€” holds the private exponent (optional, so you can skip it if you must πŸ™ˆ)
  • 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 (optional)
  • const gnutls_datum_t * e1 β€” holds e1 = d mod (p-1) (optional)
  • const gnutls_datum_t * e2 β€” holds e2 = d mod (q-1) (optional)
bestie, notice which ones are optional: d, u, e1, e2. the rest? mandatory. don't come for me, that's just how it is πŸ’€

πŸ’– DESCRIPTION πŸ’–

So like, this function will convert the given RSA raw parameters to the native gnutls_privkey_t format. That's the whole vibe. 🌈

And the output? It gets stored in key. That's it, that's the tea πŸ‘‘


⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned β€” slay πŸ’…

Otherwise? a negative error value. not the moment, but okay, we deal 😭


πŸ¦‹ REPORTING BUGS πŸ¦‹

Found a bug? Tell the people:


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. (iconic behaviour honestly 🫢)


🧚 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 was gnutls_privkey_import_rsa_raw(3) from gnutls 3.8.13 β€” go import some keys and be the main character πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from