gnutls_pubkey_import_ecc_x962(3)

✨ gnutls_pubkey_import_ecc_x962 β€” a vibe check ✨

okay bestie, so this one lives in the gnutls manual, and it's literally the glow-up ritual that turns raw elliptic-curve numbers into a real public key. let's get into it πŸ’…


🌸 NAME 🌸

gnutls_pubkey_import_ecc_x962 β€” an API function, no cap. it imports an ANSI X9.62 ECC public key. that's the whole job. she's focused. she's employed. periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/abstract.h>

int gnutls_pubkey_import_ecc_x962(gnutls_pubkey_t key, const
gnutls_datum_t * parameters, const gnutls_datum_t * ecpoint);

yep, that's the whole signature. three things go in, one int comes out 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_pubkey_t key β€” the structure to store the parsed key. this is where the magic lands, she's the main character, everything goes into her πŸ’–
  • const gnutls_datum_t * parameters β€” DER encoding of an ANSI X9.62 parameters. yes, DER. not PEM. don't come at me with PEM bestie, it's giving wrong format 😭
  • const gnutls_datum_t * ecpoint β€” DER encoding of ANSI X9.62 ECPoint. the actual point on the curve, encoded and ready πŸ¦‹

πŸ’« DESCRIPTION πŸ’«

so here's the tea β˜• β€” this function will convert the given elliptic curve parameters to a gnutls_pubkey_t. that's it. that's the function.

and the output? it will be stored in key. so like, make sure key is ready to receive, because she's getting filled in and there's no return-by-value situation happening here, iykyk.


⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned. anything else and you get a negative error value. negative = not slaying. check your return codes, bestie, they're literally telling you what's wrong πŸ™ˆ


🌈 SINCE 🌈

3.0 β€” she's been around. a legacy icon. been serving since 3.0 and never left. πŸ‘‘


πŸ’œ REPORTING BUGS πŸ’œ

found a bug? don't just scream into the group chat, actually report it:


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.

(translation: you can copy and share it freely, just keep the copyright notice and this notice attached. respect the elders 🫢)


🧚 SEE ALSO 🧚

the full documentation for gnutls is maintained as a Texinfo manual. and listen β€” if the /usr/share/doc/gnutls/ directory does not contain the HTML form, then you gotta go visit:

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

like, that's the link. that's the whole point. go there if the local docs ghosted you πŸ’€


⚠️ real talk though: both parameters and ecpoint need to be DER encoded. DER. if you hand this function something else, that's a you problem, not a her problem. don't say I didn't warn you πŸ’…

and that's the page!! this was gnutls 3.8.13 energy, brought to you by the gnutls crew β€” thanks for reading the whole thing, you're literally an icon for that πŸŽ€βœ¨ bye bestie, go import some elliptic curves πŸ’–

πŸ“¦ where this page comes from