pskc_set_key_data_secret(3)

πŸ’– pskc_set_key_data_secret πŸ’–

okay bestie, welcome to the libpskc page for pskc_set_key_data_secret, one of the little functions that lowkey does a LOT. this is the one that tucks your raw key bytes into a pskc_key_t handle and base64-encodes them for you, so you don't have to ✨


🌸 NAME 🌸

pskc_set_key_data_secret β€” the API function that sets the Key Data Secret value. no cap, that's literally its whole job πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <pskc.h>

int pskc_set_key_data_secret(pskc_key_t * key, const char * data, size_t
len);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • pskc_key_t * key β€” a pskc_key_t handle, and you get it from pskc_get_keypackage(). that's your main character right there πŸ‘‘
  • const char * data β€” the byte array holding the key you wanna set, and it's len bytes long. yes, bytes, not vibes 🫢
  • size_t len β€” the length of the data byte array. count it, don't guess, bestie 😭

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: this sets the PSKC KeyPackage Key Data Secret value πŸ”₯

the data you pass in is copied into the key handle, so after this function is called you're free to modify or deallocate that data pointer β€” it's giving "no strings attached" energy, iconic behavior honestly ✨

the data gets base64 encoded by this function, automatically, so you don't have to lift a finger πŸ’…

and the safety girlie detail: on errors, the old secret is not modified. nothing gets clobbered mid-fail, periodt πŸŽ€


⭐ RETURNS ⭐

  • PSKC_BASE64_ERROR β€” when the base64 encoding goes wrong 😭
  • PSKC_MALLOC_ERROR β€” when memory allocation goes wrong πŸ’€
  • PSKC_OK β€” when everything slays βœ…

🌈 SINCE 🌈

2.2.0 β€” she's been here a minute, respect the veteran 🫢


πŸ› REPORTING BUGS πŸ›

found a bug? don't suffer in silence, report it to <oath-toolkit-help@nongnu.org> πŸ’Œ


Copyright Β© 2009-2026 Simon Josefsson.

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 🫢 that's the license, bestie, keep the receipts.


and that's the whole page, mwah πŸ’‹ this little beauty comes to you from libpskc, version 2.6.15, dated in that footer as 2.6.15 alongside the page name pskc_set_key_data_secret(3) β€” go forth and set those secrets, you absolute legend πŸ§šπŸ’–

πŸ“¦ where this page comes from