Add crypto key generation functions

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen
2021-09-27 17:45:07 +02:00
committed by Beat Küng
parent 4c6779812d
commit 3db76d88fe
2 changed files with 55 additions and 0 deletions
@@ -73,6 +73,7 @@ size_t keystore_get_key(keystore_session_handle_t handle, uint8_t idx, uint8_t *
/*
* Store a key persistently into the keystore
* handle: a handle to an open keystore
* idx: key index in keystore
* key: pointer to the key
* key_size: size of the key
@@ -105,6 +106,17 @@ crypto_session_handle_t crypto_open(px4_crypto_algorithm_t algorithm);
void crypto_close(crypto_session_handle_t *handle);
/*
* Generate a key
* handle: Open handle for the crypto session. The key will be generated for
* the crypto algorithm used by this session
* idx: The key index, by which the key can be used
* persistent: if set to "true", the key will be stored into the keystore
*/
bool crypto_generate_key(crypto_session_handle_t handle,
uint8_t idx,
bool persistent);
/*
* Get a key from keystore, possibly encrypted
*