Macros
Key lifetimes

Macros

#define KEYSTORE_PSA_KEY_LIFETIME_VOLATILE   ((KeyStore_PSA_KeyLifetime)PSA_KEY_LIFETIME_VOLATILE)
 
#define KEYSTORE_PSA_KEY_LIFETIME_PERSISTENT   ((KeyStore_PSA_KeyLifetime)PSA_KEY_LIFETIME_PERSISTENT)
 
#define KEYSTORE_PSA_KEY_PERSISTENCE_VOLATILE   ((KeyStore_PSA_KeyPersistence)PSA_KEY_PERSISTENCE_VOLATILE)
 
#define KEYSTORE_PSA_KEY_PERSISTENCE_DEFAULT   ((KeyStore_PSA_KeyPersistence)PSA_KEY_PERSISTENCE_DEFAULT)
 
#define KEYSTORE_PSA_KEY_PERSISTENCE_READ_ONLY   ((KeyStore_PSA_KeyPersistence)PSA_KEY_PERSISTENCE_READ_ONLY)
 
#define KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime)   ((KeyStore_PSA_KeyPersistence)((lifetime)&0x000000ff))
 
#define KEYSTORE_PSA_KEY_LIFETIME_GET_LOCATION(lifetime)   ((KeyStore_PSA_KeyLocation)((lifetime) >> 8))
 
#define KEYSTORE_PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)   (KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) == KEYSTORE_PSA_KEY_PERSISTENCE_VOLATILE)
 
#define KEYSTORE_PSA_KEY_LIFETIME_IS_READ_ONLY(lifetime)   (KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) == KEYSTORE_PSA_KEY_PERSISTENCE_READ_ONLY)
 
#define KEYSTORE_PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location)   (PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location))
 
#define KEYSTORE_PSA_KEY_LOCATION_LOCAL_STORAGE   ((KeyStore_PSA_KeyLocation)PSA_KEY_LOCATION_LOCAL_STORAGE)
 
#define KEYSTORE_PSA_KEY_ID_NULL   ((KeyStore_PSA_keyID)0x0)
 
#define KEYSTORE_PSA_KEY_ID_USER_MIN   ((KeyStore_PSA_keyID)PSA_KEY_ID_USER_MIN)
 
#define KEYSTORE_PSA_KEY_ID_VENDOR_MIN   ((KeyStore_PSA_keyID)PSA_KEY_ID_VENDOR_MIN)
 
#define KEYSTORE_PSA_KEY_ID_VENDOR_MAX   ((KeyStore_PSA_keyID)PSA_KEY_ID_VENDOR_MAX)
 
#define KEYSTORE_PSA_DEFAULT_OWNER   MBEDTLS_PSA_CRYPTO_KEY_ID_DEFAULT_OWNER
 

Detailed Description

Macro Definition Documentation

§ KEYSTORE_PSA_KEY_LIFETIME_VOLATILE

#define KEYSTORE_PSA_KEY_LIFETIME_VOLATILE   ((KeyStore_PSA_KeyLifetime)PSA_KEY_LIFETIME_VOLATILE)

The default lifetime for volatile keys.

A volatile key only exists as long as the identifier to it is not destroyed. The key material is guaranteed to be erased on a power reset.

A key with this lifetime is stored in RAM.

Equivalent to KEYSTORE_PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(KEYSTORE_PSA_KEY_PERSISTENCE_VOLATILE, KEYSTORE_PSA_KEY_LOCATION_LOCAL_STORAGE)

§ KEYSTORE_PSA_KEY_LIFETIME_PERSISTENT

#define KEYSTORE_PSA_KEY_LIFETIME_PERSISTENT   ((KeyStore_PSA_KeyLifetime)PSA_KEY_LIFETIME_PERSISTENT)

The default lifetime for persistent keys.

A persistent key remains in storage until it is explicitly destroyed or until the corresponding storage area is wiped. This specification does not define any mechanism to wipe a storage area, but implementations may provide their own mechanism (for example to perform a factory reset, to prepare for device refurbishment, or to uninstall an application).

This lifetime value is the default storage area for the calling application. Implementations may offer other storage areas designated by other lifetime values as implementation-specific extensions.

Equivalent to KEYSTORE_PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(KEYSTORE_PSA_KEY_PERSISTENCE_DEFAULT, KEYSTORE_PSA_KEY_LOCATION_LOCAL_STORAGE)

§ KEYSTORE_PSA_KEY_PERSISTENCE_VOLATILE

#define KEYSTORE_PSA_KEY_PERSISTENCE_VOLATILE   ((KeyStore_PSA_KeyPersistence)PSA_KEY_PERSISTENCE_VOLATILE)

The persistence level of volatile keys.

See KeyStore_PSA_KeyPersistence for more information.

§ KEYSTORE_PSA_KEY_PERSISTENCE_DEFAULT

#define KEYSTORE_PSA_KEY_PERSISTENCE_DEFAULT   ((KeyStore_PSA_KeyPersistence)PSA_KEY_PERSISTENCE_DEFAULT)

The default persistence level for persistent keys.

See KeyStore_PSA_KeyPersistence for more information.

§ KEYSTORE_PSA_KEY_PERSISTENCE_READ_ONLY

#define KEYSTORE_PSA_KEY_PERSISTENCE_READ_ONLY   ((KeyStore_PSA_KeyPersistence)PSA_KEY_PERSISTENCE_READ_ONLY)

A persistence level indicating that a key is never destroyed.

See KeyStore_PSA_KeyPersistence for more information.

§ KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE

#define KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE (   lifetime)    ((KeyStore_PSA_KeyPersistence)((lifetime)&0x000000ff))

§ KEYSTORE_PSA_KEY_LIFETIME_GET_LOCATION

#define KEYSTORE_PSA_KEY_LIFETIME_GET_LOCATION (   lifetime)    ((KeyStore_PSA_KeyLocation)((lifetime) >> 8))

§ KEYSTORE_PSA_KEY_LIFETIME_IS_VOLATILE

#define KEYSTORE_PSA_KEY_LIFETIME_IS_VOLATILE (   lifetime)    (KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) == KEYSTORE_PSA_KEY_PERSISTENCE_VOLATILE)

Whether a key lifetime indicates that the key is volatile.

A volatile key is automatically destroyed by the implementation when the application instance terminates. In particular, a volatile key is automatically destroyed on a power reset of the device.

A key that is not volatile is persistent. Persistent keys are preserved until the application explicitly destroys them or until an implementation-specific device management event occurs (for example, a factory reset).

Parameters
lifetimeThe lifetime value to query (value of type KeyStore_PSA_KeyLifetime).
Returns
1 if the key is volatile, otherwise 0.

§ KEYSTORE_PSA_KEY_LIFETIME_IS_READ_ONLY

#define KEYSTORE_PSA_KEY_LIFETIME_IS_READ_ONLY (   lifetime)    (KEYSTORE_PSA_KEY_LIFETIME_GET_PERSISTENCE(lifetime) == KEYSTORE_PSA_KEY_PERSISTENCE_READ_ONLY)

Whether a key lifetime indicates that the key is read-only.

Read-only keys cannot be created or destroyed through the PSA Crypto API. They must be created through platform-specific means that bypass the API.

Some platforms may offer ways to destroy read-only keys. For example, consider a platform with multiple levels of privilege, where a low-privilege application can use a key but is not allowed to destroy it, and the platform exposes the key to the application with a read-only lifetime. High-privilege code can destroy the key even though the application sees the key as read-only.

Parameters
lifetimeThe lifetime value to query (value of type KeyStore_PSA_KeyLifetime).
Returns
1 if the key is read-only, otherwise 0.

§ KEYSTORE_PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION

#define KEYSTORE_PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION (   persistence,
  location 
)    (PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location))

Construct a lifetime from a persistence level and a location.

Parameters
persistenceThe persistence level (value of type KeyStore_PSA_KeyPersistence).
locationThe location indicator (value of type KeyStore_PSA_KeyLocation).
Returns
The constructed lifetime value.

§ KEYSTORE_PSA_KEY_LOCATION_LOCAL_STORAGE

#define KEYSTORE_PSA_KEY_LOCATION_LOCAL_STORAGE   ((KeyStore_PSA_KeyLocation)PSA_KEY_LOCATION_LOCAL_STORAGE)

The local storage area for persistent keys.

This storage area is available on all systems that can store persistent keys without delegating the storage to a third-party cryptoprocessor.

See KeyStore_PSA_KeyLocation for more information.

§ KEYSTORE_PSA_KEY_ID_NULL

#define KEYSTORE_PSA_KEY_ID_NULL   ((KeyStore_PSA_keyID)0x0)

The null key identifier.

§ KEYSTORE_PSA_KEY_ID_USER_MIN

#define KEYSTORE_PSA_KEY_ID_USER_MIN   ((KeyStore_PSA_keyID)PSA_KEY_ID_USER_MIN)

The minimum value for a key identifier chosen by the application.

§ KEYSTORE_PSA_KEY_ID_VENDOR_MIN

#define KEYSTORE_PSA_KEY_ID_VENDOR_MIN   ((KeyStore_PSA_keyID)PSA_KEY_ID_VENDOR_MIN)

The minimum value for a key identifier chosen by the implementation.

§ KEYSTORE_PSA_KEY_ID_VENDOR_MAX

#define KEYSTORE_PSA_KEY_ID_VENDOR_MAX   ((KeyStore_PSA_keyID)PSA_KEY_ID_VENDOR_MAX)

The maximum value for a key identifier chosen by the implementation.

§ KEYSTORE_PSA_DEFAULT_OWNER

#define KEYSTORE_PSA_DEFAULT_OWNER   MBEDTLS_PSA_CRYPTO_KEY_ID_DEFAULT_OWNER

Default Key Owner

© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale