@@ -369,6 +369,72 @@ psa_status_t psa_get_key_information(psa_key_handle_t handle,
369
369
psa_key_type_t * type ,
370
370
size_t * bits );
371
371
372
+ /**
373
+ * \brief Set domain parameters for a key.
374
+ *
375
+ * Some key types require additional domain parameters to be set before import
376
+ * or generation of the key. The domain parameters can be set with this
377
+ * function or, for key generation, through the \c extra parameter of
378
+ * psa_generate_key().
379
+ *
380
+ * The format for the required domain parameters varies by the key type.
381
+ *
382
+ * \param handle Handle to the key to set domain parameters for.
383
+ * \param[in] data Buffer containing the key domain parameters. The content
384
+ * of this buffer is interpreted according to \p type. of
385
+ * psa_export_key() or psa_export_public_key() for the
386
+ * chosen type.
387
+ * \param data_length Size of the \p data buffer in bytes.
388
+ *
389
+ * \retval #PSA_SUCCESS
390
+ * \retval #PSA_ERROR_INVALID_HANDLE
391
+ * \retval #PSA_ERROR_OCCUPIED_SLOT
392
+ * There is already a key in the specified slot.
393
+ * \retval #PSA_ERROR_INVALID_ARGUMENT
394
+ * \retval #PSA_ERROR_COMMUNICATION_FAILURE
395
+ * \retval #PSA_ERROR_HARDWARE_FAILURE
396
+ * \retval #PSA_ERROR_TAMPERING_DETECTED
397
+ * \retval #PSA_ERROR_BAD_STATE
398
+ * The library has not been previously initialized by psa_crypto_init().
399
+ * It is implementation-dependent whether a failure to initialize
400
+ * results in this error code.
401
+ */
402
+ psa_status_t psa_set_key_domain_parameters (psa_key_handle_t handle ,
403
+ const uint8_t * data ,
404
+ size_t data_length );
405
+
406
+ /**
407
+ * \brief Get domain parameters for a key.
408
+ *
409
+ * Get the domain parameters for a key with this function, if any. The format
410
+ * of the domain parameters written to \p data is specified in the
411
+ * documentation for psa_set_key_domain_parameters().
412
+ *
413
+ * \param handle Handle to the key to get domain parameters from.
414
+ * \param[out] data On success, the key domain parameters.
415
+ * \param data_size Size of the \p data buffer in bytes.
416
+ * \param[out] data_length On success, the number of bytes
417
+ * that make up the key domain parameters data.
418
+ *
419
+ * \retval #PSA_SUCCESS
420
+ * \retval #PSA_ERROR_INVALID_HANDLE
421
+ * \retval #PSA_ERROR_EMPTY_SLOT
422
+ * There is no key in the specified slot.
423
+ * \retval #PSA_ERROR_INVALID_ARGUMENT
424
+ * \retval #PSA_ERROR_NOT_SUPPORTED
425
+ * \retval #PSA_ERROR_COMMUNICATION_FAILURE
426
+ * \retval #PSA_ERROR_HARDWARE_FAILURE
427
+ * \retval #PSA_ERROR_TAMPERING_DETECTED
428
+ * \retval #PSA_ERROR_BAD_STATE
429
+ * The library has not been previously initialized by psa_crypto_init().
430
+ * It is implementation-dependent whether a failure to initialize
431
+ * results in this error code.
432
+ */
433
+ psa_status_t psa_get_key_domain_parameters (psa_key_handle_t handle ,
434
+ uint8_t * data ,
435
+ size_t data_size ,
436
+ size_t * data_length );
437
+
372
438
/**
373
439
* \brief Export a key in binary format.
374
440
*
0 commit comments