public class DukptReceiver
extends java.lang.Object
DukptReceiver
class generates the future keys according to
ANSI X9.24-1:2009.Modifier and Type | Field and Description |
---|---|
static int |
MAX_ENCRYPTION_COUNT
Maximum encryption count.
|
Constructor and Description |
---|
DukptReceiver()
Creates an instance of
DukptReceiver . |
Modifier and Type | Method and Description |
---|---|
static boolean |
compareKeySerialNumber(byte[] ksn1,
byte[] ksn2)
Compares the two key serial numbers.
|
static byte[] |
generateDataEncryptionRequestKey(byte[] key)
Generates the data encryption request key from the key.
|
static byte[] |
generateDataEncryptionResponseKey(byte[] key)
Generates the data encryption response key from the key.
|
static byte[] |
generateMac(byte[] key,
byte[] input)
Generates the MAC.
|
static byte[] |
generateMacRequestKey(byte[] key)
Generates the MAC request key from the key.
|
static byte[] |
generateMacResponseKey(byte[] key)
Generates the MAC response key from the key.
|
static byte[] |
generatePinEncryptionKey(byte[] key)
Generates the PIN encryption key from the key.
|
int |
getEncryptionCounter()
Gets the encryption counter.
|
static int |
getEncryptionCounter(byte[] ksn)
Gets the encryption counter from the key serial number.
|
byte[] |
getKey()
Gets the key.
|
byte[] |
getKeySerialNumber()
Gets the key serial number.
|
void |
loadInitialKey(byte[] initialKey)
Loads the initial key.
|
void |
setKeySerialNumber(byte[] keySerialNumber)
Sets the key serial number.
|
public static final int MAX_ENCRYPTION_COUNT
public byte[] getKeySerialNumber()
public void setKeySerialNumber(byte[] keySerialNumber)
keySerialNumber
- the key serial number. The length must be 10 bytes.public int getEncryptionCounter()
public void loadInitialKey(byte[] initialKey)
initialKey
- the initial key. The length must be 16 bytes.public byte[] getKey()
public static byte[] generatePinEncryptionKey(byte[] key)
key
- the key. The length must be 16 bytes.public static byte[] generateMacRequestKey(byte[] key)
key
- the key. The length must be 16 bytes.public static byte[] generateMacResponseKey(byte[] key)
key
- the key. The length must be 16 bytes.public static byte[] generateDataEncryptionRequestKey(byte[] key)
key
- the key. The length must be 16 bytes.public static byte[] generateDataEncryptionResponseKey(byte[] key)
key
- the key. The length must be 16 bytes.public static byte[] generateMac(byte[] key, byte[] input)
key
- the key. The length must be 16 bytes.input
- the input buffer.public static boolean compareKeySerialNumber(byte[] ksn1, byte[] ksn2)
ksn1
- the first key serial number.ksn2
- the second key serial number.public static int getEncryptionCounter(byte[] ksn)
ksn
- the key serial number. The length must be 10 bytes.Copyright © 2013-2018, Advanced Card Systems Ltd. All rights reserved.