|
XenevaOS
|
Macros | |
| #define | PSA_KEY_ATTRIBUTES_INIT |
| #define | PSA_DH_FAMILY_CUSTOM ((psa_dh_family_t) MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(0x7e)) |
| #define | PSA_KEY_DOMAIN_PARAMETERS_SIZE(key_type, key_bits) MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(1u) |
| #define | PSA_PAKE_OPERATION_STAGE_SETUP 0 |
| #define | PSA_PAKE_OPERATION_STAGE_COLLECT_INPUTS 1 |
| #define | PSA_PAKE_OPERATION_STAGE_COMPUTATION 2 |
Typedefs | |
| typedef struct psa_key_attributes_s | psa_key_attributes_t |
Functions | |
| psa_status_t | psa_get_key_attributes (mbedtls_svc_key_id_t key, psa_key_attributes_t *attributes) |
| void | psa_reset_key_attributes (psa_key_attributes_t *attributes) |
| #define PSA_DH_FAMILY_CUSTOM ((psa_dh_family_t) MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(0x7e)) |
Custom Diffie-Hellman group.
Mbed TLS does not support custom DH groups.
| #define PSA_KEY_ATTRIBUTES_INIT |
This macro returns a suitable initializer for a key attribute structure of type psa_key_attributes_t.
| #define PSA_KEY_DOMAIN_PARAMETERS_SIZE | ( | key_type, | |
| key_bits | |||
| ) | MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(1u) |
Safe output buffer size for psa_get_key_domain_parameters().
| #define PSA_PAKE_OPERATION_STAGE_COLLECT_INPUTS 1 |
| #define PSA_PAKE_OPERATION_STAGE_COMPUTATION 2 |
| #define PSA_PAKE_OPERATION_STAGE_SETUP 0 |
PAKE operation stages.
| typedef struct psa_key_attributes_s psa_key_attributes_t |
The type of a structure containing key attributes.
This is an opaque structure that can represent the metadata of a key object. Metadata that can be stored in attributes includes:
The actual key material is not considered an attribute of a key. Key attributes do not contain information that is generally considered highly confidential.
An attribute structure works like a simple data structure where each function psa_set_key_xxx sets a field and the corresponding function psa_get_key_xxx retrieves the value of the corresponding field. However, a future version of the library may report values that are equivalent to the original one, but have a different encoding. Invalid values may be mapped to different, also invalid values.
An attribute structure may contain references to auxiliary resources, for example pointers to allocated memory or indirect references to pre-calculated values. In order to free such resources, the application must call psa_reset_key_attributes(). As an exception, calling psa_reset_key_attributes() on an attribute structure is optional if the structure has only been modified by the following functions since it was initialized or last reset with psa_reset_key_attributes():
Before calling any function on a key attribute structure, the application must initialize it by any of the following means:
A freshly initialized attribute structure contains the following values:
0 (meaning that the type is unspecified).0 (meaning that the size is unspecified).0 (which allows no usage except exporting a public key).0 (which allows no cryptographic usage, but allows exporting).A typical sequence to create a key is as follows:
A typical sequence to query a key's attributes is as follows:
psa_get_key_xxx functions to retrieve the attribute(s) that you are interested in.Once a key has been created, it is impossible to change its attributes.
| psa_status_t psa_get_key_attributes | ( | mbedtls_svc_key_id_t | key, |
| psa_key_attributes_t * | attributes | ||
| ) |
Retrieve the attributes of a key.
This function first resets the attribute structure as with psa_reset_key_attributes(). It then copies the attributes of the given key into the given attribute structure.
| [in] | key | Identifier of the key to query. |
| [in,out] | attributes | On success, the attributes of the key. On failure, equivalent to a freshly-initialized structure. |
| PSA_SUCCESS | \emptydescription |
| PSA_ERROR_INVALID_HANDLE | \emptydescription |
| PSA_ERROR_INSUFFICIENT_MEMORY | \emptydescription |
| PSA_ERROR_COMMUNICATION_FAILURE | \emptydescription |
| PSA_ERROR_CORRUPTION_DETECTED | \emptydescription |
| PSA_ERROR_STORAGE_FAILURE | \emptydescription |
| PSA_ERROR_DATA_CORRUPT | \emptydescription |
| PSA_ERROR_DATA_INVALID | \emptydescription |
| PSA_ERROR_BAD_STATE | The library has not been previously initialized by psa_crypto_init(). It is implementation-dependent whether a failure to initialize results in this error code. |
| void psa_reset_key_attributes | ( | psa_key_attributes_t * | attributes | ) |
Reset a key attribute structure to a freshly initialized state.
You must initialize the attribute structure as described in the documentation of the type psa_key_attributes_t before calling this function. Once the structure has been initialized, you may call this function at any time.
This function frees any auxiliary resources that the structure may contain.
| [in,out] | attributes | The attribute structure to reset. |