Key type vectors
The values of the keys that are calculated while diversification depend on their intended key usage. Therefore, a DK key type vector (KTV) is being introduced to define how to generate or derive (Diversify Directed Key) the intended AES variable-length symmetric key. The KTV is a parameter that defines the rules for the key to be generated or derived. It also contains information that is needed by the HSM to restrict the usage of the key to be generated or derived.
| Offset (bytes) | Length (bytes) | Description |
|---|---|---|
| 0 | 2 | Structure version number:
|
| 2 | 2 | Key type of the key to be derived or generated:
|
| 4 | 2 | Underlying algorithm:
|
| 6 | 2 | Length of key in bits to be derived or generated:
|
| 8 | 2 | Key usage restriction 1 of the key to be derived or generated, based on the key type
field (value at offset 2). For MAC key type (value at offset 2 = X'0000'):
For data encryption (cipher) key type (value
at offset 2 = X'0001'):
For PIN encryption key type (value at offset
2 = X'0003'):
For key wrap key type (value at offset 2 =
X'0004'):
For all other key types not listed above:
|
| 10 | 2 | Key usage restriction 2 of the key to be derived or generated, depending on the key
type (offset 2) and key usage restriction 1 (offset 8): For MAC key type and HMAC mode (value at
offset 2 = X'0000' and offset 8 = X'0001'):
Key-wrap key type and VARDRV-D mode (value
at offset 2 = X'0004' and offset 8 = X'0001'):
For all other values at offset 2 and offset
8:
For all other key types and key usage
restriction 1 combinations that are not listed above:
|
| 12 | 3 | Reserved, must be binary zeros. |
| 15 | 1 | Key direction variant indicator. Diversifies the key to be derived or generated depending on the permitted use of direction. The HSM has to restrict the usage of the key depending on this value and the type of entity (A or B) which is an additional parameter in the process of deriving or generating the key. Thus this value affects a key usage attribute of the key to be
derived or generated. All other values are reserved and undefined.
|
|
Note:
|
||
For each of the four key types that are defined at KTV offset 2 (MAC, data encryption, PIN encryption, and key wrapping), two KTVs are defined. The only difference between them is the key direction variant indicator (KTV offset 15). Either entity Type A is active and Type B is passive (A→B), or Type B is active and Type A is passive (A←B).
| Key type of key to be derived | A→B (A active) | A←B (B active) | ||
|---|---|---|---|---|
| MAC (generate/verify) | KTVM1 | See Table 3. | KTVM2 | See Table 4. |
| Data encryption (encipher/decipher) | KTVC1 | See Table 5. | KTVC2 | See Table 6. |
| PIN encryption (encipher/decipher) | KTVP1 | See Table 9. | KTVP2 | See Table 10. |
| Key wrapping (wrap/unwrap) | KTVW1 | See Table 11. | KTVW2 | See Table 12. |
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | MAC | AES | AES-256 | CMAC | 'else' | - | A→B |
| 00 00 | 00 00 | 00 02 | 01 00 | 00 01 | 00 00 | 00 00 00 | 01 |
| KTVM1 = X'00 00 00 00 00 02 01 00 00 01 00 00 00 00 00 01' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | MAC | AES | AES-256 | CMAC | 'else' | - | A←B |
| 00 00 | 00 00 | 00 02 | 01 00 | 00 01 | 00 00 | 00 00 00 | 10 |
| KTVM2 = X'00 00 00 00 00 02 01 00 00 01 00 00 00 00 00 10' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | Cipher | AES | AES-256 | CBC | 'else' | - | A→B |
| 00 00 | 00 01 | 00 02 | 01 00 | 00 02 | 00 00 | 00 00 00 | 01 |
| KTVC1 = X'00 00 00 01 00 02 01 00 00 02 00 00 00 00 00 01' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | Cipher | AES | AES-256 | CBC | 'else' | - | A←B |
| 00 00 | 00 01 | 00 02 | 01 00 | 00 02 | 00 00 | 00 00 00 | 10 |
| KTVC2 = X'00 00 00 01 00 02 01 00 00 02 00 00 00 00 00 10' | |||||||
For PIN encryption key type, the key usage indicator 1 (offset 8) for ISO-4 format can have the value of '0000' or '0002' for a pair of KTVs. The caller is not allowed to mix pairs of KTVs because the KTV is used as the IV in the key creating process. This is the responsibility of the caller of the service.
KTV pair for PIN encryption key type with key usage indicator 1 with '0000' value.
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | PIN-Enc | AES | AES-256 | ISO-4 | 'else' | - | A→B |
| 00 00 | 00 03 | 00 02 | 01 00 | 00 00 | 00 00 | 00 00 00 | 01 |
| KTVP1 = X'X'00 00 00 03 00 02 01 00 00 00 00 00 00 00 00 01'' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | PIN-Enc | AES | AES-256 | ISO-4 | 'else' | - | A←B |
| 00 00 | 00 03 | 00 02 | 01 00 | 00 00 | 00 00 | 00 00 00 | 10 |
| KTVP2 = X'00 00 00 03 00 02 01 00 00 00 00 00 00 00 00 10' | |||||||
KTV pair for PIN encryption key type with key usage indicator 1 with '0002' value.
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | PIN-Enc | AES | AES-256 | ISO-4 | 'else' | - | A→B |
| 00 00 | 00 03 | 00 02 | 01 00 | 00 02 | 00 00 | 00 00 00 | 01 |
| KTVP3 = X'00 00 00 03 00 02 01 00 00 02 00 00 00 00 00 01' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | PIN-Enc | AES | AES-256 | ISO-4 | 'else' | - | A←B |
| 00 00 | 00 03 | 00 02 | 01 00 | 00 02 | 00 00 | 00 00 00 | 10 |
| KTVP4 = X'00 00 00 03 00 02 01 00 00 02 00 00 00 00 00 10' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | Key wrap | AES | AES-256 | VARDRV-D | Maximum bit length of the protected keys | - | A→B |
| 00 00 | 00 04 | 00 02 | 01 00 | 00 01 | 01 00 | 00 00 00 | 01 |
| KTVW1 = X'00 00 00 04 00 02 01 00 00 01 01 00 00 00 00 01' | |||||||
| Version (offset 0) | Key type indicator (offset 2) | Algorithm indicator (offset 4) | Key length (offset 6) | Key usage indicator 1 (offset 8) | Key usage restriction 2 (offset 10) | RFU (offset 12) | Key direction variant indicator (offset 15) |
|---|---|---|---|---|---|---|---|
| 0 | Key wrap | AES | AES-256 | VARDRV-D | Maximum bit length of the protected keys | - | A←B |
| 00 00 | 00 04 | 00 02 | 01 00 | 00 01 | 01 00 | 00 00 00 | 10 |
| KTVW2 = X'00 00 00 04 00 02 01 00 00 01 01 00 00 00 00 10' | |||||||
| KTV key type | KTV | KTV key direction variant indicator | Algorithm (offset 4 = X’0002’) | KDKGENKY KUF1 HOB (entity type) | CCA AES key type | KUF1 HOB | KUF2 HOB |
|---|---|---|---|---|---|---|---|
| MAC (offset 2 = X’0000’) | KTVM1 |
A→B |
AES | A | MAC | GENONLY | CMAC |
| KTVM2 | B | MAC | VERIFY | ||||
| KTVM2 |
A←B |
AES | A | MAC | VERIFY | CMAC | |
| KTVM1 | B | MAC | GENONLY | ||||
| Cipher (offset 2 = X’0001’) | KTVC1 |
A→B |
AES | A | CIPHER | ENCRYPT | CBC |
| KTVC2 | B | CIPHER | DECRYPT | ||||
| KTVC2 |
A←B |
AES | A | CIPHER | DECRYPT | CBC | |
| KTVC1 | B | CIPHER | ENCRYPT | ||||
| PIN encryption (offset 2 = X'0003') | KTVP1 |
A→B |
AES | A | PINPROT | ENCRYPT | CBC |
| KTVP2 | B | PINPROT | DECRYPT | ||||
| KTVP2 |
A←B |
AES | A | PINPROT | DECRYPT | CBC | |
| KTVP1 | B | PINPROT | ENCRYPT | ||||
| Key wrapping (offset 2 = X’0004’) | KTVW1 |
A→B |
AES | A | EXPORTER | EXPTT31D | N/A |
| KTVW2 | B | IMPORTER | IMPTT31D | ||||
| KTVW2 |
A←B |
AES | A | IMPORTER | IMPTT31D | N/A | |
| KTVW1 | B | EXPORTER | EXPTT31D |