Key attributes definitions for the PSA Crypto API. More...
Key attributes definitions for the PSA Crypto API.
Definition in file attributes.h.
#include "psa/algorithm.h"
#include "bits.h"
#include "id.h"
#include "lifetime.h"
#include "type.h"
#include "usage.h"
Go to the source code of this file.
Data Structures | |
struct | psa_key_policy_s |
Structure storing the key usage policies. More... | |
struct | psa_key_attributes_s |
Structure storing key attributes. More... | |
#define | PSA_KEY_ATTRIBUTES_INIT { 0 } |
This macro returns a suitable initializer for a key attribute object of type psa_key_attributes_t. | |
typedef struct psa_key_policy_s | psa_key_policy_t |
Type for key usage policies. | |
typedef struct psa_key_attributes_s | psa_key_attributes_t |
The type of an object containing key attributes. | |
static psa_key_attributes_t | psa_key_attributes_init (void) |
Return an initial value for a key attribute object. | |
#define PSA_KEY_ATTRIBUTES_INIT { 0 } |
This macro returns a suitable initializer for a key attribute object of type psa_key_attributes_t.
Definition at line 167 of file attributes.h.
typedef struct psa_key_attributes_s psa_key_attributes_t |
The type of an object containing key attributes.
This is the object that represents 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.
psa_set_key_xxx()
sets a field and the corresponding function psa_get_key_xxx()
retrieves the value of the field. An implementation can report attribute values that are equivalent to the original one, but have a different encoding. For example, an implementation can use a more compact representation for types where many bit-patterns are invalid or not supported, and store all values that it does not support as a special marker value. In such an implementation, after setting an invalid value, the corresponding get function returns an invalid value which might not be the one that was originally stored.This is an implementation-defined type. Applications that make assumptions about the content of this object will result in in implementation-specific behavior, and are non-portable.
An attribute object can 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 object is optional if the object has only been modified by the following functions since it was initialized or last reset with psa_reset_key_attributes():
A freshly initialized attribute object contains the following values:
0
— meaning that the size is unspecified.0
— which allows no usage except exporting a public key.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 required attribute(s).Once a key has been created, it is impossible to change its attributes.
Definition at line 161 of file attributes.h.
typedef struct psa_key_policy_s psa_key_policy_t |
Type for key usage policies.
Definition at line 47 of file attributes.h.
|
inlinestatic |
Return an initial value for a key attribute object.
Definition at line 174 of file attributes.h.