AESKW key format for external keys
View the structure used to export an ECC or PQC private key when the ECC-AES1 or QSA-AES1 keyword is used with CSNDPKT. This key token is an external-only format and cannot be imported to CCA.
| Offset (decimal) | Number of bytes | Field |
|---|---|---|
| Start of Associated Data section | ||
| Sub-section: Header | ||
| 0 | 1 |
|
| 1 | 1 |
|
| 2 | 2 |
|
| Sub-section: Key data | ||
| 4 | 1 | Algorithm type (algorithm for which the key can be used):
|
| 5 | 2 | Key type (general class of the key): Values in this field depend on the input token and the value at offset '0x4': Algorithm type. 1. ECC private key source token: Encoding:
Values :
2. PQC private key token: Encoding:
Values :
|
| 7 | 1 |
kuf_count: Key usage fields count: 0 - 4. Key-usage field information defines restrictions on
the use of the key.
QSA ML-DSA, CRYSTALS-Dilithium: kuf count = 2. QSA ML-KEM, CRYSTALS-Kyber: kuf count = 2. Notes:
Examples:
|
| 8 | 1 | Bit value meanings: Algorithm at offset 4; ECC (X’81’), QSA-CRYSTALS-Dilithium Round 2 (X'82'), CRYSTALS-Kyber Round 2 (X'83'), CRYSTALS-Dilithium Round 3 (X'84'), CRYSTALS-Kyber Round 3 (X'85'), ML-DSA (X'86'), pure ML-KEM (X'87'), pre-hash ML-DSA (X'88')
|
| 9 | 1 | Bit value meanings: Algorithm at offset 4; ECC (X’81’), QSA-CRYSTALS-Dilithium Round 2 (X'82'), CRYSTALS-Kyber Round 2 (X'83'), CRYSTALS-Dilithium Round 3 (X'84'), CRYSTALS-Kyber Round 3 (X'85'), ML-DSA (X'86'), pure ML-KEM (X'87'), pre-hash ML-DSA (X'88')
|
| 10 | 1 | This field is reserved and must be X'00' byte. |
| 11 | 1 | This field is reserved and must be X'00' byte. |
| 12 | 1 | This field is reserved and must be X'00' byte. |
| 13 | 1 | This field is reserved and must be X'00' byte. |
| 14 | 1 | This field is reserved and must be X'00' byte. |
| 15 | 1 | This field is reserved and must be X'00' byte. |
| End of Associated Data section | ||
| Start of AESKW wrapped payload | ||
| 16 | 6 |
|
| 22 | 1 |
|
| 23 | 1 |
|
| 24 | 16 | Copy of Associated Data. The Associated Data is copied here after decryption. It must exactly match clear data as shown in the above Associated Data section of the AESKW key format structure. |
| 40 | KL | Keydata. Note: The size of the private key p across all components is determined by
the key algorithm at offset 0x04 and the type field at offset 0x05.
Format of keydata
|
| 40 (cont'd) | KL (cont'd) |
|
| KL+40 | PbL / 8 | Padding data: PbL count of 0b0 bits. |
| End of AESKW wrapped payload | ||
| KL+40+(PbL/8) | Final size (FS) = structLen
ECC: Actual KL values, Pbl values: 521 bit P521 : KL = 66 Bytes; PbL = 48 bits; FS = 112 bytes. This is the maximum for the largest exportable ECC key size. QSA CRYSTALS-Dilithium Round 2 (X’82’), Type (X'0605') KL = 3824; PbL = 0; FS = 3864 Bytes QSA CRYSTALS-Dilithium Round 2 (X'82'), Type (X'0807') KL = 5104; PbL = 0; FS = 5144 Bytes QSA CRYSTALS-Kyber Round 2 (X'83'), Type (X'0768') KL = 1216; PbL = 0; FS = 1256 Bytes QSA CRYSTALS-Kyber Round 2 (X'83'), Type (X'1024') KL = 1600; PbL = 0; FS = 1640 Bytes QSA CRYSTALS-Dilithium Round 3 (X'84'), Type (X'0605') KL = 3968; PbL = 0; FS = 4008 Bytes QSA CRYSTALS-Dilithium Round 3 (X'84'), Type (X'0807') KL = 4832; PbL = 0; FS = 4872 Bytes QSA CRYSTALS-Kyber Round 3 (X'85'), Type (X'0768') KL = 1216; PbL = 0; FS = 1265 Bytes QSA CRYSTALS-Kyber Round 3 (X'85'), Type (X'1024') KL = 1600; PbL = 0; FS = 1640 Bytes QSA pure and pre-hash ML-DSA (X'86'/X'88'), Type (X'0404') KL = 2528; PbL = 0; FS = 2568 Bytes QSA pure and pre-hash ML-DSA (X'86'/X'88'), Type (X'0605') KL = 4000; PbL = 0; FS = 4040 Bytes QSA pure and pre-hash ML-DSA (X'86'/X'88'), Type (X'0807') KL = 4864; PbL = 0; FS = 4904 Bytes QSA ML-KEM (X'87'), Type (X'0768') KL = 1216; PbL = 0; FS = 1256 Bytes QSA ML-KEM (X'87'), Type (X'1024') KL = 1600; PbL = 0; FS = 1640 Bytes |
|