Function silc_client_add_private_message_key
SYNOPSIS
int silc_client_add_private_message_key(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry,
char *cipher,
unsigned char *key,
SilcUInt32 key_len,
bool generate_key,
bool responder);
DESCRIPTION
Adds private message key to the client library. The key will be used to
encrypt all private message between the client and the remote client
indicated by the `client_entry'. If the `key' is NULL and the boolean
value `generate_key' is TRUE the library will generate random key.
The `key' maybe for example pre-shared-key, passphrase or similar.
The `cipher' MAY be provided but SHOULD be NULL to assure that the
requirements of the SILC protocol are met. The API, however, allows
to allocate any cipher.
If `responder' is TRUE then the sending and receiving keys will be
set according the client being the receiver of the private key. If
FALSE the client is being the sender (or negotiator) of the private
key.
It is not necessary to set key for normal private message usage. If the
key is not set then the private messages are encrypted using normal
session keys. Setting the private key, however, increases the security.
Returns FALSE if the key is already set for the `client_entry', TRUE
otherwise.
|