You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/crypto/api/keys/management.rst
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -331,6 +331,7 @@ Key export
331
331
This must be appropriate for the key:
332
332
333
333
* The required output size is :code:`PSA_EXPORT_KEY_OUTPUT_SIZE(type, bits)` where ``type`` is the key type and ``bits`` is the key size in bits.
334
+
* `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE` evaluates to the maximum output size of any supported public key or key pair.
334
335
* `PSA_EXPORT_KEY_PAIR_MAX_SIZE` evaluates to the maximum output size of any supported key pair.
335
336
* `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE` evaluates to the maximum output size of any supported public key.
336
337
* This API defines no maximum size for symmetric keys. Arbitrarily large data items can be stored in the key store, for example certificates that correspond to a stored private key or input material for key derivation.
@@ -353,7 +354,7 @@ Key export
353
354
* The implementation does not support export of keys with this key type.
354
355
.. retval:: PSA_ERROR_BUFFER_TOO_SMALL
355
356
The size of the ``data`` buffer is too small.
356
-
`PSA_EXPORT_KEY_OUTPUT_SIZE()`or `PSA_EXPORT_KEY_PAIR_MAX_SIZE` can be used to determine a sufficient buffer size.
357
+
`PSA_EXPORT_KEY_OUTPUT_SIZE()`, `PSA_EXPORT_KEY_PAIR_MAX_SIZE`, `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`, or `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE` can be used to determine a sufficient buffer size.
357
358
.. retval:: PSA_ERROR_COMMUNICATION_FAILURE
358
359
.. retval:: PSA_ERROR_CORRUPTION_DETECTED
359
360
.. retval:: PSA_ERROR_STORAGE_FAILURE
@@ -386,6 +387,7 @@ Key export
386
387
387
388
* The required output size is :code:`PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE(type, bits)` where ``type`` is the key type and ``bits`` is the key size in bits.
388
389
* `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE` evaluates to the maximum output size of any supported public key or public part of a key pair.
390
+
* `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE` evaluates to the maximum output size of any supported public key or key pair.
389
391
390
392
.. param:: size_t * data_length
391
393
On success, the number of bytes that make up the key data.
@@ -405,7 +407,7 @@ Key export
405
407
* The implementation does not support export of keys with this key type.
406
408
.. retval:: PSA_ERROR_BUFFER_TOO_SMALL
407
409
The size of the ``data`` buffer is too small.
408
-
`PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE()`or `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE` can be used to determine a sufficient buffer size.
410
+
`PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE()`, `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`, or `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE` can be used to determine a sufficient buffer size.
409
411
.. retval:: PSA_ERROR_COMMUNICATION_FAILURE
410
412
.. retval:: PSA_ERROR_CORRUPTION_DETECTED
411
413
.. retval:: PSA_ERROR_STORAGE_FAILURE
@@ -458,7 +460,7 @@ Key export
458
460
if (status != PSA_SUCCESS)
459
461
handle_error(...);
460
462
461
-
See also `PSA_EXPORT_KEY_PAIR_MAX_SIZE`and `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`.
463
+
See also `PSA_EXPORT_KEY_PAIR_MAX_SIZE`, `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`, and `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE`.
462
464
463
465
.. macro:: PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE
464
466
:definition: /* implementation-defined value */
@@ -497,7 +499,7 @@ Key export
497
499
if (status != PSA_SUCCESS)
498
500
handle_error(...);
499
501
500
-
See also `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`.
502
+
See also `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE` and `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE`.
501
503
502
504
.. macro:: PSA_EXPORT_KEY_PAIR_MAX_SIZE
503
505
:definition: /* implementation-defined value */
@@ -507,7 +509,7 @@ Key export
507
509
508
510
This value must be a sufficient buffer size when calling `psa_export_key()` to export any asymmetric key pair that is supported by the implementation, regardless of the exact key type and key size.
509
511
510
-
See also `PSA_EXPORT_KEY_OUTPUT_SIZE()`.
512
+
See also `PSA_EXPORT_KEY_OUTPUT_SIZE()`, `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`, and `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE`.
511
513
512
514
.. macro:: PSA_EXPORT_PUBLIC_KEY_MAX_SIZE
513
515
:definition: /* implementation-defined value */
@@ -517,7 +519,17 @@ Key export
517
519
518
520
This value must be a sufficient buffer size when calling `psa_export_key()` or `psa_export_public_key()` to export any asymmetric public key that is supported by the implementation, regardless of the exact key type and key size.
519
521
520
-
See also `PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE()`.
522
+
See also `PSA_EXPORT_PUBLIC_KEY_OUTPUT_SIZE()`, `PSA_EXPORT_KEY_OUTPUT_SIZE()`, `PSA_EXPORT_KEY_PAIR_MAX_SIZE`, and `PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE`.
523
+
524
+
.. macro:: PSA_EXPORT_ASYMMETRIC_KEY_MAX_SIZE
525
+
:definition: /* implementation-defined value */
526
+
527
+
.. summary::
528
+
Sufficient buffer size for exporting any asymmetric key pair or public key.
529
+
530
+
This value must be a sufficient buffer size when calling `psa_export_key()` or `psa_export_public_key()` to export any asymmetric key pair or public key that is supported by the implementation, regardless of the exact key type and key size.
531
+
532
+
See also `PSA_EXPORT_KEY_PAIR_MAX_SIZE`, `PSA_EXPORT_PUBLIC_KEY_MAX_SIZE`, and `PSA_EXPORT_KEY_OUTPUT_SIZE()`.
0 commit comments