diff --git a/platforms/common/include/px4_platform_common/crypto_backend.h b/platforms/common/include/px4_platform_common/crypto_backend.h index 9b4edd5b94..ae63875560 100644 --- a/platforms/common/include/px4_platform_common/crypto_backend.h +++ b/platforms/common/include/px4_platform_common/crypto_backend.h @@ -71,6 +71,15 @@ void keystore_close(keystore_session_handle_t *handle); */ size_t keystore_get_key(keystore_session_handle_t handle, uint8_t idx, uint8_t *key_buf, size_t key_buf_size); +/* + * Store a key persistently into the keystore + * idx: key index in keystore + * key: pointer to the key + * key_size: size of the key + */ +bool keystore_put_key(keystore_session_handle_t handle, uint8_t idx, uint8_t *key, size_t key_size); + + /* * Architecture specific PX4 Crypto API functions */ diff --git a/platforms/common/px4_sw_crypto/stub_keystore/stub_keystore.c b/platforms/common/px4_sw_crypto/stub_keystore/stub_keystore.c index 8633ba6399..0f33436479 100644 --- a/platforms/common/px4_sw_crypto/stub_keystore/stub_keystore.c +++ b/platforms/common/px4_sw_crypto/stub_keystore/stub_keystore.c @@ -77,3 +77,8 @@ size_t keystore_get_key(keystore_session_handle_t handle, uint8_t idx, uint8_t * return ret; } + +bool keystore_put_key(keystore_session_handle_t handle, uint8_t idx, uint8_t *key, size_t key_size) +{ + return false; +}