*/
-/****h* silcclient/SilcClientAPI
+/****h* silcclient/Client Library Interface
*
* DESCRIPTION
*
typedef struct SilcClientCommandContextStruct *SilcClientCommandContext;
typedef struct SilcClientCommandReplyContextStruct
*SilcClientCommandReplyContext;
-typedef struct SilcChannelPrivateKeyStruct *SilcChannelPrivateKey;
typedef struct SilcChannelUserStruct *SilcChannelUser;
/* General definitions */
} *SilcPrivateMessageKeys;
/***/
+/****s* silcclient/SilcClientAPI/SilcChannelPrivateKey
+ *
+ * NAME
+ *
+ * typedef struct { ... } SilcChannelPrivateKey;
+ *
+ * DESCRIPTION
+ *
+ * Structure to hold one channel private key. The array of this structure
+ * is returned by silc_client_list_channel_private_keys function.
+ *
+ * SOURCE
+ */
+typedef struct SilcChannelPrivateKeyStruct {
+ char *name; /* Application given name */
+ SilcCipher cipher; /* The cipher and key */
+ SilcHmac hmac; /* The HMAC and hmac key */
+ unsigned char *key; /* The key data */
+ SilcUInt32 key_len; /* The key length */
+} *SilcChannelPrivateKey;
+/***/
/****f* silcclient/SilcClientAPI/SilcAskPassphrase
*
*
* Ask passphrase callback. This is called by the application when the
* library calls `ask_passphrase' client operation. The callback delivers
- * the passphrase to the library.
+ * the passphrase to the library. The passphrases in SILC protocol
+ * MUST be in UTF-8 encoding, therefore the `passphrase' SHOULD be UTF-8
+ * encoded, and if it is not then library will attempt to encode it.
*
***/
typedef void (*SilcAskPassphrase)(unsigned char *passphrase,
`msg' maybe NULL. */
void (*channel_message)(SilcClient client, SilcClientConnection conn,
SilcClientEntry sender, SilcChannelEntry channel,
- SilcMessageFlags flags, char *msg);
+ SilcMessageFlags flags,
+ const unsigned char *message,
+ SilcUInt32 message_len);
/* Private message to the client. The `sender' is the sender of the
message. */
void (*private_message)(SilcClient client, SilcClientConnection conn,
SilcClientEntry sender, SilcMessageFlags flags,
- char *msg);
+ const unsigned char *message,
+ SilcUInt32 message_len);
/* Notify message to the client. The notify arguments are sent in the
same order as servers sends them. The arguments are same as received
the command reply status server returned. The `command' is the command
reply being processed. The function has variable argument list and each
command defines the number and type of arguments it passes to the
- application (on error they are not sent). */
+ application (on error they are not sent).
+
+ The arguments are sent in the same order as servers sends them. The
+ arguments are same as received from the server except for ID's. If
+ ID is received application receives the corresponding entry to the
+ ID. For example, if Client ID is receives application receives
+ SilcClientEntry. */
void (*command_reply)(SilcClient client, SilcClientConnection conn,
SilcCommandPayload cmd_payload, int success,
SilcCommand command, SilcCommandStatus status, ...);
/* Ask (interact, that is) a passphrase from user. The passphrase is
returned to the library by calling the `completion' callback with
- the `context'. */
+ the `context'. The returned passphrase SHOULD be in UTF-8 encoded,
+ if not then the library will attempt to encode. */
void (*ask_passphrase)(SilcClient client, SilcClientConnection conn,
SilcAskPassphrase completion, void *context);
* int silc_client_add_channel_private_key(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel,
+ * const char *name,
* char *cipher,
* char *hmac,
* unsigned char *key,
* key in order to decrypt the messages. However, it is possible to have
* several private keys per one channel. In this case only some of the
* clients on the channel may know the one key and only some the other key.
+ * The `name' can be application given name for the key.
*
* The private key for channel is optional. If it is not set then the
* channel messages are encrypted using the channel key generated by the
int silc_client_add_channel_private_key(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel,
+ const char *name,
char *cipher,
char *hmac,
unsigned char *key,
void silc_client_free_channel_private_keys(SilcChannelPrivateKey *keys,
SilcUInt32 key_count);
+/****f* silcclient/SilcClientAPI/silc_client_current_channel_private_key
+ *
+ * SYNOPSIS
+ *
+ * void silc_client_current_channel_private_key(SilcClient client,
+ * SilcClientConnection conn,
+ * SilcChannelEntry channel,
+ * SilcChannelPrivateKey key);
+ *
+ * DESCRIPTION
+ *
+ * Sets the `key' to be used as current channel private key on the
+ * `channel'. Packet sent after calling this function will be secured
+ * with `key'.
+ *
+ ***/
+void silc_client_current_channel_private_key(SilcClient client,
+ SilcClientConnection conn,
+ SilcChannelEntry channel,
+ SilcChannelPrivateKey key);
+
/* Key Agreement routines (client_keyagr.c) */