Skip to main content

Device Keys

This document describes the format of the key data returned by the Service Center Device API Registration endpoint (data objects in the deviceKey element in the response message).

Device key object can have the following fields:

  • keyTypeName - key type name, see the chapter Supported Key Types below
  • keyDataFormat - key format, see the chapter Supported key formats below
  • algorithm - key algorithm
  • keyData - key data, encoded in the format specified by keyDataFormat
  • keyIndex - key index, used for key versioning

Supported Key Types

The element keyTypeName describes the key type sent to the device. The following key types are currently in use:

Key classKey Type NameKey AlgorithmSupported Key Data FormatDescription
Private keySALTHMAC-SHA256 or RIDANGOAES or TR34Tokenization key used for calculating card PAN token
Private keyIPEKDUKPT-AES or DUKPT-TDEAAES or TR34DUKPT AES Initial PIN Encryption Key or Triple-DES Initial PIN Encryption Key, used for encrypting tap data
Private keyTERM_EP2_SECRETSECRETTR34Terminal EP2 Shared Secret
Public keySC_EP2_PUBKEYRSATR34Service Center EP2 Public Key
CertificateSC_ROOT_CERTRSAX509Service Center TLS Root CA Certificate

Supported key data formats

The exact key format depends on the value of the element keyDataFormat. It can be one of the following:

FormatkeyData field encodingDescription
AESHEXKey data is encrypted with the AES encryption
TR34Plain textKey data is in TR-34 keyblock format
X509BASE64Key data is X.509 data structure in DER format
PLAINHEXKey data is not encrypted

Which format is used for sending the key data depends from the key type.

AES

Field keyData contains a HEX-encoded private AES key, encrypted with the device's internal Key Exchange Key AES key using AES-CBC encryption. Field keyIndex contains AES IV (initialization vector) value (if not present, then value 0 should be used)

TR34

The following fields are in use:

Field keyData contains a private key in TR-34 format, see below

The following TR-34 headers are supported:

  • Key Block Version ID: Value B
  • Keu Usage:
    • B1 - DUKPT IKEY
    • K0 - key encryption or wrapping
    • D0 - data encryption
    • 12 - EP2 component authentication
    • 00 - no specific use
  • Algorithm:
    • A - AES
    • T - TDEA
    • H - HMAC
    • 0 - no specific use
  • Mode of use:
    • B - encrypt/decrypt
    • E - encrypt only
    • X - derive
    • G - generate only
    • N - no specific
  • Exportability:
    • E - exporting allowed

In case of DUKPT IPEK key TR-34 keyblock contains also an optional header KS with the hex encoded Initial KSN value.

TR-34 keyblock is encrypted with the device's Device Key Encryption Key (DKEK-PUB) public key and signed with the Device Key Signing Key Private Key (DKSK-PRIV) private key.

Device should first use its Device Key Signing Key Certificate (DKSK-CERT) for verifying the keyblock signature and then use its Device Key Encryption Key (DKEK-PRIV) for decrypting the private key from the keyblock.

TR-34 key settings

The following TR-34 header field values are used for the keys:

Key Type NameKey AlgorithmHeader: Key UsageHeader: AlgorithmHeader: Mode of use
SALTAES00HG
IPEKAESB1AX
IPEKTDESB1TX
TERM_EP2_SECRET-120N
SC_EP2_PUBKEY-K00E

Key format

SALT, IPEK

Key data inside the TR-34 keyblock is in binary form.

SC_EP2_PUBKEY

Key data inside the TR-34 keyblock should have the following structure:

BytesLengthFieldValue
01TypeE (ASCII)
1-22Version07h 00h
3-514512Key valuePublic Key in binary EP2 Public Key format (see the 'EP2 Security Specification, version 8.2', chapter '7.5 Format Public Keys')
TERM_EP2_SECRET

Key data inside the TR-34 keyblock should have the following structure:

BytesLengthFieldValue
01TypeC (ASCII)
1-22Version06h 10h
3-1816Key valueComponent Secret in binary format

X509

The following fields are in use:

Field keyData contains the certificate in BASE64-encoded DER format (see X.509) and field keyIndex is not used.

PLAIN

Field keyData contains the shared secret in HEX-encoded format and field keyIndex is not used.