![]() |
![]() |
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_ImportCertificateMsg |
| struct | KeyStore_s_ImportKeyMsg |
| struct | KeyStore_s_DestroyPurgeKeyCertificateMsg |
| struct | KeyStore_s_GetKeyAttributesMsg |
| struct | KeyStore_s_ResetKeyAttributesMsg |
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_CALC | ( | a | ) | (CRYPTO_S_MSG_TYPE_INDEX_KEYSTORE | ((int32_t)1 << (CRYPTO_S_MSG_TYPE_SHIFT + a))) |
| #define KEYSTORE_PSA_S_MSG_TYPE_GET_KEY KEYSTORE_PSA_S_MSG_CALC(0U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_GENERATE_KEY KEYSTORE_PSA_S_MSG_CALC(1U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_CERTIFICATE KEYSTORE_PSA_S_MSG_CALC(2U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_PUBLIC_KEY KEYSTORE_PSA_S_MSG_CALC(3U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_KEY KEYSTORE_PSA_S_MSG_CALC(4U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_DESTROY_CERTIFICATE KEYSTORE_PSA_S_MSG_CALC(5U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_DESTROY_KEY KEYSTORE_PSA_S_MSG_CALC(6U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_IMPORT_CERTIFICATE KEYSTORE_PSA_S_MSG_CALC(7U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_IMPORT_KEY KEYSTORE_PSA_S_MSG_CALC(8U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_PURGE_KEY KEYSTORE_PSA_S_MSG_CALC(9U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_GET_KEY_ATTRIBUTES KEYSTORE_PSA_S_MSG_CALC(10U) |
| #define KEYSTORE_PSA_S_MSG_TYPE_RESET_KEY_ATTRIBUTES KEYSTORE_PSA_S_MSG_CALC(11U) |
| 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 |