gnutls_privkey_export_rsa_raw2(3)

✨ NAME ✨

gnutls_privkey_export_rsa_raw2 β€” bestie it's an API function, and it's the one that gets your RSA private key parameters OUT of the key object πŸ’– (this is the gnutls manual, btw, in case the vibe didn't give it away)


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_privkey_export_rsa_raw2(gnutls_privkey_t key, gnutls_datum_t
* m, gnutls_datum_t * e, gnutls_datum_t * d, gnutls_datum_t * p,
gnutls_datum_t * q, gnutls_datum_t * u, gnutls_datum_t * e1,
gnutls_datum_t * e2, unsigned int flags);

okay so it's a whole lineup of pointers, she's high maintenance but she delivers ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_privkey_t key β€” holds the certificate, she's the main character here πŸ‘‘
  • gnutls_datum_t * m β€” will hold the modulus πŸ’…
  • gnutls_datum_t * e β€” will hold the public exponent 🫢
  • gnutls_datum_t * d β€” will hold the private exponent (yes the secret one, be normal about it πŸ™ˆ)
  • gnutls_datum_t * p β€” will hold the first prime (p) 🌸
  • gnutls_datum_t * q β€” will hold the second prime (q) 🌸
  • gnutls_datum_t * u β€” will hold the coefficient ⭐
  • gnutls_datum_t * e1 β€” will hold e1 = d mod (p-1) 🧚
  • gnutls_datum_t * e2 β€” will hold e2 = d mod (q-1) 🧚
  • unsigned int flags β€” flags from gnutls_abstract_export_flags_t ✨

πŸ’– DESCRIPTION πŸ’–

So the tea is: this function will export the RSA private key's parameters found in the given structure. Like, all of them, out into the open. πŸ¦‹

The new parameters will be allocated using gnutls_malloc() and will be stored in the appropriate datum. Every single one of those gnutls_datum_t * guys above gets its own freshly gnutls_malloc()'d lil home, no cap. πŸ’…


🌈 RETURNS 🌈

GNUTLS_E_SUCCESS on success, otherwise a negative error code. Slay when it works, check that return value when it doesn't, fr fr 😭


⭐ SINCE ⭐

3.6.0 β€” vintage but iconic, she's been here a minute πŸŽ€


πŸ› REPORTING BUGS πŸ›

Report bugs to <bugs@gnutls.org>. They want the tea, bestie, tell them everything.

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. (Iconic licensing behaviour, honestly. No notes. 🫢)


πŸ¦‹ 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, no crumbs left πŸ’œ this was gnutls version 3.8.13, page dated with the same, gnutls_privkey_export_rsa_raw2(3) β€” go forth and export those primes responsibly, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from