|
Mbed TLS v4.0.0
|
Typedefs | |
| typedef struct psa_export_public_key_iop_s | psa_export_public_key_iop_t |
Functions | |
| uint32_t | psa_export_public_key_iop_get_num_ops (psa_export_public_key_iop_t *operation) |
Get the number of ops that an export public-key operation has taken so far. If the operation has completed, then this will represent the number of ops required for the entire operation. After initialization or calling psa_export_public_key_iop_abort() on the operation, a value of 0 will be returned. More... | |
| psa_status_t | psa_export_public_key_iop_setup (psa_export_public_key_iop_t *operation, mbedtls_svc_key_id_t key) |
| Start an interruptible operation to export a public key or the public part of a key pair in binary format. More... | |
| psa_status_t | psa_export_public_key_iop_complete (psa_export_public_key_iop_t *operation, uint8_t *data, size_t data_size, size_t *data_length) |
| Continue and eventually complete the action of exporting a public key, in an interruptible manner. More... | |
| psa_status_t | psa_export_public_key_iop_abort (psa_export_public_key_iop_t *operation) |
| Abort an interruptible public-key export operation. More... | |
| typedef struct psa_export_public_key_iop_s psa_export_public_key_iop_t |
The type of the state data structure for interruptible public-key export operations.
Before calling any function on an interruptible export public-key object, the application must initialize it by any of the following means:
This is an implementation-defined struct. Applications should not make any assumptions about the content of this structure. Implementation details can change in future versions without notice.
| psa_status_t psa_export_public_key_iop_abort | ( | psa_export_public_key_iop_t * | operation | ) |
Abort an interruptible public-key export operation.
psa_export_public_key_iop_get_num_ops() if required before calling.psa_export_public_key_iop_setup() again.psa_export_public_key_iop_abort() after the operation has already been terminated by a call to psa_export_public_key_iop_abort() or psa_export_public_key_iop_complete() is safe.| [in,out] | operation | The psa_export_public_key_iop_t to use |
| PSA_SUCCESS | The operation was aborted successfully. |
| PSA_ERROR_BAD_STATE | The library has not been previously initialized by psa_crypto_init(). |
| PSA_ERROR_CORRUPTION_DETECTED |
| psa_status_t psa_export_public_key_iop_complete | ( | psa_export_public_key_iop_t * | operation, |
| uint8_t * | data, | ||
| size_t | data_size, | ||
| size_t * | data_length | ||
| ) |
Continue and eventually complete the action of exporting a public key, in an interruptible manner.
psa_export_public_key_iop_setup() is equivalent to psa_export_public_key() but this function can return early and resume according to the limit set with psa_interruptible_set_max_ops() to reduce the maximum time spent in a function call.psa_export_public_key_iop_abort() at any point if they no longer want the result.psa_export_public_key_iop_abort().| [in,out] | operation | The psa_export_public_key_iop_t to use. This must be initialized first, and have had psa_export_public_key_iop_setup() called with it first. |
| [out] | data | Buffer where the key data is to be written. |
| [in] | data_size | Size of the data buffer in bytes. This must be appropriate for the key:
|
| [out] | data_length | On success, the number of bytes that make up the key data. |
| PSA_SUCCESS | Success. The first (*data_length) bytes of data contain the exported public key. |
| PSA_ERROR_BAD_STATE | The following conditions can result in this error:
|
| PSA_ERROR_BUFFER_TOO_SMALL | The size of the data buffer is too small. PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(), PSA_EXPORT_PUBLIC_KEY_MAX_SIZE. |
| PSA_ERROR_INSUFFICIENT_MEMORY | |
| PSA_ERROR_COMMUNICATION_FAILURE | |
| PSA_ERROR_CORRUPTION_DETECTED | |
| PSA_ERROR_STORAGE_FAILURE | |
| PSA_ERROR_DATA_CORRUPT | |
| PSA_ERROR_DATA_INVALID | |
| PSA_OPERATION_INCOMPLETE | Operation was interrupted due to the setting of psa_interruptible_set_max_ops(). There is still work to be done. Call this function again with the same operation object. |
| uint32_t psa_export_public_key_iop_get_num_ops | ( | psa_export_public_key_iop_t * | operation | ) |
Get the number of ops that an export public-key operation has taken so far. If the operation has completed, then this will represent the number of ops required for the entire operation. After initialization or calling psa_export_public_key_iop_abort() on the operation, a value of 0 will be returned.
psa_interruptible_set_max_ops().| operation | The psa_export_public_key_iop_t to use. This must be initialized first. |
| psa_status_t psa_export_public_key_iop_setup | ( | psa_export_public_key_iop_t * | operation, |
| mbedtls_svc_key_id_t | key | ||
| ) |
Start an interruptible operation to export a public key or the public part of a key pair in binary format.
psa_export_public_key_iop_complete() is equivalent to psa_export_public_key() but psa_export_public_key_iop_complete() can return early and resume according to the limit set with psa_interruptible_set_max_ops() to reduce the maximum time spent in a function.psa_export_public_key_iop_complete() repeatedly on the same operation object after a successful call to this function until psa_export_public_key_iop_complete() either returns PSA_SUCCESS or an error. psa_export_public_key_iop_complete() will return PSA_OPERATION_INCOMPLETE if there is more work to do. Alternatively users can call psa_export_public_key_iop_abort() at any point if they no longer want the result.psa_export_public_key_iop_get_num_ops() if required before calling.psa_export_public_key_iop_abort().| [in,out] | operation | The psa_export_public_key_iop_t to use. This must be initialized as per the documentation for psa_export_public_key_iop_t, and be inactive. |
| [in] | key | Identifier of the key to export. |
| PSA_SUCCESS | The operation started successfully. Call psa_export_public_key_iop_complete() with the same context to complete the operation. |
| PSA_ERROR_INVALID_HANDLE | key is not a valid key identifier. |
| PSA_ERROR_INVALID_ARGUMENT | The key is neither a public key nor a key pair. |
| PSA_ERROR_NOT_SUPPORTED | The following conditions can result in this error:
|
| PSA_ERROR_BAD_STATE | The following conditions can result in this error:
|
| PSA_ERROR_COMMUNICATION_FAILURE | |
| PSA_ERROR_CORRUPTION_DETECTED | |
| PSA_ERROR_STORAGE_FAILURE | |
| PSA_ERROR_DATA_CORRUPT | |
| PSA_ERROR_DATA_INVALID | |
| PSA_ERROR_INSUFFICIENT_MEMORY |
1.8.6