@@ -369,6 +369,70 @@ 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[in] data Buffer containing the key domain parameters. The content
383
+ * of this buffer is interpreted according to \p type. of
384
+ * psa_export_key() or psa_export_public_key() for the
385
+ * chosen type.
386
+ * \param data_length Size of the \p data buffer in bytes.
387
+ *
388
+ * \retval #PSA_SUCCESS
389
+ * \retval #PSA_ERROR_INVALID_HANDLE
390
+ * \retval #PSA_ERROR_OCCUPIED_SLOT
391
+ * There is already a key in the specified slot.
392
+ * \retval #PSA_ERROR_INVALID_ARGUMENT
393
+ * \retval #PSA_ERROR_COMMUNICATION_FAILURE
394
+ * \retval #PSA_ERROR_HARDWARE_FAILURE
395
+ * \retval #PSA_ERROR_TAMPERING_DETECTED
396
+ * \retval #PSA_ERROR_BAD_STATE
397
+ * The library has not been previously initialized by psa_crypto_init().
398
+ * It is implementation-dependent whether a failure to initialize
399
+ * results in this error code.
400
+ */
401
+ psa_status_t psa_set_key_domain_parameters (psa_key_handle_t handle ,
402
+ const uint8_t * data ,
403
+ size_t data_length );
404
+
405
+ /**
406
+ * \brief Get domain parameters for a key.
407
+ *
408
+ * Get the domain parameters for a key with this function, if any. The format
409
+ * of the domain parameters written to \p data is specified in the
410
+ * documentation for psa_set_key_domain_parameters().
411
+ *
412
+ * \param[out] data On success, the key domain parameters.
413
+ * \param data_size Size of the \p data buffer in bytes.
414
+ * \param[out] data_length On success, the number of bytes
415
+ * that make up the key domain parameters data.
416
+ *
417
+ * \retval #PSA_SUCCESS
418
+ * \retval #PSA_ERROR_INVALID_HANDLE
419
+ * \retval #PSA_ERROR_EMPTY_SLOT
420
+ * There is no key in the specified slot.
421
+ * \retval #PSA_ERROR_INVALID_ARGUMENT
422
+ * \retval #PSA_ERROR_NOT_SUPPORTED
423
+ * \retval #PSA_ERROR_COMMUNICATION_FAILURE
424
+ * \retval #PSA_ERROR_HARDWARE_FAILURE
425
+ * \retval #PSA_ERROR_TAMPERING_DETECTED
426
+ * \retval #PSA_ERROR_BAD_STATE
427
+ * The library has not been previously initialized by psa_crypto_init().
428
+ * It is implementation-dependent whether a failure to initialize
429
+ * results in this error code.
430
+ */
431
+ psa_status_t psa_get_key_domain_parameters (psa_key_handle_t handle ,
432
+ uint8_t * data ,
433
+ size_t data_size ,
434
+ size_t * data_length );
435
+
372
436
/**
373
437
* \brief Export a key in binary format.
374
438
*
0 commit comments