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/types.rst
+33-21Lines changed: 33 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ Symmetric keys
117
117
118
118
.. subsection:: Key format
119
119
120
-
The data format for import and export of the key is the raw bytes of the key.
120
+
The default data format for import and export of the key is the raw bytes of the key.
121
121
122
122
.. subsection:: Key derivation
123
123
@@ -157,7 +157,7 @@ Symmetric keys
157
157
158
158
.. subsection:: Key format
159
159
160
-
The data format for import and export of the key is the raw bytes of the key.
160
+
The default data format for import and export of the key is the raw bytes of the key.
161
161
162
162
.. subsection:: Key derivation
163
163
@@ -225,7 +225,7 @@ Symmetric keys
225
225
226
226
.. subsection:: Key format
227
227
228
-
The data format for import and export of the key is the raw bytes of the key.
228
+
The default data format for import and export of the key is the raw bytes of the key.
229
229
230
230
.. subsection:: Key derivation
231
231
@@ -250,7 +250,7 @@ Symmetric keys
250
250
251
251
.. subsection:: Key format
252
252
253
-
The data format for import and export of the key is the raw bytes of the key.
253
+
The default data format for import and export of the key is the raw bytes of the key.
254
254
255
255
.. subsection:: Key derivation
256
256
@@ -275,7 +275,7 @@ Symmetric keys
275
275
276
276
.. subsection:: Key format
277
277
278
-
The data format for import and export of the key is the raw bytes of the key.
278
+
The default data format for import and export of the key is the raw bytes of the key.
279
279
280
280
.. subsection:: Key derivation
281
281
@@ -320,7 +320,7 @@ Symmetric keys
320
320
321
321
.. subsection:: Key format
322
322
323
-
The data format for import and export of the key is the raw bytes of the key.
323
+
The default data format for import and export of the key is the raw bytes of the key.
324
324
325
325
.. subsection:: Key derivation
326
326
@@ -365,7 +365,7 @@ Symmetric keys
365
365
366
366
.. subsection:: Key format
367
367
368
-
The data format for import and export of the key is the raw bytes of the key.
368
+
The default data format for import and export of the key is the raw bytes of the key.
369
369
370
370
.. subsection:: Key derivation
371
371
@@ -406,7 +406,7 @@ Symmetric keys
406
406
407
407
.. subsection:: Key format
408
408
409
-
The data format for import and export of the key is the raw bytes of the key.
409
+
The default data format for import and export of the key is the raw bytes of the key.
410
410
The parity bits in each 64-bit DES key element must be correct.
411
411
412
412
.. subsection:: Key derivation
@@ -459,7 +459,7 @@ Symmetric keys
459
459
460
460
.. subsection:: Key format
461
461
462
-
The data format for import and export of the key is the raw bytes of the key.
462
+
The default data format for import and export of the key is the raw bytes of the key.
463
463
464
464
.. subsection:: Key derivation
465
465
@@ -496,7 +496,7 @@ Symmetric keys
496
496
497
497
.. subsection:: Key format
498
498
499
-
The data format for import and export of the key is the raw bytes of the key.
499
+
The default data format for import and export of the key is the raw bytes of the key.
500
500
501
501
.. subsection:: Key derivation
502
502
@@ -523,7 +523,7 @@ Symmetric keys
523
523
524
524
.. subsection:: Key format
525
525
526
-
The data format for import and export of the key is the raw bytes of the key.
526
+
The default data format for import and export of the key is the raw bytes of the key.
527
527
528
528
.. subsection:: Key derivation
529
529
@@ -550,7 +550,7 @@ Symmetric keys
550
550
551
551
.. subsection:: Key format
552
552
553
-
The data format for import and export of the key is the raw bytes of the key.
553
+
The default data format for import and export of the key is the raw bytes of the key.
554
554
555
555
.. subsection:: Key derivation
556
556
@@ -577,7 +577,7 @@ Symmetric keys
577
577
578
578
.. subsection:: Key format
579
579
580
-
The data format for import and export of the key is the raw bytes of the key.
580
+
The default data format for import and export of the key is the raw bytes of the key.
581
581
582
582
.. subsection:: Key derivation
583
583
@@ -621,7 +621,7 @@ RSA keys
621
621
622
622
.. subsection:: Key format
623
623
624
-
The data format for import and export of a key-pair is the non-encrypted :term:`DER` encoding of the representation defined by in :RFC-title:`8017#A.1.2` as ``RSAPrivateKey``, version ``0``.
624
+
The default data format for import and export of a key-pair is the non-encrypted :term:`DER` encoding of the representation defined by in :RFC-title:`8017#A.1.2` as ``RSAPrivateKey``, version ``0``.
625
625
626
626
.. code-block:: none
627
627
@@ -643,6 +643,9 @@ RSA keys
643
643
644
644
See `PSA_KEY_TYPE_RSA_PUBLIC_KEY` for the data format used when exporting the public key with `psa_export_public_key()`.
645
645
646
+
RSA key-pairs can also be imported from and exported using the `PSA_KEY_FORMAT_RSA_PRIVATE_KEY` and `PSA_KEY_FORMAT_ONE_ASYMMETRIC_KEY` key formats.
647
+
See :secref:`key-formats`.
648
+
646
649
.. subsection:: Key derivation
647
650
648
651
The method used by `psa_key_derivation_output_key()` to derive an RSA key-pair is :term:`implementation defined`.
@@ -669,14 +672,17 @@ RSA keys
669
672
670
673
.. subsection:: Key format
671
674
672
-
The data format for import and export of a public key is the :term:`DER` encoding of the representation defined by :RFC-title:`8017#A.1.1` as ``RSAPublicKey``.
675
+
The default data format for import and export of a public key is the :term:`DER` encoding of the representation defined by :RFC-title:`8017#A.1.1` as ``RSAPublicKey``.
673
676
674
677
.. code-block:: none
675
678
676
679
RSAPublicKey ::= SEQUENCE {
677
680
modulus INTEGER, -- n
678
681
publicExponent INTEGER } -- e
679
682
683
+
RSA public keys can also be imported from and exported using the `PSA_KEY_FORMAT_RSA_PUBLIC_KEY` and `PSA_KEY_FORMAT_SUBJECT_PUBLIC_KEY_INFO` key formats.
684
+
See :secref:`key-formats`.
685
+
680
686
.. macro:: PSA_KEY_TYPE_IS_RSA
681
687
:definition: /* specification-defined value */
682
688
@@ -795,7 +801,7 @@ The curve type affects the key format, the key derivation procedure, and the alg
795
801
796
802
.. subsection:: Key format
797
803
798
-
The data format for import and export of the key-pair depends on the type of elliptic curve.
804
+
The default data format for import and export of the key-pair depends on the type of elliptic curve.
799
805
:numref:`tab-ecc-key-pair-format` shows the format for each type of elliptic curve key-pair.
800
806
801
807
See `PSA_KEY_TYPE_ECC_PUBLIC_KEY` for the data format used when exporting the public key with `psa_export_public_key()`.
@@ -825,6 +831,9 @@ The curve type affects the key format, the key derivation procedure, and the alg
825
831
826
832
This is a 32-byte string for Edwards25519, and a 57-byte string for Edwards448.
827
833
834
+
Elliptic curve key-pairs can also be imported from and exported using the `PSA_KEY_FORMAT_EC_PRIVATE_KEY` and `PSA_KEY_FORMAT_ONE_ASYMMETRIC_KEY` key formats.
835
+
See :secref:`key-formats`.
836
+
828
837
.. subsection:: Key derivation
829
838
830
839
The key derivation method used when calling `psa_key_derivation_output_key()` depends on the type of elliptic curve.
@@ -913,7 +922,7 @@ The curve type affects the key format, the key derivation procedure, and the alg
913
922
914
923
.. subsection:: Key format
915
924
916
-
The data format for import and export of the public key depends on the type of elliptic curve.
925
+
The default data format for import and export of the public key depends on the type of elliptic curve.
917
926
:numref:`tab-ecc-public-key-format` shows the format for each type of elliptic curve public key.
918
927
919
928
.. list-table:: Public key formats for elliptic curve keys
@@ -944,6 +953,9 @@ The curve type affects the key format, the key derivation procedure, and the alg
944
953
945
954
This is a 32-byte string for Edwards25519, and a 57-byte string for Edwards448.
946
955
956
+
Elliptic curve public keys can also be imported from and exported using the `PSA_KEY_FORMAT_SUBJECT_PUBLIC_KEY_INFO` key format.
957
+
See :secref:`key-formats`.
958
+
947
959
.. macro:: PSA_ECC_FAMILY_SECP_K1
948
960
:definition: ((psa_ecc_family_t) 0x17)
949
961
@@ -1180,7 +1192,7 @@ Diffie Hellman keys
1180
1192
1181
1193
.. subsection:: Key format
1182
1194
1183
-
The data format for import and export of the key-pair is the representation of the private key :math:`x` as a big-endian byte string.
1195
+
The default data format for import and export of the key-pair is the representation of the private key :math:`x` as a big-endian byte string.
1184
1196
The length of the byte string is the private key size in bytes, and leading zeroes are not stripped.
1185
1197
1186
1198
See `PSA_KEY_TYPE_DH_PUBLIC_KEY` for the data format used when exporting the public key with `psa_export_public_key()`.
@@ -1215,7 +1227,7 @@ Diffie Hellman keys
1215
1227
1216
1228
.. subsection:: Key format
1217
1229
1218
-
The data format for export of the public key is the representation of the public key :math:`y = g^x\!\mod p` as a big-endian byte string.
1230
+
The default data format for export of the public key is the representation of the public key :math:`y = g^x\!\mod p` as a big-endian byte string.
1219
1231
The length of the byte string is the length of the base prime :math:`p` in bytes.
1220
1232
1221
1233
.. macro:: PSA_DH_FAMILY_RFC7919
@@ -1337,7 +1349,7 @@ SPAKE2+ keys
1337
1349
A SPAKE2+ key-pair consists of the two values :math:`w0` and :math:`w1`, which result from the SPAKE2+ registration phase, see :secref:`spake2p-registration`.
1338
1350
:math:`w0` and :math:`w1` are scalars in the same range as an elliptic curve private key from the group used as the SPAKE2+ primitive group.
1339
1351
1340
-
The data format for import and export of the key-pair is the concatenation of the formatted values for :math:`w0` and :math:`w1`, using the standard formats for elliptic curve keys used by the |API|.
1352
+
The default data format for import and export of the key-pair is the concatenation of the formatted values for :math:`w0` and :math:`w1`, using the default formats for elliptic curve keys used by the |API|.
1341
1353
For example, for SPAKE2+ over P-256 (secp256r1), the output from :code:`psa_export_key()` would be the concatenation of:
1342
1354
1343
1355
* The P-256 private key :math:`w0`.
@@ -1396,7 +1408,7 @@ SPAKE2+ keys
1396
1408
:math:`w0` is a scalar in the same range as a elliptic curve private key from the group used as the SPAKE2+ primitive group.
1397
1409
:math:`L` is a point on the curve, similar to a public key from the same group, corresponding to the :math:`w1` value in the key pair.
1398
1410
1399
-
The data format for import and export of the public key is the concatenation of the formatted values for :math:`w0` and :math:`L`, using the standard formats for elliptic curve keys used by the |API|.
1411
+
The default data format for import and export of the public key is the concatenation of the formatted values for :math:`w0` and :math:`L`, using the default formats for elliptic curve keys used by the |API|.
1400
1412
For example, for SPAKE2+ over P-256 (secp256r1), the output from :code:`psa_export_public_key()` would be the concatenation of:
0 commit comments