Data Structures | Macros | Functions
CryptoKeyKeyStore_PSA_s.h File Reference

Detailed Description

Secure Crypto Service.


Overview

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>
Include dependency graph for CryptoKeyKeyStore_PSA_s.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...
 

Macro Definition Documentation

§ KEYSTORE_PSA_S_MSG_TYPE_GET_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_GET_KEY   KEYSTORE_PSA_S_MSG_TYPE(0U)

§ KEYSTORE_PSA_S_MSG_TYPE_GENERATE_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_GENERATE_KEY   KEYSTORE_PSA_S_MSG_TYPE(1U)

§ KEYSTORE_PSA_S_MSG_TYPE_EXPORT_PUBLIC_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_PUBLIC_KEY   KEYSTORE_PSA_S_MSG_TYPE(2U)

§ KEYSTORE_PSA_S_MSG_TYPE_EXPORT_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_EXPORT_KEY   KEYSTORE_PSA_S_MSG_TYPE(3U)

§ KEYSTORE_PSA_S_MSG_TYPE_DESTROY_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_DESTROY_KEY   KEYSTORE_PSA_S_MSG_TYPE(4U)

§ KEYSTORE_PSA_S_MSG_TYPE_IMPORT_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_IMPORT_KEY   KEYSTORE_PSA_S_MSG_TYPE(5U)

§ KEYSTORE_PSA_S_MSG_TYPE_PURGE_KEY

#define KEYSTORE_PSA_S_MSG_TYPE_PURGE_KEY   KEYSTORE_PSA_S_MSG_TYPE(6U)

§ KEYSTORE_PSA_S_MSG_TYPE_GET_KEY_ATTRIBUTES

#define KEYSTORE_PSA_S_MSG_TYPE_GET_KEY_ATTRIBUTES   KEYSTORE_PSA_S_MSG_TYPE(7U)

§ KEYSTORE_PSA_S_MSG_TYPE_RESET_KEY_ATTRIBUTES

#define KEYSTORE_PSA_S_MSG_TYPE_RESET_KEY_ATTRIBUTES   KEYSTORE_PSA_S_MSG_TYPE(8U)

Function Documentation

§ KeyStore_s_handlePsaMsg()

psa_status_t KeyStore_s_handlePsaMsg ( psa_msg_t *  msg)

Handles PSA messages for KeyStore secure driver.

Note
This function should be called by secure partition thread only.
Parameters
[in]msgpointer to PSA message
Return values
PSA_SUCCESSif successful.
PSA_ERROR_PROGRAMMER_ERRORif any args point to secure addresses.

§ KeyStore_s_init()

void KeyStore_s_init ( void  )

Initializes the KeyStore secure driver.

Note
This function should be called by secure partition thread only.

§ KeyStore_s_copyKeyAttributesFromClient()

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()

Parameters
[in]clientKeyAttrClient key attributes, address location must be verified to be in non-secure memory by calling functions
[in]clientIdPartition ID of the calling client
[out]keyAttributesKey attributes, no address verification necessary as this is always in secure side
Returns
Always return KEYSTORE_PSA_STATUS_SUCCESS

§ KeyStore_s_copyKeyIDFromClient()

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.

Parameters
[out]keyIDKey ID, no address verification necessary as this is always in secure side
[in]clientKeyIDClient key ID, address location must be verified to be in non-secure memory by calling functions
[in]clientIdClient ID, partition ID from PSA call
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale