ECC key token
The format of ECC public and private key tokens.
| Size of prime p in bits (key length) | OID in dot notation | Brainpool elliptic curve ID |
|---|---|---|
| 160 | 1.3.36.3.3.2.8.1.1.1 | brainpoolP160r1 |
| 192 | 1.3.36.3.3.2.8.1.1.3 | brainpoolP192r1 |
| 224 | 1.3.36.3.3.2.8.1.1.5 | brainpoolP224r1 |
| 256 | 1.3.36.3.3.2.8.1.1.7 | brainpoolP256r1 |
| 320 | 1.3.36.3.3.2.8.1.1.9 | brainpoolP320r1 |
| 384 | 1.3.36.3.3.2.8.1.1.11 | brainpoolP384r1 |
| 512 | 1.3.36.3.3.2.8.1.1.13 | brainpoolP512r1 |
| Size of prime p in bits (key length) | OID in dot notation | ANSI X9.62 ECDSA prime curve ID | NIST-recommended elliptic curve ID | SEC 2 recommended elliptic curve domain parameter |
|---|---|---|---|---|
| 192 | 1.2.840.10045.3.1.1 | prime192v1 | P-192 | secp192r1 |
| 224 | 1.3.132.0.33 | N/A | P-224 | secp224r1 |
| 256 | 1.2.840.10045.3.1.7 | prime256v1 | P-256 | secp256r1 |
| 384 | 1.3.132.0.34 | N/A | P-384 | secp384r1 |
| 521 | 1.3.132.0.35 | N/A | P-521 | secp521r1 |
| Size of prime p in bits (key length) | OID in dot notation | Edwards-coordinate signature system | Elliptic curve |
|---|---|---|---|
| 255 | 1.3.101.112 | id-Ed25519 | Curve25519 |
| 448 | 1.3.101.113 | id-Ed448 | Curve448 |
| Size of prime p in bits (key length) | OID in dot notation | ANS X9.62 curve name | Elliptic curve |
|---|---|---|---|
| 256 | 1.3.132.0.10 | Koblitz curve over 256-bit Prime field | secp256k1 |
| Offset (bytes) | Length (bytes) | Description |
|---|---|---|
| 000 | 001 | Section identifier:
|
| 001 | 001 | Section version number:
|
| 002 | 002 | Length of section in bytes: 76 + asd + bb. |
| 004 | 001 | Wrapping method:
|
| 005 | 001 | Algorithm used to hash associated data section:
Note: The message digest is calculated on the associated data section, offset 76 to offset 92
+ kl + lead + uad. The message digest becomes part of the payload prior to its
encryption.
|
| 006 | 002 | Reserved, binary zero. |
| 008 | 001 | Key-usage and translation control flag. Management of symmetric keys and generation of digital signatures:
Note: secp256k1 curves are usable for ECDSA (signature) or ECDH (key agreement/key
management).
Translation control:
Note: secp256k1 curves are NOT exportable to CPACF.
Key management:
All other bits are reserved and must be zero. |
| 009 | 001 | Curve type:
|
| 010 | 001 | Key format and security flag:
|
| 011 | 001 |
Section version X'00' (see offset 001):
Reserved, binary zero Section version X'01' (see offset 001): Pedigree/Key source flag byte External key-token:
Internal key-token:
|
| 012 | 002 | Length of prime p in bits. See Table 2 and Table 1.
|
| 014 | 002 | Length in bytes of IBM® associated data, 0 or iadl = 16 + pknl + ieadl. |
| 016 | 008 | Key verification pattern. External key-token
Internal key-token
|
| 024 | 048 | Object Protection Key (OPK). External key-token: Reserved, binary zero. Internal key token: OPK data consists of an 8-byte integrity check value (ICV) and length indicators, an 8-byte confounder, and a 256-bit AES key used with the AESKW algorithm to encrypt the ECC private key contained in an AESKW formatted section. Note: The OPK is encrypted by the APKA master key
using AESKW (ANS X9.102). The OPK has no associated data. |
| 072 | 002 | Length in bytes of associated data, 0 or asdl = iadl + uadl. |
| 074 | 002 | Length in bytes of formatted section, or bb. |
| Associated data section | ||
| Start of IBM associated data | ||
| 076 | 001 | Associated data section version number. Includes IBM associated data and user-definable associated data.
|
| 077 | 001 | Length in bytes of the key label: kl (0 - 64). |
| 078 | 002 | Length in bytes of the IBM associated data (AD),
including key label and IBM extended associated data.
|
| 080 | 002 | Length in bytes of the IBM extended associated data:
iead.
|
| 082 | 001 | Length in bytes of the user-definable associated data: uad (0 - 100). |
| 083 | 001 | Curve type (see offset 009). |
| 084 | 002 | Length of p in bits (see offset 012). |
| 086 | 001 | Key-usage flag (see offset 008). |
| 087 | 001 | Key format and security flag (see offset 010). |
| 088 | 001 |
|
| 089 | 003 | Reserved, binary zero. |
| 092 | kl | Optional key label. Private key name (in ASCII), left-justified, padded with space characters (X'20'). |
| 092 + kl | iead | Optional IBM extended
associated data. For AD section version number X'01' (see offset 076): Consists of a single
section hash tag-length-value (TLV) object with TLV tag identifier X'60'. Refer to Table 6. Note: A section hash TLV object cannot be
present in section version number X'00', and will always be present in section version number of
X'01'. When present, it contains the SHA-256 hash digest of all the optional sections that follow
the public key section, if any. Otherwise, it contains binary zeros.
|
| End of IBM associated data | ||
| 092 + kl + iead | uad | Optional user-definable associated data. |
| End of associated data section | ||
| 092 + kl + iead + uad | bb | Formatted section (payload), which includes private key d:
|
| Offset (bytes) | Length (bytes) | Description |
|---|---|---|
| 000 | 001 | Tag identifier:
|
| 001 | 001 | TLV object version number (X'00'). |
| 002 | 002 | TLV object length in bytes (X'0024'). |
| 004 | 032 | SHA-256 hash of all the optional sections that follow the public-key section, if any.
Otherwise binary zeros. Note: A section hash TLV object will always be present in a PKA key token
that has an ECC private key section (X'20') with a section version number of X'01'.
|
| Offset (bytes) | Length (bytes) | Description |
|---|---|---|
| 000 | 001 | Section identifier:
|
| 001 | 001 | Section version number (X'00'). |
| 002 | 002 | Section length in bytes. |
| 004 | 004 | Reserved, binary zero. |
| 008 | 001 | Curve type:
|
| 009 | 001 | Reserved, binary zero |
| 010 | 002 | Length of prime p in bits. See Table 2 and Table 1.
|
| 012 | 002 | Length of public key q in bytes. Value includes key material length
plus a one-byte flag to indicate if the key material is compressed. For Prime and Brainpool curves, the value includes the key material length plus a one byte flag to indicate if the key material is compressed or uncompressed. For Edwards curves, the value is in little endian format. |
| 014 | cc | Public key q. |
| Offset (bytes) | Length (bytes) | Description | |
|---|---|---|---|
| 000 | 001 | Section identifier:
|
|
| 001 | 001 | Section version number (X'00') | |
| 002 | 002 | Section length in bytes (8) | |
| 004 | 001 | Algorithm of key to be derived:
|
|
| 005 | 001 | Type of CCA key to be derived:
|
Type of TR-31 key to be derived:
|
| 006 | 002 | Key-bit length:
Note: Bit length of DES keys includes parity bits.
|
|