LC_TOKEN_NEW(3)
π LC_TOKEN_NEW β create and sign capability token π
okay bestie, welcome to lc_token_new(3) from the Librecast Programmer's Manual. this one's a whole vibe: you're making a token, and then you're signing it. main character energy fr fr π
β¨ NAME β¨
lc_token_new β create and sign capability token π
π LIBRARY π
Librecast library (liblibrecast, -llibrecast) π¦
πΈ SYNOPSIS πΈ
#include <librecast/key.h>
int lc_token_new(lc_token_t *token, lc_keypair_t *signing_key, uint8_t *bearer_key,
lc_channel_t *chan ,uint8_t capbits ,uint64_t valid_sec);
Compile and link with -llibrecast. no cap. π«Ά
π DESCRIPTION π
lc_token_new() creates and signs a new capability token. literally its whole thing. it makes it, it signs it, it's done. slay. β¨
tokenis a pointer to the token to sign. that's the lil guy you're handing over so it can get signed.signing_keyis a pointer to the signing keypair, created withlc_keypair_new(3). you gotta have the keypair first bestie, no shortcuts.bearer_keyis a pointer to the public key of the bearer of the token. and like, who is the bearer? the bearer is the entity using the token for sending. they're the one holding it, iykyk.chanis a pointer to the Librecast channel for which the token will be valid. so the token only works there. location-locked, iconic.capbitsis an 8-bit arbitrary value representing the capabilities to issue. and listen: these have no intrinsic meaning and are defined by the caller. so you decide what the bits mean, bestie. the library is not gonna read your mind. πvalid_secis an unsigned 64-bit value representing the number of seconds from now that the token will be valid for. it's a countdown, not an absolute timestamp. ticking clock vibes. β³
π« RETURN VALUE π«
lc_socket_new() returns 0 if the call succeeds, or -1 if an error occurred. and in the event of an error, errno is set to indicate the error. yes, the page really does say lc_socket_new() right there β we're keeping it exactly as written, that's the text, periodt. π
π ERRORS π
lc_token_new() can fail with the following errors:
ENOTRECOVERABLEβ Signing the token failed. the signing just didn't sign. tragic. π
lc_token_new() could also fail with any of the errors listed in clock_gettime(2). so go read that one too, bestie. π
π₯ SEE ALSO π₯
lc_channel_token_set(3)lc_channel_filter_set(3)lc_channel_new(3)lc_keypair_new(3)clock_gettime(2)
and that's the whole page, bestie!! this one came from LIBRECAST on 2025-04-02, filed under LC_TOKEN_NEW(3) in the Librecast Programmer's Manual. go make some tokens, sign them, and stay iconic. mwah πβ¨ππ¦πΈ
π¦ where this page comes from
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms