gnutls_pubkey_import_gost_raw(3)

πŸ’– gnutls_pubkey_import_gost_raw β€” the glow-up your raw GOST key deserves πŸ’–

okay bestie, this one lives in the gnutls manual, and it's literally the moment a pile of raw GOST numbers becomes a real, whole gnutls_pubkey_t. no cap. πŸ¦‹


✨ NAME ✨

gnutls_pubkey_import_gost_raw β€” API function

it's giving "raw coordinates in, fancy key object out." πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/abstract.h>

int gnutls_pubkey_import_gost_raw(gnutls_pubkey_t key,
gnutls_ecc_curve_t curve, gnutls_digest_algorithm_t digest,
gnutls_gost_paramset_t paramset, const gnutls_datum_t * x, const
gnutls_datum_t * y);

look at her. six arguments. main character energy fr fr. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_pubkey_t key β€” the structure where the parsed key gets stored, like a little jewelry box for your public key πŸ’Ž
  • gnutls_ecc_curve_t curve β€” holds the curve
  • gnutls_digest_algorithm_t digest β€” holds the digest
  • gnutls_gost_paramset_t paramset β€” holds the parameters id
  • const gnutls_datum_t * x β€” holds the x-coordinate
  • const gnutls_datum_t * y β€” holds the y-coordinate

six little besties walking into a function together, iconic. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so this function will convert the given GOST public key's parameters into a gnutls_pubkey_t. the output gets stored in key. 🌈

about that digest though β€” she has exactly three acceptable values, bestie, and you need to pick one of them:

  • GNUTLS_DIG_GOSR_94
  • GNUTLS_DIG_STREEBOG_256
  • GNUTLS_DIG_STREEBOG_512

(those are copied straight from the source, so yes, GNUTLS_DIG_GOSR_94 is spelled exactly like that β€” don't come for me, I'm just the messenger 😭)

and if paramset is set to GNUTLS_GOST_PARAMSET_UNKNOWN, then a default one will be selected for you, depending on digest. the function is literally doing your homework. 🫢


⚠️ NOTE ⚠️

parameters should be stored with least significant byte first. and heads up β€” on version 3.6.3, big-endian format was used incorrectly. so like, vintage behavior, but not the cute kind. πŸ’€

🌟 RETURNS 🌟

on success, GNUTLS_E_SUCCESS (0) is returned. otherwise you get a negative error value β€” and we do not love that for us. 😭


⭐ SINCE ⭐

3.6.3

she's been here since 3.6.3 and she has been serving ever since. πŸ’œ


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't be shy, tell the devs:


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, bestie. πŸŽ€


πŸ” 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, no crumbs left. πŸ’… this gorgeous little number comes to you from gnutls 3.8.13 β€” mwah, take care of her, she's doing her best. πŸ§šβœ¨πŸ’–

πŸ“¦ where this page comes from