The following table presents the presents the format for a variable-length symmetric key token. The length of the token depends on the key type and algorithm.
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
Header | ||
0 | 1 | Token flag
|
1 | 1 | Reserved (X'00') |
2 | 2 | Length of the token in bytes |
4 | 1 | Token version number X'05' (May be X'00' for null tokens) |
5 | 3 | Reserved (X'000000') |
Wrapping information | ||
8 | 1 | Key material state.
|
9 | 1 | Key verification pattern
(KVP) type.
|
10 | 16 | Verification pattern of the key used to wrap the payload. Value is left justified. |
26 | 1 | Wrapping method -
This value indicates the wrapping method used to protect the data
in the encrypted section.
|
27 | 1 | Hash algorithm used in wrapping algorithm.
|
28 | 1 | Payload version
|
29 | 1 | Reserved (X'00') |
Associated data section | ||
30 | 1 | Associated data version (X'01') |
31 | 1 | Reserved (X'00') |
32 | 2 | Length of the associated data in bytes: adl |
34 | 1 | Length of the key name in bytes: kl |
35 | 1 | Length of the IBM extended associated data in bytes: iead |
36 | 1 | Length of the installation-definable associated data in bytes: uad |
37 | 1 | Reserved (X'00') |
38 | 2 | Length of the payload in bits: pl |
40 | 1 | Reserved (X'00') |
41 | 1 | Type of algorithm for which the key can be used
|
42 | 2 | Key type: For algorithm AES:
For algorithm HMAC:
For algorithm DES:
|
44 | 1 | Key-usage field count (kuf) - (1 byte) |
45 | kuf * 2 | Key-usage fields (kuf * 2 bytes)
|
45 + kuf * 2 | 1 | Key-management field count (kmf) - (2
byte):
|
46 + kuf * 2 | kuf * 2 | Key-management fields (kmf * 2 bytes): |
46 + kuf * 2 + kmf * 2 | kl | Key name |
46 + kuf * 2 + kmf * 2 + kl | iead | IBM extended associated data |
46 + kuf * 2 + kmf * 2 + kl + iead | uad | Installation-defined associated data |
Clear key or encrypted payload | ||
30 + adl | (pl+7)/8 | Encrypted AESKW payload (internal keys): The encrypted AESKW payload is created from the unencrypted AESKW payload which is made up of the ICV/pad length/hash options and hash length/hash options/hash of the associated data/key material/padding. See unencrypted AESKW payload below. Encrypted PKOAEP2 payload (external keys): The encrypted PKOAEP2 payload is created using the PKCS #1 v1.2 encoding method for a given hash algorithm. The message (M) inside the encoding contains: [2 bytes: bit length of key] || [clear HMAC key]. M is encoded using OAEP and then encrypted with an RSA public key according to the standard. Clear key payload: When the key is clear, only the key material will be in the payload padded to the nearest byte with binary zeros. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 1 |
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order
byte:
All unused bits are reserved and must be zero. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 2 |
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused bits are reserved and must be zero. Low-order byte: All bits are reserved and must be zero. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 2 – 3
|
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order
byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused bits are reserved and must be zero. Low-order byte: All bits are reserved and must be zero. |
49 | 2 | Key-usage field 3 High-order byte when DK
enabled:
All unused values are reserved and must not be used. Low-order byte:
All unused values are reserved and must not be used. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 3 |
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order
byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused values are reserved and must not be used. Low-order byte: All bits are reserved and must be zero. |
49 | 2 | Key-usage field 3 High-order byte when DK
enabled:
All unused values are reserved and must not be used. Low-order byte:
All unused values are reserved and must not be used. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 3 |
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order
byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused values are reserved and must not be used. Low-order byte: All bits are reserved and must be zero. |
49 | 2 | Key-usage field 3 High-order byte when DK
enabled:
All unused values are reserved and must not be used. Low-order byte:
All unused values are reserved and must not be used. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 3 |
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order
byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused values are reserved and must not be used. Low-order byte: All bits are reserved and must be zero. |
49 | 2 | Key-usage field 3 High-order byte when DK
enabled:
All unused values are reserved and must not be used. Low-order byte:
All unused values are reserved and must not be used. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 2, 4, 5, or 6 |
45 | 2 | Key-usage field 1 High-order byte: Defines
the key type to be generated.
All other values are reserved and undefined. Low-order
byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2: Indicates the key usage. High-order
byte (key-usage field level of control):
Undefined when the value at offset 45 = X'00' (D-ALL). All other values are reserved and undefined. Low-order
byte (key-derivation sequence level):
All other values are reserved and undefined. |
49 (if defined) | 2 | Key-usage field 3 (related generated key usage
fields): These values determine allowable key usage of key to be generated. Meaning depends on value of offset 45:
|
51 (if defined) | 2 | Key-usage field 4 (related generated key usage
fields): These values determine allowable key usage of key to be generated. Meaning depends on value of offset 45:
|
53 (if defined) | 2 | Key-usage field 5 (related generated key usage
fields): These values determine allowable key usage of key to be generated. Meaning depends on value of offset 45:
|
55 (if defined) | 2 | Key-usage field 6 (related generated key usage
fields): These values determine allowable key usage of key to be generated. Meaning depends on value of offset 45:
|
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 4 |
45 | 2 | Key-usage field 1 High-order byte for EXPORTER:
All unused bits are reserved and must be zero. High-order byte for IMPORTER:
All unused bits are reserved and must be zero. Low-order byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused bits are reserved and must be zero. Low-order
byte:
All unused bits are reserved and must be zero |
49 | 2 | Key-usage field 3 High-order byte:
All unused bits are reserved and must be zero. Low-order byte: All bits are reserved and must be zero. |
51 | 2 | Key-usage field 4 High-order byte:
Low-order byte: All bits are reserved and must be zero. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
44 | 1 | Key-usage field count (kuf): 2 |
45 | 2 | Key-usage field 1 High-order byte:
All unused bits are reserved and must be zero. Low-order byte:
All unused bits are reserved and must be zero. |
47 | 2 | Key-usage field 2 High-order byte:
All unused values are reserved and must not be used. Low-order byte: All bits are reserved and must be zero. |
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
48 | 2 | Key-management field 1 High-order byte:
Low-order byte: --symmetric--
|
48 + kuf * 2 | 2 | Key-management field 2 High-order byte:
Low-order
byte (Security History):
|
50 + kuf * 2 | 2 | Key-management field 3 - Pedigree (this field
may or may not be present) Indicates how key was originally created and how it got into the current system. High-order byte: Pedigree
Original
|
50 + kuf * 2 (cont’d) | 2 (cont’d) |
|
Offset (Dec) | Length of Field (Bytes) | Description |
---|---|---|
47 | 1 | Key-management field count (kmf): 1 |
48 | 2 | Key-management field 1 High-order byte:
Low-order
byte:
|