gnutls_privkey_export_ecc_raw2(3)

πŸ’– gnutls_privkey_export_ecc_raw2(3) β€” the gnutls girlies' manual πŸ’–

okay bestie, so this is one page out of the big gnutls manual (yes, the whole thing is a Texinfo manual, more on that at the bottom 🫢), and today's main character is gnutls_privkey_export_ecc_raw2. It's an API function. She's giving ✨key extraction✨. Let's go.


🌸 NAME 🌸

gnutls_privkey_export_ecc_raw2 β€” API function


✨ SYNOPSIS ✨

#include <gnutls/abstract.h>

int gnutls_privkey_export_ecc_raw2(gnutls_privkey_t key,
gnutls_ecc_curve_t * curve, gnutls_datum_t * x, gnutls_datum_t * y,
gnutls_datum_t * k, unsigned int flags);

like. she takes six things. six. iconic of her honestly πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_privkey_t key β€” holds the public key πŸ‘‘ (yes bestie, that's literally what the docs say, we don't ask questions, we just report)
  • gnutls_ecc_curve_t * curve β€” will hold the curve πŸŒ€
  • gnutls_datum_t * x β€” will hold the x-coordinate πŸ“
  • gnutls_datum_t * y β€” will hold the y-coordinate πŸ“
  • gnutls_datum_t * k β€” will hold the private key πŸ€«πŸ”
  • unsigned int flags β€” flags from gnutls_abstract_export_flags_t 🚩

πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe here is: this function will export the ECC private key's parameters found in the given structure. she's taking what's inside and handing it to you, bestie.

The new parameters will be allocated using gnutls_malloc() and will be stored in the appropriate datum. so like, they're yours now, you got them, they're freshly allocated and everything πŸ’–

🚨 special case alert 🚨 β€” in EdDSA curves the y parameter will be NULL, and the other parameters will be in the native format for the curve. not a bug, that's just how EdDSA is built. don't come for her.

🌈 RETURNS 🌈

GNUTLS_E_SUCCESS on success πŸŽ‰ β€” otherwise a negative error code 😭 (as is tradition)


⭐ SINCE ⭐

3.6.0 β€” she's been around a minute, lowkey a legend


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? Report bugs 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. (fr fr, that's the license, respect it 🫢)


🧚 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/

πŸ’€ reminder for the girlies: every parameter, every flag type, every return code above is exactly what the page says. no cap. don't skip the NULL thing for EdDSA, iykyk.

that's the whole page bestie, you ate that read πŸ’…βœ¨

this one's from the gnutls manual, version 3.8.13 β€” go forth and export those ECC parameters responsibly πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from