lc_ctx_set_sym_key3
Set librecast channel encoding keys
Usage
#include <librecast/net.h>
int lc_ctx_set_sym_key(lc_ctx_t *ctx, unsigned char *key, size_t len); int lc_ctx_set_pub_key(lc_ctx_t *ctx, unsigned char *key, size_t len); int lc_channel_set_sym_key(lc_channel_t *chan, unsigned char *key, size_t len); int lc_channel_set_pub_key(lc_channel_t *chan, unsigned char *key, size_t len");"
Compile and link with -llibrecast.
Library
Librecast library (liblibrecast, -llibrecast)
Overview
These functions set encryption keys for a Librecast context ctx or channel chan.
The lc_ctx_set_sym_key() function sets a symmetric key of length len on a Librecast context. This key will be used by default by any channels subsequently created using the context. Any existing channels will retain their existing key.
The lc_ctx_set_pub_key() function sets a public key of length len on a Librecast context. This key will be used by default by any channels subsequently created using the context. Any existing channels will retain their existing key.
The lc_channel_set_sym_key() function sets a symmetric key of length len on a Librecast channel.
The lc_channel_set_pub_key() function sets a public key of length len on a Librecast channel.
Return value
These functions return zero on success. On error, -1 is returned and errno is set to indicate the error.
Errors
- EINVAL
-
Invalid argument.