gnutls_privkey_export_gost_raw2(3)

✨ gnutls_privkey_export_gost_raw2 ✨

okay so bestie, we're in the gnutls manual, and this lil page is about gnutls_privkey_export_gost_raw2 β€” yes it's a whole API function, and yes it's giving very specific crypto girl energy πŸ’…


🌸 NAME 🌸

gnutls_privkey_export_gost_raw2 β€” it's an API function, bestie. that's the whole vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/abstract.h>

int gnutls_privkey_export_gost_raw2(gnutls_privkey_t key,
gnutls_ecc_curve_t * curve, gnutls_digest_algorithm_t * digest,
gnutls_gost_paramset_t * paramset, gnutls_datum_t * x, gnutls_datum_t *
y, gnutls_datum_t * k, unsigned int flags);

like, look at that signature. it's long. it's iconic. it ate. πŸŽ€


πŸ’– ARGUMENTS πŸ’–

  • gnutls_privkey_t key β€” this one holds the public key. yes bestie, the public key, that's what it says, we don't question it, we just pass it. 🫢
  • gnutls_ecc_curve_t * curve β€” this pointer is gonna hold the curve. it's an out-param, so it's catching, not throwing. caught it. ✨
  • gnutls_digest_algorithm_t * digest β€” will hold the digest. the algorithm one. the hash vibe. πŸ”₯
  • gnutls_gost_paramset_t * paramset β€” will hold the GOST parameter set ID. very niche, very specific, very her. πŸ‘‘
  • gnutls_datum_t * x β€” will hold the x-coordinate. xoxo, x. πŸ’œ
  • gnutls_datum_t * y β€” will hold the y-coordinate. and y is for "y are you asking me to remember all these args" 😭
  • gnutls_datum_t * k β€” will hold the private key. the actual secret. guard it with your life fr fr πŸ”
  • unsigned int flags β€” flags, and they come from gnutls_abstract_export_flags_t. check the enum, bestie, don't guess. 🌈

🌟 DESCRIPTION 🌟

so what does this function do? it will export the GOST private key's parameters found in the given structure. all of them. the curve, the digest, the paramset, x, y, and k β€” it's getting all of them out of there and handing them to you.

the new parameters will be allocated using gnutls_malloc(), and they'll be stored in the appropriate datum. so like, heads up: you own that memory now, bestie, gnutls_malloc() means you're responsible for the cleanup later. no cap. 🧚


⚠️ NOTE ⚠️

the parameters will be stored with least significant byte first.

and listen β€” on version 3.6.3 this was incorrectly returned in big-endian format. so if you're on that version, that's the bug, that's not you, it was never you. πŸ’€


⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success β€” slay πŸŽ‰

otherwise, a negative error code. so like, vibe check your return value, always. πŸ™ˆ


πŸŽ€ SINCE πŸŽ€

3.6.3 β€” she's been here a minute. periodt.


πŸ“£ REPORTING BUGS πŸ“£

found a bug? don't suffer in silence, bestie:


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. (free to share, 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!! this was gnutls 3.8.13, from the gnutls crew, and gnutls_privkey_export_gost_raw2(3) said everything she needed to say. go forth and export responsibly πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from