Parameters

The parameter definitions for CSNBT31I.

For the definitions of the return_code, reason_code, exit_data_length, and exit_data parameters, see Parameters common to all verbs.

rule_array_count
Direction: Input
Type: Integer
A pointer to an integer variable containing the number of elements in the rule_array variable. The value must be 1, 2, 3, or 4.
rule_array
Direction: Input
Type: String array
A pointer to a string variable containing an array of keywords. The keywords are 8 bytes in length and must be left-aligned and padded on the right with space characters. The rule_array keywords are shown in #l0wskc310__csnbt31i_keywords:

Keywords for the TR31 Key Import verb

Keyword Meaning
Token identifier (one required)
INTERNAL Specifies to return the output key in an internal CCA key-token.
EXTERNAL Specifies to return the output key in an external CCA key-token, wrapped by the transport key identified by the wrap_kek_identifier parameter.
Wrap KEK key algorithm (one, optional). Only valid for EXTERNAL.
WKEY-AES Specifies that the wrap_kek_identifier parameter identifies an operational variable-length AES key-token, or the label of such a record in AES key-storage. Only valid when the key block identified by the tr31_key_block parameter contains an AES or DES key protected by the Key Derivation Binding Method 2017 Edition (that is, the key block version ID in byte 0 of the header is ASCII "D").
WKEY-DES Specifies that the wrap_kek_identifier parameter identifies an operational fixed-length DES key-token, or the label of such a record in DES key-storage. Only valid when the key block identified by the tr31_key_block parameter contains a DES key protected by the Key Variant Binding Method 2005 Edition, Key Derivation Binding Method 2010 Edition, or Variant Binding Method 2010 Edition (that is, the key block version ID in byte 0 of the header is ASCII "A", "B", or "C"). This is the default for keyword EXTERNAL.
CCA output key usage subgroups (One from one subgroup required based on TR-31 input key usage. Keywords for the subgroup are valid only for given TR-31 key usage.)
Note: None of the following keywords are allowed if the TR-31 key block provided as input has an optional block that contains a CCA control vector. See Table 1. If the TR-31 key block header contains an optional block with a control vector in it, the control vector is used in place of keywords to produce the output CCA key-token. If the key usage and mode of use fields of the key block are not IBM-defined (see Table 1), the control vector must not conflict with any TR-31 header fields.
CV subtype extension for "C0" key usage (one required). Only valid for TR-31 key block with key usage "C0" and no control vector in the optional block.
CVK-CVV Convert a TR-31 card verification key (CVK) to a double-length CCA DES MAC key that has a subtype extension of CVVKEY-A. This restricts the key to generating or verifying a Visa CVV or MasterCard CVC.
CVK-CSC Convert a TR-31 CVK to a CCA DES MAC key that has a subtype extension of AMEX-CSC. This restricts the key to generating or verifying an American Express® card security code, also known as a card identification number (CID).
Key type of the key-encrypting key selection for key usage "K0", "K1", or "K4" and algorithm "T", or for key usage "K0" or "K1", mode of use "B" and algorithm "A" (one, optional, if the key block contains a control vector, otherwise one required for “T”. One required for key usage "K0" or "K1", mode of use "B" and algorithm "A"). Not allowed with any other key usage. If the key block contains a control vector (as defined in TR-31 optional block data), the output key-token is returned with the same control vector. See Table 4 for additional requirements to import a key block with one of these key usages.
EXPORTER Specifies one of the following:
  • Import a key with an algorithm “T” (byte 7), mode of use "E" (byte 8), and key usage of "K0" - key encryption or wrapping key, "K1" – TR-31 key block protection key, or "K4" – ISO 20038 key block protection key (bytes 5 – 6) to a CCA TDES default EXPORTER key.
  • Import a key with an algorithm “A” (byte 7), mode of use "B" (byte 8), and key usage of "K0" - key encryption or wrapping key or "K1" - TR-31 key block protection key (bytes 5 - 6) to a CCA AES default EXPORTER key.
OKEYXLAT Specifies to import a key with an algorithm “T” (byte 7), mode of use "E" (byte 8), and key usage of "K0" - key encryption or wrapping key, "K1" – TR-31 key block protection key, or "K4" – ISO 20038 key block protection key (bytes 5 – 6) to a CCA TDES default OKEYXLAT key.
IMPORTER Specifies one of the following:
  • Import a key with an algorithm “T” (byte 7), mode of use "D" (byte 8), and key usage of "K0" - key encryption or wrapping key, "K1" – TR-31 key block protection key, or "K4" – ISO 20038 key block protection key (bytes 5 – 6) to a CCA TDES default IMPORTER key.
  • Import a key with an algorithm “A” (byte 7), mode of use "B" (byte 8), and key usage of "K0" - key encryption or wrapping key, "K1" - TR-31 key block protection key (bytes 5 - 6) to a CCA AES default IMPORTER key.
IKEYXLAT Specifies to import a key with an algorithm “T” (byte 7), mode of use "D" (byte 8), and key usage of "K0" - key encryption or wrapping key, "K1" – TR-31 key block protection key, or "K4" – ISO 20038 key block protection key (bytes 5 – 6) to a CCA TDES default IKEYXLAT key.
Key type of PIN encryption key for key usage "P0" and mode of use "E", "B", or "D" (one required for "B", otherwise one, optional). Allowed for TR-31 algorithm "A" (AES) or "T" (TDEA). Not allowed with any other key usage.
Note: CCA does not support a PIN encryption key that can do both outbound encryption and inbound decryption.
IPINENC Specifies to import a key with mode of use "B" to "D", but not "E", (byte 8), and key usage of "P0" – PIN encryption key (bytes 5 – 6) to a CCA DES IPINENC or AES PINPROT key, depending on the algorithm (byte 7):
  • For algorithm "T" (TDES), import the key as a CCA TDES default IPINENC key.
  • For algorithm "A" (AES), import the key as a CCA AES PINPROT key with key usage of DECRYPT, CBC, PINXLATE, REFORMAT, NOFLDFMT, and ISO-4.
This is the default for mode of use "D".
OPINENC Specifies to import a key with mode of use "B" or "E", but not "D", (byte 8), and key usage of "P0" – PIN encryption key (bytes 5 – 6) to a CCA DES OPINENC or AES PINPROT key, depending on the algorithm (byte 7):
  • For algorithm "T" (TDES), import the key as a CCA TDES default OPINENC key.
  • For algorithm "A" (AES), import the key as a CCA AES PINPROT key with key usage of ENCRYPT, CBC, PINXLATE, REFORMAT, NOFLDFMT, and ISO-4.
This is the default for mode of use "E".
CV key type for "V0", "V1", or "V2" key usage (one required). Only valid for TR-31 key block with key usage "V0", "V1", or "V2" and no control vector in the optional block. When this keyword is specified, an optional CV key type modifier can be specified for key usage "V0" or "V1".
PINGEN Convert a TR-31 PIN verification key to a CCA PINGEN key.
PINVER Convert a TR-31 PIN verification key to a CCA PINVER key.
CV key usage for "E0" or "E2" key usage (one required) Only valid for TR-31 key block with key usage "E0" or "E2" and no control vector in the optional block.
DMAC Convert TR-31 EMV/chip issuer master key: application cryptograms or secure messaging for integrity to CCA DKYGENKY with key usage DMAC.
DMV Convert TR-31 EMV/chip issuer master key: application cryptograms or secure messaging for integrity to CCA DKYGENKY with key usage DMV.
CV key usage for "E1" key usage (one required) Only valid for TR-31 key block with key usage "E1" and no control vector in the optional block.
DMPIN Convert TR-31 EMV/chip issuer master key: secure messaging for confidentiality to CCA DKYGENKY with key usage DMPIN
DDATA Convert TR-31 EMV/chip issuer master key: secure messaging for confidentiality to CCA DKYGENKY with key usage DDATA.
CV key usage for "E5" key usage (one required) Only valid for TR-31 key block with key usage "E5" and no control vector in the optional block.
DMAC Convert TR-31 EMV/chip issuer master key: card personalization to CCA DKYGENKY with key usage DMAC.
DMV Convert TR-31 EMV/chip issuer master key: card personalization to CCA DKYGENKY with key usage DMV.
DEXP Convert TR-31 EMV/chip issuer master key: card personalization to CCA DKYGENKY with key usage DEXP.
CV subtype for "E0", "E1", "E2", "F0", "F1", "F2", "F3", or "F4" key usage (one required). Valid for TR-31 key block with key usage "E0", "E1", or "E2" and no control vector in the optional block. Also valid for key usage "F0", "F1", "F2", "F3", or "F4".
DKYL0 Convert TR-31 EMV/chip issuer master key: application cryptograms, secure message for confidentiality, or secure message for integrity to CCA DKYGENKY with subtype DKYL0.

This keyword is required when importing "F0", "F1", "F2", "F3", or "F4" tokens.

DKYL1 Convert TR-31 EMV/chip issuer master key: application cryptograms, secure message for confidentiality, or secure message for integrity to CCA DKYGENKY with subtype DKYL1.
DKYL2 Specifies to import an EMV/chip issuer master key with key usage (bytes 5 – 6) of "E0" - application programs, "E1" – secure messaging for confidentiality, "E2" – secure message for integrity, "E4" – dynamic numbers, or "E5" – card personalization to an AES DKYGENKY key (byte 7):
  • For algorithm "A", an AES DKYGENKY key with KUF1 HOB = X'02' (DKYL2).
  • For algorithm "T", not valid.
CV key type modifier for "V0" or "V1" key usage (one required). Only valid for TR-31 key block with key usage "V0" or "V1" and no control vector in the optional block.
NOOFFSET Convert a TR-31 PIN verification key to a CCA PINGEN or PINVER key with the key type modifier NOOFFSET, so that the key cannot participate in a PIN offset process or PVV process.
Key-wrapping method (one, optional)
USECONFG This is the default. Specifies to wrap the key using the configuration setting for the default wrapping method. The default wrapping method configuration setting may be changed using the TKE. This keyword is ignored for AES keys.
Note: Do not use this keyword if the default wrapping method is WRAP-ECB and a control vector is present in an optional block of the TR-31 key block with CV bit 56 = B'1' (ENH-ONLY). Use the WRAP-ENH keyword instead.
WRAP-ECB Specifies to wrap the key using the legacy wrapping method.
Note: Do not use this keyword if a control vector is present in an optional block of the TR-31 key block with CV bit 56 = B'1' (ENH-ONLY).
WRAP-ENH Specifies to wrap the key using the enhanced wrapping method.
WRAPENH2 Specifies to wrap the key using the enhanced wrapping method and SHA-256. Valid only for TRIPLE or TRIPLE-O. This method requires CV bit 56 = B’1’ (ENH-ONLY). This is the default for TRIPLE and TRIPLE-O.
WRAPENH3 Specifies to wrap the key using the enhanced wrapping method with TDES-CMAC and the SHA-256 hashing algorithm. This keyword sets CV bit 56 = B’1’ (ENH-ONLY), which is required for the WRAPENH3 wrapping method.
Translation control (optional). This keyword is valid only with key-wrapping method WRAP-ENH or with USECONFG when the default wrapping method is WRAP-ENH. This option cannot be used on a key with a control vector valued to binary zeros.
ENH-ONLY Specifies to restrict the key from being wrapped with the legacy method once it has been wrapped with the enhanced method. Sets CV bit 56 = B'1' (ENH-ONLY).
Note: If a control vector is present in an optional block of the TR-31 key block with CV bit 56 = B'0', this keyword overrides that value in the CCA key-token. This keyword has no effect if the control vector in an optional block is all zeros.
CPACF export (optional).
XPRTCPAC Allow this key token to be exported as a CPACF protected key. This keyword is valid only when the output key token is a DES CIPHER key token.
NOEXCPAC Do not allow this key token to be exported as a CPACF protected key. This is the default.
HMAC hash algorithm limit for key usage M7 and algorithm H (One, optional). Not allowed with any other key usage.

Security note: ISO 20038 and ANSI X9 TR-31-2018 represent the HMAC hash algorithm limit in different ways:

  • ISO 20038 represents hash limit in the algorithm value at offset 7. An HMAC key limited to SHA-1 uses ASCII 'H' and does not contain an HM optional block.
  • ANSI X9 TR-31-2018 always uses 'H' for the algorithm value at offset 7 and represents the hash algorithm limit in the HM optional block.
  • The ISO 'H' algorithm key block has a dual meaning:
    • For an ISO 20038 implementation, the resulting key block is limited to SHA-1 hash MAC.
    • For an ANSI X9 TR-31-2018 implementation, the key does not have any hash algorithm limit because the HM optional block is not present.
HMAC-ISO This keyword specifies to import an HMAC key block according to the ISO 20038. Interpretation is as follows:
  • If the key block contains an HM optional block, it is ignored.
  • Import of a key block with 'H' for the algorithm value at offset 7 will result in the output_key_identifier holding an HMAC key in a Version X'05' variable-length symmetric key-token that allows a hash method of SHA-1 (KUF2 HOB = B'1xxx xxxx').
  • Import of a key block with 'I' for the algorithm value at offset 7 will result in the output_key_identifier holding an HMAC key in a Version X'05' variable-length symmetric key-token that allows all SHA-2 hash methods (KUF2 HOB = B'x111 1xxx' for SHA-224, SHA-256, SHA-384, and SHA-512).
HMAC-X9 This keyword specifies to import an HMAC key block according to the ANSI X9 TR-31-2018. Interpretation is as follows:
  • If the key block does not have 'H' for the algorithm value at offset 7, 8/2121 will be returned. If the key block does not contain an HM optional block, new error 8/2182 will be returned.
  • Import will result in the output_key_identifier holding an HMAC key in a Version X'05' variable-length symmetric key-token that allows the hash method in the KUF2 HOB that matches the specification in the HM optional block.
HMAC-UNK This keyword specifies for the HSM to inspect the key block to determine the appropriate hash algorithm limit for the HMAC key. Interpretation is as follows:
  • Import of a key block with 'H' for the algorithm value at offset 7 and with an optional block with identifier 'HM' will result in the output_key_identifier holding an HMAC key in a Version X'05' variable-length symmetric key-token that allows the hash method in the KUF2 HOB that matches the specification in the HM optional block.
  • Import of a key block with 'H' for the algorithm value at offset 7 and without an HM optional block results in the output_key_identifier holding an HMAC key in a Version X'05' variable-length symmetric key-token that allows hash methods of SHA-1 and SHA-2 (KUF2 HOB = B'1111 1xxx' for SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512).
  • Import of a key block with 'I' for the algorithm value at offset 7 will result in the output_key_identifier holding an HMAC key in a Version X'05' variable-length symmetric key-token that allows all SHA-2 hash methods (KUF2 HOB = B'x111 1xxx' for SHA-224, SHA-256, SHA-384, and SHA-512).

This is the default.

Table 1 shows all valid translations for import of a TR-31 BDK base derivation key (usage "B0") to either a CCA KEYGENKY key, or a CCA DKYGENKY key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are for translating derived unique key per transaction (DUKPT) base derivation keys.
Table 1. Import translation table for a TR-31 derivation key (usage "B0", "B1", "B3")

Import translation table for a TR-31 BDK base derivation key (usage "B0")

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"B0" "A", "B", "C", "D" "N" N/A KEYGENKY, double length, UKPT (CV bit 18 = B'1') N/A N/A
"B", "C", "D" "X" N/A KEYGENKY, double length, UKPT (CV bit 18 = B'1') N/A N/A
"D" "X" N/A DKYGENKY, A-DUKPT KUF set to 1. X'017E' TR31I - Permit B0:X to AES DKYGENKY:DUKPT BDK
"B1" "B", "C", "D" "X" N/A DES KEYGENKY, double length, UKPT (CV bit 18 = B’1’) X'03E8' T31I - Permit B1 to DES KEYGENKY:DUKPT and AES DKYGENKY:DUKPT
"D" "X" N/A AES DKYGENKY, BDK bit (KUF1 low bit, 0x80) must not be set for a B1 token
"B3" "B", "C", "D" "X" N/A DES DKYGENKY X'03E9' T31I - T31I - Permit B3 to DES DKYGENKY and AES KDKGENKY
"D" "X" N/A AES KDKGENKY
Notes:
  1. These keys are the base keys from which derived unique key per transaction (DUKPT) initial keys are derived for individual devices such as PIN pads.
  2. This table defines the only supported translations for this TR-31 usage. Usage must be the following value:
    "B0"
    BDK base derivation key.
    "B1"
    Initial DUKPT key.
    "B3"
    KDK key derivation key.
  3. There are no specific access-control commands for this translation because it is not ambiguous or in need of interpretation.
Table 2 shows all valid translations for import of a TR-31 CVK card verification key (usage "C0") to a CCA MAC or DATA key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are for computing or verifying (against supplied value) a card verification code with the CVV, CVC, CVC2, and CVV2 algorithm.
Table 2. Import translation table for a TR-31 CVK card verification key (usage "C0")

Import translation table for a TR-31 CVK card verification key (usage "C0"). This table contains seven columns: Keyword, TR-31 key usage, CCA key types, and Meaning, and it contains rows for ("C0").

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"C0" "A", "B", or "C" "G" or "C" CVK-CSC MAC, single or double length, AMEX-CSC (CV bits 0 - 3 = B'0100') X'015B' TR31 Import - Permit C0 to MAC/MACVER:AMEXCSC
CVK-CVV MAC, double length, CVVKEY-A (CV bits 0 - 3 = B'0010') X'015A' TR31 Import - Permit C0 to MAC/MACVER:CVVKEY-A
"V" CVK-CSC MACVER, single or double length, AMEX-CSC (CV bits 0 - 3 = B'0100') X'015B' TR31 Import - Permit C0 to MAC/MACVER:AMEXCSC
CVK-CVV MACVER, double length, CVVKEY-A (CV bits 0 - 3 = B'0010') X'015A' TR31 Import - Permit C0 to MAC/MACVER:CVVKEY-A

Security considerations:

  1. There is asymmetry in the translation from a CCA DATA key to a TR-31 key. The asymmetry results from CCA DATA keys having attributes of both data encryption keys and MAC keys, while TR-31 separates data encryption keys from MAC keys. A CCA DATA key can be exported to a TR-31 "C0" key, if one or both applicable MAC generate and MAC verify control vector bits are on. However, a TR-31 "C0" key cannot be imported to the lower-security CCA DATA key, it can be imported only to a CCA key type of MAC or MACVER. This restriction eliminates the ability to export a CCA MAC or MACVER key to a TR-31 key and re-importing it back as a CCA DATA key with the capability to Encipher, Decipher, or both.
  2. The translation from TR-31 usage "C0" is controlled by rule array keywords when using the TR31_Key_Import verb. This makes it possible to convert an exported CCA CVVKEY-A key into an AMEX-CSC key or the other way around. To prevent such a conversion, do not enable offsets X'015A' (TR31 Import - Permit C0 to MAC/MACVER:CVVKEY-A) and X'015B' (TR31 Import - Permit C0 to MAC/MACVER:AMEXCSC) at the same time. However, if both CVVKEY-A and AMEX-CSC translation types are required, then offsets X'015A' and X'015B' must be enabled. In this case, control is up to the development, deployment, and execution of the applications themselves.
Notes:
  1. Card verification keys are used for computing or verifying (against supplied value) a card verification code with the CVV, CVC, CVC2, and CVV2 algorithms. In CCA, these keys correspond to keys used with two algorithms:
    • Visa CVV and MasterCard CVC codes are generated and verified using the CVV Generate and CVV Verify verbs. These verbs require a key type of DATA or MAC/MACVER with a subtype extension (CV bits 0 - 3) of ANY-MAC, single-length CVVKEY-A and single-length CVVKEY-B, and a double-length CVVKEY-A (see CVV Key Combine verb). The MAC generate and the MAC verify (CV bits 20 - 21) key usage values must be set appropriately.
    • American Express CSC codes are generated and verified using the Transaction Validation verb. This verb requires a key type of MAC or MACVER with a subtype extension of ANY-MAC or AMEX-CSC.
  2. The translation from TR-31 usage "C0" to a CCA MAC/MACVER key with a subtype extension of ANY-MAC (CV bits 0 - 3 = B'0000') is not allowed.
  3. This table defines the only supported translations for this TR-31 usage. Usage must be the following value:
    "C0"
    CVK card verification key
  4. CCA does not have an equivalent to the TR-31 "generate only" mode of use, so a translation from TR-31 mode "G" will result in a CCA MAC key with both MAC generate and MAC verify attributes (CV bits 20 - 21 = B'11'). Note that any key that can perform a generate operation can readily verify a MAC as well.
  5. The CCA representation and the TR-31 representation of CVV keys are incompatible. CCA represents the CVVKEY-A and CVVKEY-B keys as two 8-byte (single length) keys, while TR-31 represents these keys as one 16-byte key. The CVV Generate and CVV Verify verbs have support added to accept one 16-byte CVV key, using left and right key parts as A and B. Current Visa standards require this.
  6. Import and export of 8-byte CVVKEY-A and CVVKEY-B MAC/MACVER keys is allowed only using the proprietary TR-31 usage+mode values ("10" and "1", respectively) to indicate encapsulation of the IBM control vector in an optional block, because the 8-byte CVVKEY-A is meaningless and useless as a TR-31 "C0" usage key of any mode.
Table 3 shows all valid translations for import of a TR-31 data encryption key (usage "D0") to a CCA ENCIPHER, DECIPHER, CIPHER, or DATA key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are used for the encryption and/or decryption of data.
Table 3. Import translation table for a TR-31 data encryption key (usage "D0")

Import translation table for a TR-31 data encryption key (usage "D0"). This table contains seven columns: Keyword, TR-31 key usage, CCA key types, and Meaning, and it contains rows for ("D0").

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"D0" "A", "B", or "C" "E" N/A ENCIPHER, single or double length N/A N/A
"D" N/A DECIPHER, single or double length
"B" N/A CIPHER, single or double length
"D3" "B", "C", "D" "E" N/A DES CIPHERXO X’03EA’ T31I - Permit D3 to CIPHER:XLATE
"D" DES CIPHERXI
"B" DES CIPHERXL
"D" "E", "B", "D" AES CIPHER: with KUF 1, HOB, CXLATE enabled

Security consideration:

There is asymmetry in the translation from a CCA DATA key to a TR-31 key. The asymmetry results from CCA DATA keys having attributes of both data encryption keys and MAC keys, while TR-31 separates data encryption keys from MAC keys. A CCA DATA key can be exported to a TR-31 "D0" or "D3" key, if one or both applicable Encipher or Decipher control vector bits are on. However, a TR-31 "D0" or "D3" key cannot be imported to the lower-security CCA DATA key, it can be imported only to a CCA key type of ENCIPHER, DECIPHER, or CIPHER. This restriction eliminates the ability to export a CCA DATA key to a TR-31 key, and re-importing it back as a CCA DATA key with the capability to MAC generate and MAC verify.

Notes:
  1. Data encryption keys are used for the encryption and decryption of data.
  2. This table defines the only supported translations for this TR-31 usage. Usage must be the following value:
    "D0"
    Data encryption
    "D3"
    Data encryption key for sensitive data
Table 4 shows all valid translations for import of a TR-31 key encryption or wrapping, or key block protection key (usages "K0", "K1") to a CCA EXPORT, OKEYXLAT, IMPORTER, or IKEYXLAT key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are used only to encrypt or decrypt other keys, or as a key used to derive keys that are used for that purpose.
Table 4. Import translation table for a TR-31 key encryption or wrapping, or key block protection key (usages "K0", "K1")

Import translation table for a TR-31 key encryption or wrapping, or key block protection key (usages "K0" and "K1") . This table contains seven columns: Keyword, TR-31 key usage, CCA key types, and Meaning, and it contains rows for "K0" and "K1".

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"K0" "A", "B", "C" or "D" "E" OKEYXLAT OKEYXLAT, double length X'015C' TR31 Import - Permit K0:E to EXPORTER/OKEYXLAT
EXPORTER EXPORTER, double or triple length, EXPORT on (CV bit 21 = B'1')
"D" IKEYXLAT IKEYXLAT, double length X'015D' TR31 Import - Permit K0:D to IMPORTER/IKEYXLAT
IMPORTER IMPORTER, double or triple length, IMPORT on (CV bit 21 = B'1')
"B" OKEYXLAT OKEYXLAT, double length X'015E' TR31 Import - Permit K0:B to EXPORTER/OKEYXLAT
EXPORTER EXPORTER, double or triple length, EXPORT on (CV bit 21 = B'1')
IKEYXLAT IKEYXLAT, double length X'015F' TR31 Import - Permit K0:B to IMPORTER/IKEYXLAT
IMPORTER IMPORTER, double or triple length, IMPORT on (CV bit 21 = B'1')
"D" "E" N/A AES EXPORTER X'01E5' T31I - Permit K1/K4:E to AES EXPORTER:EXPTT31D+VARDRV-D
"D"
"B" AES IMPORTER X'01E6' T31I - Permit AES K1/K4:D to AES IMPORTER:IMPTT31D+VARDRV-D
"K1" "B", "C" or "D" "E" OKEYXLAT OKEYXLAT, double length X'0160' TR31 Import - Permit K1:E to EXPORTER/OKEYXLAT
EXPORTER EXPORTER, double or triple length, EXPORT on (CV bit 21 = B'1')
"D" IKEYXLAT IKEYXLAT, double length X'0161' TR31 Import - Permit K1:D to IMPORTER/IKEYXLAT
IMPORTER IMPORTER, double or triple length, IMPORT on (CV bit 21 = B'1')
"B" OKEYXLAT OKEYXLAT, double length X'0162' TR31 Import - Permit K1:B to EXPORTER/OKEYXLAT
EXPORTER EXPORTER, double or triple length, IMPORT on (CV bit 21 = B'1')
IKEYXLAT IKEYXLAT, double length X'0163' TR31 Import - Permit K1:B to IMPORTER/IKEYXLAT
IMPORTER IMPORTER, double or triple length, IMPORT on (CV bit 21 = B'1')
"D" "E" N/A AES EXPORTER, EXPTT31D X'01E5' T31I - Permit K1/K4:E to AES EXPORTER:EXPTT31D+VARDRV-D
"D" AES IMPORTER, IMPTT31D X'01E6' T31I - Permit AES K1/K4:D to AES IMPORTER:IMPTT31D+VARDRV-D
"B"
"K4" "D" "E" N/A AES EXPORTER, EXPTT31D X'01E5' T31I - Permit K1/K4:E to AES EXPORTER:EXPTT31D+VARDRV-D
"D" AES IMPORTER, IMPTT31D X'01E6' T31I - Permit AES K1/K4:D to AES IMPORTER:IMPTT31D+VARDRV-D

Security considerations:

Use caution when enabling any of the following access control points as this capability may give an immediate path to turn a CCA EXPORTER key into a CCA IMPORTER key and a CCA IMPORTER key into a CCA EXPORTER key.

Legend: ED – Enabled by Default. DD – Disabled by Default.

DES:

  • T31X Permit EXPORTER to K0/K1:B (X'02AD') (ED)
  • T31X Permit IMPORTER to K0/K1:B (X'02AE') (ED)
  • TR31 Import - Permit K0:B to EXPORTER/OKEYXLAT (X'015E') (DD)
  • TR31 Import - Permit K0:B to IMPORTER/IKEYXLAT (X'015F') (DD)
  • TR31 Import - Permit K1:B to EXPORTER/OKEYXLAT (X'0162') (DD)
  • TR31 Import - Permit K1:B to IMPORTER/IKEYXLAT (X'0163') (DD)

AES:

  • T31X - Permit AES EXPORTER to K0:E (X'01D3') (ED)
  • T31X - Permit AES EXPORTER to K1:E (X'01D4') (ED)
  • T31X - Permit AES IMPORTER to K0:D (X'01D6') (ED)
  • T31X - Permit AES IMPORTER to K1:D (X'01D7') (ED)
  • T31I - Permit K1/K4:E to AES EXPORTER:EXPTT31D+VARDRV-D (X'01E5') (ED)
  • T31I - Permit AES K1/K4:D to AES IMPORTER:IMPTT31D+VARDRV-D (X'01E6') (ED)

When a TR-31 key block does not have an included control vector as an optional block, the default control vector is used to construct the output key-token. Default CCA EXPORTER or IMPORTER keys have CV bits 18 - 20 on, which are used for key generation.

Notes:
  1. Key encryption or wrapping keys are used only to encrypt or decrypt other keys, or as a key used to derive keys that are used for that purpose.
  2. This table defines the only supported translations for this TR-31 usage. Usage must be the following value:
    "K0"
    Key encryption or wrapping
    "K1"
    TR-31 key block protection key
  3. Any attempt to import a TR-31 "K0" or "K1" key that has algorithm "D" (DEA) will result in an error because CCA does not support single-length KEKs.
  4. CCA mode support is the same for version IDs "A", "B", and "C", because the distinction between TR-31 "K0" and "K1" does not exist in CCA keys. CCA does not distinguish between targeted protocols currently, and so there is no good way to represent the difference. Also note that most wrapping mechanisms now involve derivation or key variation steps.
Table 5 shows all valid translations for import of a TR-31 ISO MAC algorithm key (usages "M0", "M1", "M3", "M6") to a CCA MAC, MACVER, DATA, DATAM, or DATAMV key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are use to compute or verify a code for message authentication.
Table 5. Import translation table for a TR-31 ISO MAC algorithm key (usages "M0", "M1", "M3", "M6")

Import translation table for a TR-31 key encryption or wrapping, or key block protection key (usages "M0", "M1", and "M3") . This table contains seven columns: Keyword, TR-31 key usage, CCA key types, and Meaning, and it contains rows for "M0", "M1", and "M3".

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"M0" "A", "B", or "C" "G" or "C" N/A MAC, double length, ANY-MAC (CV bits 0 - 3 = B'0000') X'0164' TR31 Import - Permit M0/M1/M3 to MAC/MACVER:ANY-MAC
"V" MACVER, double length, ANY-MAC (CV bits 0 - 3 = B'0000')
"M1" "G" or "C" MAC, single or double length, ANY-MAC (CV bits 0 - 3 = B'0000')
"V" MACVER, single or double length, ANY-MAC (CV bits 0 - 3 = B'0000')
"M3" "G" or "C" MAC, single or double length, ANY-MAC (CV bits 0 - 3 = B'0000')
"V" MACVER, single or double length, ANY-MAC (CV bits 0 - 3 = B'0000')
"M6" "B", "C", or "D" "C", "G", or "V" N/A TDES MAC X'03F0' T31I - Permit M6 to DES MAC

Security consideration: There is asymmetry in the translation from a CCA DATA key to a TR-31 key. The asymmetry results from CCA DATA keys having attributes of both data encryption keys and MAC keys, while TR-31 separates data encryption keys from MAC keys. A CCA DATA key can be exported to a TR-31 "M0", "M1", "M3", or "M6" key, if one or both applicable MAC generate and MAC verify control vector bits are on. However, a TR-31 "M0", "M1", "M3", or "M6" key cannot be imported to the lower-security CCA DATA key, it can be imported only to a CCA key type of MAC or MACVER. This restriction eliminates the ability to export a CCA MAC or MACVER key to a TR-31 key, and re-importing it back as a CCA DATA key with the capability to Encipher, Decipher, or both.

Notes:
  1. MAC keys are used to compute or verify a code for message authentication.
  2. This table defines the only supported translations for this TR-31 usage. Usage must be one of the following values:
    "M0"
    SO 16609 MAC algorithm 1, TDEA

    The ISO 16609 MAC algorithm 1 is based on ISO 9797. It is identical to "M1" except that it does not support 8-byte DES keys.

    "M1"
    SO 9797 MAC algorithm 1

    The ISO 9797 MAC algorithm 1 is identical to "M0" except that it also supports 8-byte DES keys.

    "M3"
    ISO 9797 MAC algorithm 3

    The X9.19 style of Triple-DES MAC.

    "M6"
    ISO 9797-1:2011 MAC algorithm 5/CMAC key.

    Triple-DES MAC, supports use of TR-31 Algorithm TDEA.

  3. A CCA control vector has no bits defined to limit key usage by algorithm, such as CBC MAC (TR-31 key usage "M0" and "M1"), X9.19 (TR-31 key usage "M3"), or TDEA (TR-31 key usage "M6"). When importing a TR-31 key block, the resulting CCA key token deviates from the restrictions of usages "M0", "M1", "M3", and "M6". Importing a TR-31 key block which allows MAC generation ("G" or "C") results in a control vector with the ANY-MAC attribute rather than for the restricted algorithm that is set in the TR-31 key block. The ANY-MAC attribute provides the same restrictions as what CCA currently uses for generating and verifying MACs.
Table 6 shows all the valid translations for import of a TR-31 HMAC algorithm key (usages "M7") to a CCA HMAC key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are used to compute or verify a code for message authentication.
Table 7 shows all valid translations for import of a TR-31 PIN encryption or PIN verification key (usages "P0", "V0", "V1", "V2") to a CCAOPINENC, IPINENC, PINGEN, or PINVER key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are used to protect PIN blocks and to generate or verify a PIN using a particular PIN-calculation method for that key type.
Table 6. Import translation table for a TR-31 HMAC algorithm key (usages "M7")

Import translation table for a TR-31 HMAC algorithm key (usages "M7"). This table contains seven columns: Key usage, Key block protection method (version ID), Mode of use, Rule-array keywords, CCA key type and required key usage attributes, Access control name, and Offset (hex).

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and required key usage attributes Access control name Offset (hex)
"M7" "D" "G" or "C" N/A MAC + HMAC + GENERATE T31I – Permit M7:G/V/C to HMAC MAC:GENERATE/VERIFY X'017D'
"V" MAC + HMAC + Verify
Table 7. Import translation table for a TR-31 PIN encryption or PIN verification key (usages "P0", "V0", "V1", "V2")

Import translation table for a TR-31 key encryption or wrapping, or key block protection key (usages "P0", "V0", "V1", "V2") . This table contains seven columns: Keyword, TR-31 key usage, CCA key types, and Meaning, and it contains rows for "P0", "V0", "V1", "V2".

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"P0" "A", "B", "C", or "D" "E" N/A OPINENC, double length X'0165' T31I - Permit P0:E to OPINENC
"D" N/A IPINENC, double length X'0166' T31I - Permit P0:D to IPINENC
"B" or "E" OPINENC OPINENC, double length X'0165' T31I - Permit P0:E to OPINENC
"B" or "D" IPINENC IPINENC, double length X'0166' T31I - Permit P0:D to IPINENC
"D" E N/A AES PINPROT, ENCRYPT X'01E2' T31I - Permit P0:E/D to AES PINPROT: ENC/DEC+ CBC+ISO-4
D N/A AES PINPROT, DECRYPT X'01E2' T31I - Permit P0:E/D to AES PINPROT: ENC/DEC+ CBC+ISO-4
"B" or "E" OPINENC AES PINPROT, ENCCRYPT X'01E2' T31I - Permit P0:E/D to AES PINPROT: ENC/DEC+ CBC+ISO-4
"B" or "D" IPINENC AES PINPROT, DECCRYPT X'01E2' T31I - Permit P0:E/D to AES PINPROT: ENC/DEC+ CBC+ISO-4
"V0" "A", "B", "C", or "D" "N" (requires both controls) PINGEN PINGEN, double length, NO-SPEC (CV bits 0 - 3 = B'0000') NOOFFSET off (CV bit 37 = B'0') X'0167' T31I - Permit V0:N/G/C to DES PINGEN: NO-SPEC NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "G" or "C" NOOFFSET off (CV bit 37 = B'0') X'0167' T31I - Permit V0:N/G/C to DES PINGEN:NO-SPEC NOOFFSET
"A", "B", "C", or "D" "N" (requires both controls) PINGEN, NOOFFSET NOOFFSET on (CV bit 37 = B'1') X'0167' T31I - Permit V0:N/G/C to DES PINGEN:NO-SPEC NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "G" or "C" NOOFFSET on (CV bit 37 = B'1') X'0167' T31I - Permit V0:N/G/C to DES PINGEN:NO-SPEC NOOFFSET
"A", "B", "C", or "D" "N" (requires both controls) PINVER PINVER, double length, NO-SPEC (CV bits 0 - 3 = B'0000') NOOFFSET off (CV bit 37 = B'0') X'0168' T31I - Permit V0:N/V to DES PINVER:NO-SPEC NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "V" or "C" NOOFFSET off (CV bit 37 = B'0') X'0168' T31I - Permit V0:N/V to DES PINVER:NO-SPEC NOOFFSET
"A", "B", "C", or "D" "N" (requires both controls) PINVER, NOOFFSET NOOFFSET on (CV bit 37 = B'1') X'0168' T31I - Permit V0:N/V to DES PINVER:NO-SPEC NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "V" or "C" NOOFFSET on (CV bit 37 = B'1') X'0168' T31I - Permit V0:N/V to DES PINVER:NO-SPEC NOOFFSET
"V1" "A", "B", "C", or "D" "N" (requires both controls) PINGEN PINGEN, double length, IBM PIN/IBM-PINO (CV bits 0 - 3 = B'0001') NOOFFSET off (CV bit 37 = B'0') X'0169' T31I - Permit V1:N/G/C to DES PINGEN:IBM-PIN/IBM-PINO NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "G" or "C" NOOFFSET off (CV bit 37 = B'0') X'0169' T31I - Permit V1:N/G/C to DES PINGEN:IBM-PIN/IBM-PINO NOOFFSET
"A", "B", "C", or "D" "N" (requires both controls) PINGEN, NOOFFSET NOOFFSET on (CV bit 37 = B'1') X'0169' T31I - Permit V1:N/G/C to DES PINGEN:IBM-PIN/IBM-PINO NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "G" or "C" NOOFFSET on (CV bit 37 = B'1') X'0169' T31I - Permit V1:N/G/C to DES PINGEN:IBM-PIN/IBM-PINO NOOFFSET
"A", "B", "C", or "D" "N" (requires both controls) PINVER PINVER, double length, IBM PIN/IBM-PINO (CV bits 0 - 3 = B'0001') NOOFFSET off (CV bit 37 = B'0') X'016A' T31I - Permit V1:N/V to DES PINVER:IBM-PIN/IBM-PINO NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "V" or "C" NOOFFSET off (CV bit 37 = B'0') X'016A' T31I - Permit V1:N/V to DES PINVER:IBM-PIN/IBM-PINO NOOFFSET
"A", "B", "C", or "D" "N" (requires both controls) PINVER, NOOFFSET NOOFFSET on (CV bit 37 = B'1') X'016A' T31I - Permit V1:N/V to DES PINVER:IBM-PIN/IBM-PINO NOOFFSET
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "V" or "C" NOOFFSET on (CV bit 37 = B'1') X'016A' T31I - Permit V1:N/V to DES PINVER:IBM-PIN/IBM-PINO NOOFFSET
"V2" "A", "B", "C", or "D" "N" (requires both controls) PINGEN PINGEN, double length, VISA-PVV (CV bits 0 - 3 = B'0010') X'016B' T31I - Permit V2:N/G/C to DES PINGEN:VISA-PVV
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "G" or "C" PINGEN, double length, VISA-PVV (CV bits 0 - 3 = B'0010') X'016B' T31I - Permit V2:N/G/C to DES PINGEN:VISA-PVV
"A", "B", "C", or "D" "N" (requires both controls) PINVER PINVER, double length, VISA-PVV (CV bits 0 - 3 = B'0010') X'016C' T31I - Permit V2:N/V to DES PINVER:VISA-PVV
X'017C' T31I - Permit V0/V1/V2:N to DES PINGEN/PINVER
"A", "B", "C", or "D" "V" or "C" PINVER, double length, VISA-PVV (CV bits 0 - 3 = B'0010') X'016C' T31I - Permit V2:N/V to DES PINVER:VISA-PVV

Security considerations:

TR-31 key blocks may use the same mode of use "N" for PINGEN and PINVER keys. For TR-31 key blocks for a given PIN key usage, enabling both the PINGEN and PINVER access-control points at the same time while enabling offset X'017C' (for mode "N", no special restrictions) is NOT recommended. In other words, for a particular PIN verification key usage, you should not simultaneously enable the three commands shown below for that usage:

Table 8. Commands

A table with three columns, explaining Key type, mode, or version, offset, and command for usages of V0, V1, and V2

Key type, mode, or version Offset Command
"V0": For usage V0, a user with the following three commands enabled in the active role can change a PINVER key into a PINGEN key and the other way round. Avoid simultaneously enabling these three commands.
Key type PINGEN X'0167' TR31 Import - Permit V0 to PINGEN:NO-SPEC
Key type PINVER X'0168' TR31 Import - Permit V0 to PINVER:NO-SPEC
Mode "N" X'017C' TR31 Import - Permit V0/V1/V2:N to PINGEN/PINVER
"V1": For usage V1, a user with the following three commands enabled in the active role can change a PINVER key into a PINGEN key and the other way round. Avoid simultaneously enabling these three commands.
Key type PINGEN X'0169' TR31 Import - Permit V1 to PINGEN:IBM-PIN/IBM-PINO
Key type PINVER X'016A' TR31 Import - Permit V1 to PINVER:IBM-PIN/IBM-PINO
Mode "N" X'017C' TR31 Import - Permit V0/V1/V2:N to PINGEN/PINVER
"V2": For usage V2, a user with the following three commands enabled in the active role can change a PINVER key into a PINGEN key and the other way around. Avoid simultaneously enabling these three commands.
Key type PINGEN X'016B' TR31 Import - Permit V2 to PINGEN:VISA-PVV
Key type PINVER X'016C' TR31 Import - Permit V2 to PINVER:VISA-PVV
Mode "N" X'017C' TR31 Import - Permit V0/V1/V2:N to PINGEN/PINVER

Failure to comply with this recommendation allows changing PINVER keys into PINGEN and the other way around.

Notes:
  1. PIN encryption keys are used to protect PIN blocks. PIN verification keys are used to generate or verify a PIN using a particular PIN-calculation method for that key type.
  2. This table defines the only supported translations for this TR-31 usage. Usage must be one of the following values:
    "P0"
    PIN encryption
    "V0"
    PIN verification, KPV, other algorithm

    Usage "V0" does not have its own PIN-calculation method defined. The mapping to NO-SPEC is sub-optimal. Exporting to "N" mode restricts keys from being imported with the IBM-PIN/IBM-PINO or VISA-PVV attribute, while CCA NO-SPEC allows any method.

    "V1"
    PIN verification, IBM 3624
    "V2"
    PIN verification, Visa PVV

    The NOOFFSET keyword is not allowed for the Visa PVV algorithm because it does not support this attribute.

  3. Mode must be one of the following values:
    "E"
    Encrypt/wrap only

    This mode restricts PIN encryption keys to encrypting a PIN block. May be used to create or reencipher an encrypted PIN block (for key-to-key translation).

    "D"
    Decrypt/unwrap only

    This mode restricts PIN encryption keys to decrypting a PIN block. Generally used in a PIN translation to decrypt the incoming PIN block.

    "N"
    No special restrictions (other than restrictions implied by the key usage)

    This mode is used by several vendors for a PIN generate or PIN verification key when the key block version ID is "A".

    "G"
    Generate only

    This mode is used for a PINGEN key that may not perform a PIN verification. The control vector will not have its EPINVER attribute on (CV bit 22 = B'0').

    "V"
    Verify only

    This mode is used for PIN verification only. If the TR-31 key block does not have a control vector included, the only usage bits set on in the control vector is the EPINVER bit (CV bits 18 - 22 = B'00001').

    "C"
    Both generate and verify (combined)

    This mode indicates that the control vector will have the default PINGEN bits on (CV bits 18 -22 = B'11111').

  4. Any attempt to import a TR-31 "P0" key that has mode "B" (both encrypt and decrypt) results in an error because CCA does not support this combination of attributes.
  5. If the TR-31 key block contains a control vector, and the control vector has NOOFFSET on, the NOOFFSET keyword is not necessary because the verb will automatically set NOOFFSET on in this case.
Table 9 shows all valid translations for import of a TR-31 EMV/chip issuer master-key key (usages "E<n>", "F<n>") to a CCA DKYGENKY, DATA, MAC, CIPHER, or ENCIPHER key, along with any access control commands that must be enabled in the active role for that key type and control vector attributes. These keys are used by the chip cards to perform cryptographic operations or, in some cases, to derive keys used to perform operations.
Table 9. Import translation table for a TR-31 EMV/chip issuer master-key key (usages "E0", "E1", "E2", "E3", "E4", "E5", "F0", "F1", "F2", "F3", "F4")

Import translation table for a TR-31 key encryption or wrapping, or key block protection key (usages "E0", "E1", "E2", "E3", "E4", "E5") . This table contains seven columns: Keyword, TR-31 key usage, CCA key types, and Meaning, and it contains rows for "E0", "E1", "E2", "E3", "E4", "E5".

Key usage Key block protection method keyword (version ID) Mode of use Rule-array keywords CCA key type and control vector attributes Offset Command
"E0" "A" "N" DKYL0, DMAC DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMAC (CV bits 19 - 22 = B'0010') X'016D' TR31 Import - Permit E0 to DKYGENKY:DKYL0+DMAC
"B", "C", "D" "X, "N"
"A" "N" DKYL0, DMV DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMV (CV bits 19 - 22 = B'0011') X'016E' TR31 Import - Permit E0 to DKYGENKY:DKYL0+DMV
"B", "C", "D" "X, "N"
"A" "N" DKYL1, DMAC DKYGENKY, double length, DKYL1 (CV bits 12 - 14 = B'001'), DMAC (CV bits 19 - 22 = B'0010') X'016F' TR31 Import - Permit E0 to DKYGENKY:DKYL1+DMAC
"B", "C", "D" "X, "N"
"A" "N" DKYL1, DMV DKYGENKY, double length, DKYL1 (CV bits 12 - 14 = B'001'), DMV (CV bits 19 - 22 = B'0011') X'0170' TR31 Import - Permit E0 to DKYGENKY:DKYL1+DMV
"B", "C", "D" "X", "N"
"D" "X" DKYL0 or DKYL1 or DKYL2 AES DKEYGENKY, D-MAC usage attributes to match keywords X'01E7' T31I - Permit E0:X to AES DKYGENKY:DKYL0/L1/L2+D-MAC+GEN+CMAC
"E1" "A" "N" DKYL0, DMPIN DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMPIN (CV bits 19 - 22 = B'1001') X'0171' TR31 Import - Permit E1 to DKYGENKY:DKYL0+DMPIN
"E"
"D"
"B"
"B", "C", "D" "X, "N"
"A" "N" DKYL0, DDATA DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DDATA (CV bits 19 - 22 = B'0001') X'0172' TR31 Import - Permit E1 to DKYGENKY:DKYL0+DDATA
"E"
"D"
"B"
"B", "C", "D" "X, "N"
"A" "N" DKYL1, DMPIN DKYGENKY, double length, DKYL1 (CV bits 12 - 14 = B'001'), DMPIN (CV bits 19 - 22 = B'1001') X'0173' TR31 Import - Permit E1 to DKYGENKY:DKYL1+DMPIN
"E"
"D"
"B"
"B", "C", "D" "X, "N"
"A" "N" DKYL1, DDATA DKYGENKY, double length, DKYL1 (CV bits 12 - 14 = B'001'), DDATA (CV bits 19 - 22 = B'0001') X'0174' TR31 Import - Permit E1 to DKYGENKY:DKYL1+DDATA
"E"
"D"
"B"
"B", "C", "D" "X, "N"
"D" "X" DKYL0 or DKYL1 or DKYL2 AES DKEYGENKY, D-MAC usage attributes to match keywords X'01E7' T31I - Permit E0:X to AES DKYGENKY:DKYL0/L1/L2+D-MAC+GEN+CMAC
"E2" "A" "N" DKYL0, DMAC DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMAC (CV bits 19 - 22 = B'0010') X'0175' TR31 Import - Permit E2 to DKYGENKY:DKYL0+DMAC
"B", "C", "D" "X, "N"
"A" "N" DKYL1, DMAC DKYGENKY, double length, DKYL1 (CV bits 12 - 14 = B'001'), DMAC (CV bits 19 - 22 = B'0010') X'0176' TR31 Import - Permit E2 to DKYGENKY:DKYL1+DMAC
"B", "C", "D" "X, "N"
"D" "X" DKYL0 or DKYL1 or DKYL2 AES DKEYGENKY, D-MAC usage attributes to match keywords X'01E7' T31I - Permit E0:X to AES DKYGENKY:DKYL0/L1/L2+D-MAC+GEN+CMAC
"E3" "A" "N" N/A ENCIPHER X'0177' TR31 Import - Permit E3 to ENCIPHER
"E"
"D"
"B"
"G"
"B", "C", "D" "X, "N"
"D" "X" DKYL0 or DKYL1 or DKYL2 AES DKEYGENKY, D-MAC usage attributes to match keywords X'01E7' T31I - Permit E0:X to AES DKYGENKY:DKYL0/L1/L2+D-MAC+GEN+CMAC
"D" "E" N/A AES CIPHER, ENCRYPT 01EB T31I - Permit E3:E/B to AES CIPHER:ENCRYPT/ENC+DEC
"D" "B" N/A AES CIPHER, ENCRYPT,DECRYPT 01EB T31I - Permit E3:E/B to AES CIPHER:ENCRYPT/ENC+DEC
"E4" "A" "N" N/A DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DDATA (CV bits 19 - 22 = B'0001') X'0178' TR31 Import - Permit E4 to DKYGENKY:DKYL0+DDATA
"B"
"B", "C", "D" "X, "N"
"D" "X" DKYL0 or DKYL1 or DKYL2 AES DKEYGENKY, D-MAC usage attributes to match keywords X'01E7' T31I - Permit E0:X to AES DKYGENKY:DKYL0/L1/L2+D-MAC+GEN+CMAC
"E5" "A" "G" DKYL0, DMAC DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMAC (CV bits 19 - 22 = B'0010') X'0179' TR31 Import - Permit E5 to DKYGENKY:DKYL0+DMAC
"C"
"V"
"E"
"D"
"B"
"N"
"B", "C", "D" "X, "N"
"A" "G" DKYL0, DDATA DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DDATA (CV bits 19 - 22 = B'0001') X'017A' TR31 Import - Permit E5 to DKYGENKY:DKYL0+DDATA
"C"
"V"
"E"
"D"
"B"
"N"
"B", "C", "D" "X, "N"
"A" "G" DKYL0, DEXP DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DEXP (CV bits 19 - 22 = B'0101') X'017B' TR31 Import - Permit E5 to DKYGENKY:DKYL0+DEXP
"C"
"V"
"E"
"D"
"B"
"N"
"B", "C", "D" "X, "N"
"D" "X" DKYL0 or DKYL1 or DKYL2 AES DKEYGENKY, D-MAC usage attributes to match keywords X'01E7' T31I - Permit E0:X to AES DKYGENKY:DKYL0/L1/L2+D-MAC+GEN+CMAC
"F0" "A", "B", "C", "D" "X" DKYL0 DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMAC (CV bits 19 - 22 = B'0010') X'03EB' T31I - Permit F0:X to DES DKYGENKY:DKYL0+DMAC
DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DMV (CV bits 19 - 22 = B'0011') X'03EC' T31I - Permit F0:X to DES DKYGENKY:DKYL0+DMV
"D" AES DKYGENKY: DKYL0+DMAC+GENERATE+CMAC X'0504' T31I - Permit F0:X to AES DKYGENKY:DKYL0+DMAC+GENERATE+CMAC
"F1" "A", "B", "C", "D" "X" DKYL0 DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DDATA (CV bits 19 - 22 = B'0001') X'03EE' T31I - Permit F1:X to DES DKYGENKY:DKYL0+DDATA
DKYGENKY, double length, DKYL0 (CV bits 12 - 144 = B'000'), DMPIN (CV bits 19 - 22 = B'1001') X'03ED' T31I - Permit F1:X to DES DKYGENKY:DKYL0+DMPIN
"D" AES DKYGENKY:DKYL0+DSECMSG+SMPIN+ANYUSE X'0505' T31I - Permit F1:X to AES DKYGENKY:DKYL0+DSECMSG+SMPIN+ANY-USE
"F2" "A", "B", "C", "D" "X" DKYL0 DKYGENKY, double length, DKYL0 (CV bits 12 – 14 = B’000’), DMAC (CV bits 19 – 22 = B’0010’) X'03EF' T31I - Permit F2:X to DES DKYGENKY:DKYL0+DMAC
"D" AES DKYGENKY: DKYL0+DMAC+GENERATE+CMAC X'0506' T31I - Permit F2:X to AES DKYGENKY:DKYL0+D-MAC+GENERATE+CMAC
"F3" "A", "B", "C", "D" "N" "E" "D" "B" "G" or "X" DKYL0 ENCIPHER, double length X'0502' T31I - Permit F3:N/E/D/B/G/X to DES ENCIPHER
"D" X AES DKYGENKY:DCIPHER+ENCRYPT+DECRYPT+CBC X'0507 T31I - Permit F3:X to AES DKYGENKY:D-CIPHER+ENCRYPT+DECRYPT+CBC
"E" or "B" AES CIPHER:ENCRYPT/ENCRYPT+DECRYPT '0508 T31I - Permit F3:E/B to AES CIPHER:ENCRYPT/ENCRYPT+DECRYPT
"F4" "A", "B", "C", "D" "X" DKYL0 DKYGENKY, double length, DKYL0 (CV bits 12 - 14 = B'000'), DDATA (CV bits 19 - 22 = B'0001') X'0503' T31I - Permit F4:X to DES DKYGENKY:DKYL0+DDATA
"D" AES DKYGENKY:DKYL0+DCIPHER+ENCRYPT+DECRYPT+CBC X'0509' T31I - Permit F4:X to AES DKYGENKY:DKYL0+D-CIPHER+ENC+DEC+CBC
Notes:
  1. EMV/chip issuer master-key keys are used by the chip cards to perform cryptographic operations or, in some cases, to derive keys used to perform operations. In CCA, these keys are (a) diversified key-generating keys (key type DKYGENKY), allowing derivation of operational keys, or (b) operational keys. Note that in this context, "master key" has a different meaning than for CCA. These master keys, also called KMCs, are described by EMV as DES master keys for personalization session keys. They are used to derive the corresponding chip card master keys, and not typically used directly for cryptographic operations other than key derivation. In CCA, these keys are usually key generating keys with derivation level DKYL1 (CV bits 12 - 14 = B'001'), used to derive other key generating keys (the chip card master keys). For some cases, or for older EMV key derivation methods, the issuer master keys could be level DKYL0 (CV bits 12 - 14 = B'000').
  2. This table defines the only supported translations for this TR-31 usage. Usage must be one of the following values:
    "E0"
    Application cryptograms
    "E1"
    Secure messaging for confidentiality
    "E2"
    Secure messaging for integrity
    "E3"
    Data authentication code
    "E4"
    Dynamic numbers
    "E5"
    Card personalization
    "F0"
    Application cryptograms
    "F1"
    Secure messaging for confidentiality
    "F2"
    Secure messaging for integrity
    "F3"
    Data authentication code
    "F4"
    Dynamic numbers
  3. EMV support in CCA is different than TR-31 support, and CCA key types do not match TR-31 types.
  4. DKYGENKY keys are double length only.
  5. In CCA, a MAC key that can perform a MAC generate operation also can perform a MAC verify. For TR-31 mode "G" (generate only), the translation to a CCA key results in a key that can perform MAC generate and MAC verify.
tr31_key_block_length
Direction: Input
Type: Integer
A pointer to an integer variable containing the number of bytes of data in the tr31_key_block variable. The length field in the TR-31 block is a 4-digit decimal number, so the maximum acceptable length is 9992 bytes. For more information, see TR31 Key Token Parse (CSNBT31P).
tr31_key_block
Direction: Input
Type: String
A pointer to a string variable containing the TR-31 key block that is to be imported. The key block is protected with the key identified by the unwrap_kek_identifier parameter.
unwrap_kek_identifier_length
Direction: Input
Type: Integer
A pointer to an integer variable containing the number of bytes of data in the unwrap_kek_identifier variable. Set this value to 64 for a CCA DES token or a label. Or set the value between the actual key length and 9992 for CCA AES tokens and TR-31 tokens.
unwrap_kek_identifier
Direction: Input
Type: String
A pointer to a string variable containing the operational key-token used to unwrap the key identified by the tr31_key_block parameter, or a key label of such a key in key storage. A CCA DES key must have a key type of IMPORTER or IKEYXLAT, and be authorized for import. For CCA AES keys, the key must be an AES key-encrypting key of type IMPORTER and key usage IMPTT31D with WR-DES, WRAES, or WR-HMAC capability, matching the wrapped key.

If the key is a TR-31 token, it must have the following attributes:

  • TR-31 key usage: K1 or K0
  • Algorithm: T or A
  • TR-31 mode of key use: D

If a key token is passed which is wrapped under the old master key, it will be updated on output so that it is wrapped under the current master key.

Notes:
  1. DES keys wrapped in ECB mode (CCA legacy wrap mode) cannot be used to wrap or unwrap TR-31 "B" or "C" key blocks that have or will have "E" exportability, because ECB mode does not comply with ANSI X9.24 Part 1.
  2. If the unwrap_kek_identifier is compliant-tagged, the TR-31 key block is imported as a compliant-tagged key token.
wrap_kek_identifier_length
Direction: Input
Type: Integer
A pointer to an integer variable containing the length in bytes of the wrap_kek_identifier variable. The value must be greater than or equal to 0. A null key-token can have a length of 1. Set this value to 64 for a key label or a CCA DES KEK. Set this parameter to a value between the actual key length and 9992 for CCA AES tokens and TR-31 tokens.
wrap_kek_identifier
Direction: Input
Type: String
A pointer to a string variable containing the operational fixed-length CCA DES or AES key token used to wrap the key identified by the output_key_identifier parameter, a null key token, or a key label of such a key in key storage. If the parameter identifies a null key token, then the unwrap_kek_identifier parameter is also used for wrapping the CCA output key token.

For CCA DES keys, the key must be a DES key-encrypting key of type IMPORTER or IKEYXLAT type. For CCA AES keys, the key must be an AES key-encrypting key of type IMPORTER with WR-AES or WR-HMAC capability, matching the wrapped key.

For TR-31 keys, the token must have the following attributes:

  • TR-31 key usage: K0
  • Algorithm: A or T
  • TR-31 mode of key use: D

If the wrap_kek_identifier is compliant-tagged, the TR-31 key block is imported as a compliant-tagged key token.

output_key_identifier_length
Direction: Input/Output
Type: Integer
A pointer to an integer specifying the length in bytes of the output_key_identifier variable. This is an input/output parameter.
output_key_identifier
Direction: Input/Output
Type: String
A pointer to a string variable containing the key token or the key label for the token that is to receive the imported key. The output key-token is a CCA internal or external key token containing the key received in the TR-31 token. If a key token is provided, it must be a null token (64 bytes of X'00'). If a key label is provided, the imported token is stored in the key storage file and identified by that label.
num_opt_blocks
Direction: Output
Type: Integer
A pointer to an integer variable where the verb stores the number of optional blocks that are present in the TR-31 key token.
cv_source
Direction: Output
Type: Integer
A pointer to an integer variable where the verb stores a value indicating how the control vector in the output key token was created. It can be one of the values in Table 10.
Table 10. TR31 Key Import CV sources

TR31 Key Import CV sources

CSNBT31I CV source Meaning
0 No CV was present in an optional block, and the output CV was created by the verb based on input parameters and on the attributes in the TR-31 key block header.
1 A CV was obtained from an optional block in the TR-31 key block, and the key usage and mode of use were also specified in the TR-31 header. The verb verified compatibility of the header values with the CV and then used that CV in the output key token.
2 A CV was obtained from an optional block in the TR-31 key block, and the key usage and mode of use in the TR-31 header held the proprietary values indicating that key use and mode should be obtained from the included CV. The CV from the TR-31 token was used as the CV for the output key token.

Any values other than these three are reserved and are currently invalid.

protection_method
Direction: Output
Type: Integer
A pointer to an integer variable where the verb stores a value indicating what method was used to protect the input TR-31 key block. The TR-31 standard allows two methods, and the application program might want to know which was used for security purposes. The variable can have one of the values in Table 11.
Table 11. TR31 Key Import protection methods

TR31 Key Import protection methods

CSNBT31I protection method Meaning
0 The TR-31 key block was protected using the variant method as identified by a Key Block Version ID value of "A" (X'41').
1 The TR-31 key block was protected using the derived key method as identified by a Key Block Version ID value of "B" (X'42').
2 The TR-31 key block was protected using the variant method as identified by a Key Block Version ID value of "C" (X'43'). Functionally this method is the same as "A", but to maintain consistency a different value is returned here for "C".

Any values other than these three are reserved and are currently invalid.