Loading...
Searching...
No Matches
PSA Crypto SE Management

Detailed Description

Files

file  psa_crypto_se_management.h
 PSA Secure Element management function declarations.
 

Data Structures

struct  psa_drv_se_internal_context_t
 Internal secure element driver context. More...
 
struct  psa_se_drv_data_s
 Structure containing secure element driver data and contexts. More...
 

Macros

#define CONFIG_PSA_MAX_SE_COUNT   (1)
 Maximum number of available secure elements.
 
#define PSA_MAX_SE_COUNT   (CONFIG_PSA_MAX_SE_COUNT)
 Maximum supported number of secure elements.
 

Typedefs

typedef struct psa_se_drv_data_s psa_se_drv_data_t
 Encodes the secure element driver data.
 

Functions

psa_status_t psa_register_secure_element (psa_key_location_t location, const psa_drv_se_t *methods, void *psa_se_configuration, const void *drv_transient_data)
 Register a secure element driver with the SE management.
 
psa_se_drv_data_tpsa_get_se_driver_data (psa_key_lifetime_t lifetime)
 Get the driver data of a specified driver.
 
int psa_get_se_driver (psa_key_lifetime_t lifetime, const psa_drv_se_t **p_methods, psa_drv_se_context_t **p_drv_context)
 Get the driver entry points and context of a specified driver.
 
const psa_drv_se_tpsa_get_se_driver_methods (const psa_se_drv_data_t *driver)
 Get the driver entry points of a specified driver.
 
psa_drv_se_context_tpsa_get_se_drv_context (psa_se_drv_data_t *driver)
 Get the driver context of a specified driver.
 
psa_status_t psa_find_free_se_slot (const psa_key_attributes_t *attributes, psa_key_creation_method_t method, psa_se_drv_data_t *driver, psa_key_slot_number_t *slot_number)
 Find an empty key slot on a secure element appropriate to the key attributes.
 
psa_status_t psa_destroy_se_key (psa_se_drv_data_t *driver, psa_key_slot_number_t slot_number)
 Destroy the key on a secure element.
 
psa_status_t psa_load_se_persistent_data (const psa_se_drv_data_t *driver)
 Load SE data from persistent memory.
 
psa_status_t psa_save_se_persistent_data (const psa_se_drv_data_t *driver)
 Save SE data to persistent memory.
 
psa_status_t psa_destroy_se_persistent_data (psa_key_location_t location)
 Destroy SE data in persistent memory.
 

Macro Definition Documentation

◆ CONFIG_PSA_MAX_SE_COUNT

#define CONFIG_PSA_MAX_SE_COUNT   (1)

Maximum number of available secure elements.

Definition at line 35 of file psa_crypto_se_management.h.

◆ PSA_MAX_SE_COUNT

#define PSA_MAX_SE_COUNT   (CONFIG_PSA_MAX_SE_COUNT)

Maximum supported number of secure elements.

Definition at line 41 of file psa_crypto_se_management.h.

Typedef Documentation

◆ psa_se_drv_data_t

Encodes the secure element driver data.

Definition at line 72 of file psa_crypto_se_management.h.

Function Documentation

◆ psa_destroy_se_key()

psa_status_t psa_destroy_se_key ( psa_se_drv_data_t driver,
psa_key_slot_number_t  slot_number 
)

Destroy the key on a secure element.

Note
Some secure elements may not support this operation.
Parameters
driverDriver of the SE containing the key to be destroyed
slot_numberSlot number of the key that is to be destroyed
Returns
PSA_SUCCESS
PSA_ERROR_NOT_PERMITTED

◆ psa_destroy_se_persistent_data()

psa_status_t psa_destroy_se_persistent_data ( psa_key_location_t  location)

Destroy SE data in persistent memory.

Note
This operation is not yet supported by this implementation
Parameters
locationLocation of the data that should be destroyed
Returns
PSA_ERROR_NOT_SUPPORTED

◆ psa_find_free_se_slot()

psa_status_t psa_find_free_se_slot ( const psa_key_attributes_t attributes,
psa_key_creation_method_t  method,
psa_se_drv_data_t driver,
psa_key_slot_number_t slot_number 
)

Find an empty key slot on a secure element appropriate to the key attributes.

Parameters
attributespsa_key_attributes_t containing the attributes of the key to be created
methodThe method used to create the key (see psa_key_creation_method_t)
driverPointer to the driver for the SE the key should be created on
slot_numberPointer that will contain the slot number of the free SE slot
Returns
PSA_SUCCESS
PSA_ERROR_CORRUPTION_DETECTED
PSA_ERROR_NOT_SUPPORTED

◆ psa_get_se_driver()

int psa_get_se_driver ( psa_key_lifetime_t  lifetime,
const psa_drv_se_t **  p_methods,
psa_drv_se_context_t **  p_drv_context 
)

Get the driver entry points and context of a specified driver.

Parameters
lifetimeLifetime value of type psa_key_lifetime_t of the key to be used
p_methodsPointer that will reference the driver methods
p_drv_contextPointer that will reference the driver context
Returns
1 if a driver was found
0 if no driver exists with this location

◆ psa_get_se_driver_data()

psa_se_drv_data_t * psa_get_se_driver_data ( psa_key_lifetime_t  lifetime)

Get the driver data of a specified driver.

Parameters
lifetimeLifetime value of type psa_key_lifetime_t of the key to be used
Returns
psa_se_drv_data_t* Pointer to the driver data
NULL if no driver exists with this location

◆ psa_get_se_driver_methods()

const psa_drv_se_t * psa_get_se_driver_methods ( const psa_se_drv_data_t driver)

Get the driver entry points of a specified driver.

Parameters
driverDriver data of type psa_se_drv_data_t containing the entry points
Returns
const psa_drv_se_t*

◆ psa_get_se_drv_context()

psa_drv_se_context_t * psa_get_se_drv_context ( psa_se_drv_data_t driver)

Get the driver context of a specified driver.

Parameters
driverDriver data of type psa_se_drv_data_t containing the context
Returns
psa_drv_se_context_t*

◆ psa_load_se_persistent_data()

psa_status_t psa_load_se_persistent_data ( const psa_se_drv_data_t driver)

Load SE data from persistent memory.

Note
This operation is not yet supported by this implementation
Parameters
driverPointer to the driver data the loaded data should be stored in
Returns
PSA_ERROR_NOT_SUPPORTED

◆ psa_register_secure_element()

psa_status_t psa_register_secure_element ( psa_key_location_t  location,
const psa_drv_se_t methods,
void *  psa_se_configuration,
const void *  drv_transient_data 
)

Register a secure element driver with the SE management.

This function is called by the auto_init module during boot.

Parameters
locationLocation the driver should be registered with, of type psa_key_location_t
methodsStructure of available driver entry points of the driver
psa_se_configurationPointer to a secure element configuration structure
drv_transient_dataTransient driver data to be used by the driver
Returns
PSA_SUCCESS
PSA_ERROR_INVALID_ARGUMENT The location value is invalid
PSA_ERROR_NOT_SUPPORTED
PSA_ERROR_INSUFFICIENT_MEMORY
PSA_ERROR_ALREADY_EXISTS *

◆ psa_save_se_persistent_data()

psa_status_t psa_save_se_persistent_data ( const psa_se_drv_data_t driver)

Save SE data to persistent memory.

Note
This operation is not yet supported by this implementation
Parameters
driverPointer to the driver data containing the data to be saved
Returns
PSA_ERROR_NOT_SUPPORTED