GNUTLS_X509_PRIVKEY_EXPORT_RSA_RAW(3)

πŸ’– gnutls_x509_privkey_export_rsa_raw β€” the girlies are exporting RSA raw params πŸ’–

okay bestie, welcome to the gnutls manual, page gnutls_x509_privkey_export_rsa_raw(3). no cap, this one is a lil spicy 🌢️ because it's literally handing you the secret sauce of an RSA private key. let's get into it 🫢


✨ NAME ✨

gnutls_x509_privkey_export_rsa_raw β€” API function πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/x509.h>

int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_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);

like yes, that's a LOT of out-params, but she's worth it πŸ’œ


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_x509_privkey_t key β€” a key. your main character πŸ”‘
  • gnutls_datum_t * m β€” will hold the modulus. the big number energy ✨
  • gnutls_datum_t * e β€” will hold the public exponent. she's public, she's out there 🌈
  • gnutls_datum_t * d β€” will hold the private exponent. SECRET. do not be posting this. πŸ™ˆ
  • 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 πŸ’«

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function will export the RSA private key's parameters found in the given structure. literally all of them, out into your hands, no gatekeeping πŸ’…

the new parameters will be allocated using gnutls_malloc() and will be stored in the appropriate datum. so yeah, that memory is yours β€” it's giving "you allocated it, you free it" energy, iykyk πŸ‘‘


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned πŸŽ‰ otherwise you get a negative error value and it's giving "something went wrong bestie" 😭


πŸ’€ REPORTING BUGS πŸ’€

found a bug? not the vibe. report it, fr fr:


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, share it, remix it, 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, visit:

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


and that's the whole page, bestie πŸŽ€ slay, go export those RSA params responsibly, and remember: d, p, q and u are private for a reason πŸ’œ

this was page gnutls_x509_privkey_export_rsa_raw(3) from the gnutls manual, version 3.8.13 β€” mwah, ily, bye βœ¨πŸ’…πŸ¦‹

πŸ“¦ where this page comes from