|
Platform Security Architecture — cryptography and keystore interface
beta 2 — 2019-02-22
|
Classes | |
| struct | psa_generate_key_extra_rsa |
Functions | |
| psa_status_t | psa_generate_random (uint8_t *output, size_t output_size) |
| Generate random bytes. More... | |
| psa_status_t | psa_generate_key (psa_key_handle_t handle, psa_key_type_t type, size_t bits, const void *extra, size_t extra_size) |
| Generate a key or key pair. More... | |
| psa_status_t psa_generate_key | ( | psa_key_handle_t | handle, |
| psa_key_type_t | type, | ||
| size_t | bits, | ||
| const void * | extra, | ||
| size_t | extra_size | ||
| ) |
Generate a key or key pair.
| handle | Handle to the slot where the key will be stored. It must have been obtained by calling psa_allocate_key() or psa_create_key() and must not contain key material yet. | |
| type | Key type (a PSA_KEY_TYPE_XXX value). | |
| bits | Key size in bits. | |
| [in] | extra | Extra parameters for key generation. The interpretation of this parameter depends on type. All types support NULL to use default parameters. Implementation that support the generation of vendor-specific key types that allow extra parameters shall document the format of these extra parameters and the default values. For standard parameters, the meaning of extra is as follows:
|
| extra_size | Size of the buffer that extra points to, in bytes. Note that if extra is NULL then extra_size must be zero. |
| PSA_SUCCESS | Success. If the key is persistent, the key material and the key's metadata have been saved to persistent storage. |
| PSA_ERROR_INVALID_HANDLE | |
| PSA_ERROR_OCCUPIED_SLOT | There is already a key in the specified slot. |
| PSA_ERROR_NOT_SUPPORTED | |
| PSA_ERROR_INVALID_ARGUMENT | |
| PSA_ERROR_INSUFFICIENT_MEMORY | |
| PSA_ERROR_INSUFFICIENT_ENTROPY | |
| PSA_ERROR_COMMUNICATION_FAILURE | |
| PSA_ERROR_HARDWARE_FAILURE | |
| PSA_ERROR_TAMPERING_DETECTED | |
| 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. |
| psa_status_t psa_generate_random | ( | uint8_t * | output, |
| size_t | output_size | ||
| ) |
Generate random bytes.
| [out] | output | Output buffer for the generated data. |
| output_size | Number of bytes to generate and output. |
| PSA_SUCCESS | |
| PSA_ERROR_NOT_SUPPORTED | |
| PSA_ERROR_INSUFFICIENT_ENTROPY | |
| PSA_ERROR_COMMUNICATION_FAILURE | |
| PSA_ERROR_HARDWARE_FAILURE | |
| PSA_ERROR_TAMPERING_DETECTED | |
| 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. |
1.8.11