![]() |
![]() |
Secure Crypto Service.
The Secure KeyStore driver is used to access all KeyStore functions when using the TF-M.
#include <stdint.h>#include <ti/drivers/crypto/CryptoCC26X4_s.h>#include <ti/drivers/cryptoutils/cryptokey/CryptoKeyKeyStore_PSA.h>#include <third_party/tfm/interface/include/psa/crypto.h>#include <third_party/tfm/interface/include/psa/service.h>#include <third_party/tfm/interface/include/psa/crypto_client_struct.h>
Go to the source code of this file.
Data Structures | |
| struct | KeyStore_s_GetKeyMsg |
| struct | KeyStore_s_GenerateKeyMsg |
| struct | KeyStore_s_ExportMsg |
| struct | KeyStore_s_ImportKeyMsg |
| struct | KeyStore_s_DestroyPurgeKeyMsg |
| struct | KeyStore_s_GetKeyAttributesMsg |
| struct | KeyStore_s_ResetKeyAttributesMsg |
Macros | |
| #define | KEYSTORE_PSA_S_MSG_TYPE_GET_KEY KEYSTORE_PSA_S_MSG_TYPE(0U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_GENERATE_KEY KEYSTORE_PSA_S_MSG_TYPE(1U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_EXPORT_PUBLIC_KEY KEYSTORE_PSA_S_MSG_TYPE(2U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_EXPORT_KEY KEYSTORE_PSA_S_MSG_TYPE(3U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_DESTROY_KEY KEYSTORE_PSA_S_MSG_TYPE(4U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_IMPORT_KEY KEYSTORE_PSA_S_MSG_TYPE(5U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_PURGE_KEY KEYSTORE_PSA_S_MSG_TYPE(6U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_GET_KEY_ATTRIBUTES KEYSTORE_PSA_S_MSG_TYPE(7U) |
| #define | KEYSTORE_PSA_S_MSG_TYPE_RESET_KEY_ATTRIBUTES KEYSTORE_PSA_S_MSG_TYPE(8U) |
Functions | |
| psa_status_t | KeyStore_s_handlePsaMsg (psa_msg_t *msg) |
| Handles PSA messages for KeyStore secure driver. More... | |
| void | KeyStore_s_init (void) |
| Initializes the KeyStore secure driver. More... | |
| psa_status_t | KeyStore_s_copyKeyAttributesFromClient (struct psa_client_key_attributes_s *clientKeyAttr, int32_t clientId, psa_key_attributes_t *keyAttributes) |
| Gets key attributes from client key attributes. Follows tfm_crypto_key_attributes_from_client() More... | |
| void | KeyStore_s_copyKeyIDFromClient (KeyStore_PSA_KeyFileId *keyID, int32_t clientId, uint32_t *clientKeyID) |
| Copies client key ID from non-secure side to secure side. More... | |
| #define KEYSTORE_PSA_S_MSG_TYPE_GET_KEY KEYSTORE_PSA_S_MSG_TYPE(0U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_GENERATE_KEY KEYSTORE_PSA_S_MSG_TYPE(1U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_PUBLIC_KEY KEYSTORE_PSA_S_MSG_TYPE(2U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_KEY KEYSTORE_PSA_S_MSG_TYPE(3U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_DESTROY_KEY KEYSTORE_PSA_S_MSG_TYPE(4U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_IMPORT_KEY KEYSTORE_PSA_S_MSG_TYPE(5U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_PURGE_KEY KEYSTORE_PSA_S_MSG_TYPE(6U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_GET_KEY_ATTRIBUTES KEYSTORE_PSA_S_MSG_TYPE(7U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_RESET_KEY_ATTRIBUTES KEYSTORE_PSA_S_MSG_TYPE(8U) |
| psa_status_t KeyStore_s_handlePsaMsg | ( | psa_msg_t * | msg | ) |
Handles PSA messages for KeyStore secure driver.
| [in] | msg | pointer to PSA message |
| PSA_SUCCESS | if successful. |
| PSA_ERROR_PROGRAMMER_ERROR | if any args point to secure addresses. |
| void KeyStore_s_init | ( | void | ) |
Initializes the KeyStore secure driver.
| psa_status_t KeyStore_s_copyKeyAttributesFromClient | ( | struct psa_client_key_attributes_s * | clientKeyAttr, |
| int32_t | clientId, | ||
| psa_key_attributes_t * | keyAttributes | ||
| ) |
Gets key attributes from client key attributes. Follows tfm_crypto_key_attributes_from_client()
| [in] | clientKeyAttr | Client key attributes, address location must be verified to be in non-secure memory by calling functions |
| [in] | clientId | Partition ID of the calling client |
| [out] | keyAttributes | Key attributes, no address verification necessary as this is always in secure side |
| void KeyStore_s_copyKeyIDFromClient | ( | KeyStore_PSA_KeyFileId * | keyID, |
| int32_t | clientId, | ||
| uint32_t * | clientKeyID | ||
| ) |
Copies client key ID from non-secure side to secure side.
| [out] | keyID | Key ID, no address verification necessary as this is always in secure side |
| [in] | clientKeyID | Client key ID, address location must be verified to be in non-secure memory by calling functions |
| [in] | clientId | Client ID, partition ID from PSA call |