LC_KEYPAIR_NEW(3)

πŸ’– lc_keypair_new(3) β€” the Librecast Programmer's Manual glow-up πŸ’–

okay bestie, sit down, hydrate, because we're about to make you a whole entire keypair ✨ this one lives in section 3 of the Librecast Programmer's Manual, so you already know it's the good stuff.


🌸 NAME 🌸

lc_keypair_new β€” create new keypair

like. that's it. that's the whole job. she makes keys. iconic behavior honestly πŸŽ€


πŸ¦‹ LIBRARY πŸ¦‹

Librecast library (liblibrecast, -llibrecast)


✨ SYNOPSIS ✨

#include <librecast/key.h>

int lc_keypair_new(lc_keypair_t *keypair, int flags);

Compile and link with -llibrecast.

not the linker forgetting your library again 😭 we've all been there, add that flag fr fr


πŸ‘‘ DESCRIPTION πŸ‘‘

okay so here's the tea: lc_keypair_new() creates a new signing or encryption keypair. brand new. fresh out the box. main character energy πŸ’…

The new keypair will be returned in keypair.

flags can be any of the following:

  • LC_KEY_SIG β€” Generate a signing keypair. πŸ”₯
  • LC_KEY_ENC β€” Generate an encryption keypair. πŸ”
pick your fighter bestie, you gotta tell her which kind of keypair you want. that's literally the whole decision. slay.

🫢 RETURN VALUE 🫢

lc_keypair_new() returns 0 if the call succeeds, or -1 if an error occurred. In the event of an error, errno is set to indicate the error.

so like, 0 = we ate. -1 = check errno, she's telling you what went wrong 🧚


πŸ’€ ERRORS πŸ’€

lc_keypair_new() can fail with the following errors:

  • EINVAL β€” Key generation failed.
not the key generation ghosting us πŸ™ˆ if you see EINVAL, the generation itself did not happen. no keypair for you, bestie.

🌈 SEE ALSO 🌈

lc_keyring_init(3), lc_keyring_free(3), lc_keyring_add(3), lc_keyring_del(3), lc_token_new(3)

go read these next, they're the rest of the friend group πŸ’œ


and that's the page!! brought to you by LIBRECAST, dated 2025-04-02, filed under LC_KEYPAIR_NEW(3) β€” go forth and generate responsibly, bestie, ily πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from