gnutls_privkey_export_ecc_raw(3)

πŸ’– gnutls_privkey_export_ecc_raw β€” bestie edition πŸ’–

okay so this is a page from the gnutls manual (the 3.8.13 era, we'll get to that at the end πŸŽ€) and it's all about pulling the raw guts out of an ECC private key. yes, raw. we're going feral, we're going low-level, we're getting the actual numbers. slay. πŸ’…


✨ NAME ✨

gnutls_privkey_export_ecc_raw β€” it's an API function, bestie. that's the whole name. periodt.


✨ SYNOPSIS ✨

#include <gnutls/abstract.h>

int gnutls_privkey_export_ecc_raw(gnutls_privkey_t key,
gnutls_ecc_curve_t * curve, gnutls_datum_t * x, gnutls_datum_t * y,
gnutls_datum_t * k);

look at her. five params. main character energy fr fr 🌟


✨ ARGUMENTS ✨

  • gnutls_privkey_t key β€” this holds the public key. yes, we know, the function name says private and this says public, but that's what the manpage says so that's what we're saying. no notes, iykyk 🫢
  • gnutls_ecc_curve_t * curve β€” this one's gonna hold the curve when we're done. she's the output slot for 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 πŸ‘€ the actual secret. the tea. the whole point.

✨ DESCRIPTION ✨

okay so what does she do. this function exports the ECC private key's parameters that are chillin' inside the given structure. that's it. that's the job.

the new parameters get allocated using gnutls_malloc() and get stored in the appropriate datum. so like β€” fresh memory, all yours, allocated for you. cute of her honestly πŸŽ€

⚠️ important plot twist: in EdDSA curves the y parameter will be NULL, and the other parameters will be in the native format for the curve. so if you're an EdDSA girlie, don't go dereferencing y, she's not there. it's giving ghosted πŸ’€

✨ RETURNS ✨

GNUTLS_E_SUCCESS on success β€” we love a win πŸ†

otherwise you get a negative error code. negative. as in not-okay. read the error, bestie, don't just vibe past it 😭


✨ SINCE ✨

3.3.0 β€” she's been around a minute, an icon, a legend πŸ‘‘


✨ REPORTING BUGS ✨

found a bug? don't be shy, report it to <bugs@gnutls.org> πŸ›

home page is right here: 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, take it, share it, just keep the receipts πŸ’–


✨ SEE ALSO ✨

the full documentation for gnutls is maintained as a Texinfo manual. so 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 was the gnutls manual, version 3.8.13, page gnutls_privkey_export_ecc_raw(3) β€” go forth and export those raw ECC params responsibly, mwah πŸ’‹πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from