From b6e248c9a58cccbcd5dea7bdc8e3cdee4af03722 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Fri, 10 Jul 2015 11:57:53 +0100 Subject: Output simpler JSON for the account keys, don't sign the JSON but instead provide a olm_account_sign method so that the user of the library can sign the JSON themselves --- include/olm/olm.hh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'include/olm/olm.hh') diff --git a/include/olm/olm.hh b/include/olm/olm.hh index 46f7a68..2919767 100644 --- a/include/olm/olm.hh +++ b/include/olm/olm.hh @@ -132,11 +132,7 @@ size_t olm_create_account( /** The size of the output buffer needed to hold the identity keys */ size_t olm_account_identity_keys_length( - OlmAccount * account, - size_t user_id_length, - size_t device_id_length, - uint64_t valid_after_ts, - uint64_t valid_until_ts + OlmAccount * account ); /** Writes the public parts of the identity keys for the account into the @@ -145,13 +141,24 @@ size_t olm_account_identity_keys_length( * "OUTPUT_BUFFER_TOO_SMALL". */ size_t olm_account_identity_keys( OlmAccount * account, - void const * user_id, size_t user_id_length, - void const * device_id, size_t device_id_length, - uint64_t valid_after_ts, - uint64_t valid_until_ts, void * identity_keys, size_t identity_key_length ); + +/** The length of an ed25519 signature encoded as base64. */ +size_t olm_account_signature_length( + OlmAccount * account +); + +/** Signs a message with the ed25519 key for this account. Returns olm_error() + * on failure. If the signature buffer was too small then + * olm_account_last_error() will be "OUTPUT_BUFFER_TOO_SMALL" */ +size_t olm_account_sign( + OlmAccount * account, + void const * message, size_t message_length, + void * signature, size_t signature_length +); + /** The size of the output buffer needed to hold the one time keys */ size_t olm_account_one_time_keys_length( OlmAccount * account -- cgit v1.2.3