Files | |
| file | psa_crypto_slot_management.h | 
| PSA key slot management function declarations.  | |
Data Structures | |
| struct | psa_key_slot_t | 
| Structure of a virtual key slot in local memory.  More... | |
Macros | |
| #define | PSA_PROTECTED_KEY_COUNT (CONFIG_PSA_PROTECTED_KEY_COUNT) | 
| Number of allocated slots for keys in protected memory or secure elements.  | |
| #define | PSA_ASYMMETRIC_KEYPAIR_COUNT (CONFIG_PSA_ASYMMETRIC_KEYPAIR_COUNT) | 
| Number of allocated slots for asymmetric key pairs.  | |
| #define | PSA_SINGLE_KEY_COUNT (CONFIG_PSA_SINGLE_KEY_COUNT) | 
| Number of allocated slots for single keys in local memory.  | |
| #define | PSA_KEY_SLOT_COUNT | 
| Complete number of available key slots.  More... | |
| #define | PSA_KEY_ID_VOLATILE_MIN (PSA_KEY_ID_VENDOR_MIN) | 
| Minimum key id for volatile keys.  More... | |
| #define | PSA_KEY_ID_VOLATILE_MAX (PSA_KEY_ID_VENDOR_MAX) | 
| Maximum key id for volatile keys.  More... | |
Functions | |
| void | psa_init_key_slots (void) | 
| Initializes the allocated key slots and prepares the internal key slot lists.  | |
| static int | psa_key_id_is_volatile (psa_key_id_t key_id) | 
| Check whether a key identifier is a volatile key identifier.  More... | |
| static int | psa_is_key_slot_locked (psa_key_slot_t *slot) | 
| Check whether a key slot is locked.  More... | |
| psa_key_slot_number_t * | psa_key_slot_get_slot_number (const psa_key_slot_t *slot) | 
| Get slot number in protected memory.  More... | |
| static int | psa_key_lifetime_is_external (psa_key_lifetime_t lifetime) | 
| Check whether a key is stored on an external device.  More... | |
| psa_status_t | psa_wipe_key_slot (psa_key_slot_t *slot) | 
| Wipe volatile key slot and its contents.  More... | |
| void | psa_wipe_all_key_slots (void) | 
| Wipe all existing volatile key slots.  | |
| psa_status_t | psa_get_and_lock_key_slot (psa_key_id_t id, psa_key_slot_t **slot) | 
| Find a key slot in local memory and lock it.  More... | |
| psa_status_t | psa_persist_key_slot_in_storage (psa_key_slot_t *slot) | 
| Store a key slot in persistent storage.  More... | |
| psa_status_t | psa_allocate_empty_key_slot (psa_key_id_t *id, const psa_key_attributes_t *attr, psa_key_slot_t **p_slot) | 
| Find a currently empty key slot that is appropriate for the key.  More... | |
| psa_status_t | psa_lock_key_slot (psa_key_slot_t *slot) | 
| Increase lock count.  More... | |
| psa_status_t | psa_unlock_key_slot (psa_key_slot_t *slot) | 
| Decrease lock count.  More... | |
| psa_status_t | psa_validate_key_location (psa_key_lifetime_t lifetime, psa_se_drv_data_t **driver) | 
| Check if key location exists.  More... | |
| psa_status_t | psa_validate_key_persistence (psa_key_lifetime_t lifetime) | 
| Validate key persistence.  More... | |
| int | psa_is_valid_key_id (psa_key_id_t id, int vendor) | 
| Check if provided key ID is either a valid user ID or vendor ID.  More... | |
| size_t | psa_get_key_data_from_key_slot (const psa_key_slot_t *slot, uint8_t **key_data, size_t **key_bytes) | 
| Get key data and key size from key slot.  More... | |
| void | psa_get_public_key_data_from_key_slot (const psa_key_slot_t *slot, uint8_t **pubkey_data, size_t **pubkey_data_len) | 
| Get public key data and size from key slot.  More... | |
| #define PSA_KEY_ID_VOLATILE_MAX (PSA_KEY_ID_VENDOR_MAX) | 
Maximum key id for volatile keys.
This is the maximum volatile identifiers that can be assigned to created keys.
Definition at line 65 of file psa_crypto_slot_management.h.
| #define PSA_KEY_ID_VOLATILE_MIN (PSA_KEY_ID_VENDOR_MIN) | 
Minimum key id for volatile keys.
This is used to assign volatile identifiers to created keys.
Definition at line 58 of file psa_crypto_slot_management.h.
| #define PSA_KEY_SLOT_COUNT | 
Complete number of available key slots.
Definition at line 49 of file psa_crypto_slot_management.h.
| psa_status_t psa_allocate_empty_key_slot | ( | psa_key_id_t * | id, | 
| const psa_key_attributes_t * | attr, | ||
| psa_key_slot_t ** | p_slot | ||
| ) | 
Find a currently empty key slot that is appropriate for the key.
| id | Key ID of the newly generated or imported key | 
| attr | Attributes of the key that is supposed to be stored in the slot | 
| p_slot | Pointer to the empty slot in memory | 
| psa_status_t psa_get_and_lock_key_slot | ( | psa_key_id_t | id, | 
| psa_key_slot_t ** | slot | ||
| ) | 
Find a key slot in local memory and lock it.
| id | ID of the key to be used | 
| slot | Pointer to the slot the key is stored in | 
| size_t psa_get_key_data_from_key_slot | ( | const psa_key_slot_t * | slot, | 
| uint8_t ** | key_data, | ||
| size_t ** | key_bytes | ||
| ) | 
Get key data and key size from key slot.
| slot | Slot the desired key is stored in | 
| key_data | Pointer to key data | 
| key_bytes | Pointer to key data size in bytes | 
key_data in bytes. | void psa_get_public_key_data_from_key_slot | ( | const psa_key_slot_t * | slot, | 
| uint8_t ** | pubkey_data, | ||
| size_t ** | pubkey_data_len | ||
| ) | 
Get public key data and size from key slot.
| slot | Slot the desired key is stored in | 
| pubkey_data | Pointer to key data | 
| pubkey_data_len | Pointer to key data size in bytes | 
      
  | 
  inlinestatic | 
Check whether a key slot is locked.
| slot | Pointer to the slot to be checked | 
Definition at line 159 of file psa_crypto_slot_management.h.
| int psa_is_valid_key_id | ( | psa_key_id_t | id, | 
| int | vendor | ||
| ) | 
Check if provided key ID is either a valid user ID or vendor ID.
| id | ID of key to be validated | 
| vendor | If ID is supposed to be user or vendor ID | 
      
  | 
  inlinestatic | 
Check whether a key identifier is a volatile key identifier.
| key_id | Key identifier to test. | 
Definition at line 146 of file psa_crypto_slot_management.h.
      
  | 
  inlinestatic | 
Check whether a key is stored on an external device.
| lifetime | Lifetime value of the key that's supposed to be checked | 
Definition at line 180 of file psa_crypto_slot_management.h.
| psa_key_slot_number_t* psa_key_slot_get_slot_number | ( | const psa_key_slot_t * | slot | ) | 
Get slot number in protected memory.
| slot | Pointer to the slot containing the protected slot number | 
| psa_status_t psa_lock_key_slot | ( | psa_key_slot_t * | slot | ) | 
Increase lock count.
| slot | Slot to be locked | 
| psa_status_t psa_persist_key_slot_in_storage | ( | psa_key_slot_t * | slot | ) | 
Store a key slot in persistent storage.
| slot | Pointer to slot to store in persistent storage | 
| psa_status_t psa_unlock_key_slot | ( | psa_key_slot_t * | slot | ) | 
Decrease lock count.
| slot | Slot to be unlocked | 
| psa_status_t psa_validate_key_location | ( | psa_key_lifetime_t | lifetime, | 
| psa_se_drv_data_t ** | driver | ||
| ) | 
Check if key location exists.
| lifetime | Lifetime value of the key to be validated | 
| driver | Pointer to driver assigned to the existing key location, if it exists | 
| psa_status_t psa_validate_key_persistence | ( | psa_key_lifetime_t | lifetime | ) | 
Validate key persistence.
Currently only volatile keys are supported.
| lifetime | Lifetime of key to be validated | 
| psa_status_t psa_wipe_key_slot | ( | psa_key_slot_t * | slot | ) | 
Wipe volatile key slot and its contents.
Wiped key slots can be reused.
| slot | Pointer to the key slot to be wiped |