public class KeyInfo extends Object
KeyInfo class represents key information and the associated algorithm used in PINPad operations.
This class provides the necessary details to specify the type of key, its index, and the cryptographic algorithm to be used.| Modifier and Type | Field and Description |
|---|---|
int |
algorithm
Algorithm type, see
ALG_3DES for example. |
static <any> |
CREATOR
Deprecated.
|
int |
keyID
Key index.
|
int |
keyType
Key type.
|
int |
masterKeyID
Master key index, ranging from 0 to 49.
|
| Constructor and Description |
|---|
KeyInfo(int keyType,
int keyID,
int algorithm)
Constructs a KeyInfo object specifically for DUKPT keys.
|
KeyInfo(int keyType,
int masterKeyID,
int keyID,
int algorithm)
Constructs a KeyInfo object for keys of type
KEY_TYPE_MK_SK. |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents()
Deprecated.
|
void |
writeToParcel(Parcel dest,
int flags)
Deprecated.
|
public int algorithm
ALG_3DES for example.@Deprecated public static final <any> CREATOR
public int keyID
KEY_TYPE_MK_SK, valid constants are USER_KEY_ID_PIN,
USER_KEY_ID_MAC, USER_KEY_ID_DATA.
For other key types, it represents the key index.public int keyType
PINPadDevice:
KEY_TYPE_TDUKPT, KEY_TYPE_MK_SK, KEY_TYPE_FIX, KEY_TYPE_TDUKPT_2009.public int masterKeyID
KEY_TYPE_MK_SK.public KeyInfo(int keyType,
int keyID,
int algorithm)
This constructor initializes a KeyInfo instance with the specified key type, key index, and cryptographic algorithm. It is designed to handle different DUKPT key schemes with specific index ranges for each key type.
keyType - The type of the DUKPT key. Must be one of:
PINPadDevice.KEY_TYPE_TDUKPT - Traditional DUKPT keyPINPadDevice.KEY_TYPE_TDUKPT_2009 - DUKPT 2009 standard keyPINPadDevice.KEY_TYPE_TDUKPT_AES - AES-based DUKPT keykeyID - The key index (0-based). The valid range depends on the key type:
PINPadDevice.KEY_TYPE_TDUKPT or
PINPadDevice.KEY_TYPE_TDUKPT_2009: 0 to 49PINPadDevice.KEY_TYPE_TDUKPT_AES: 0 to 32algorithm - The cryptographic algorithm to be used with this key.
Examples include AlgorithmConstants.ALG_3DES for Triple DES
or AlgorithmConstants.ALG_AES for AES.IllegalArgumentException - if any of the following conditions are met:
keyType is not one of the valid DUKPT key typeskeyID is outside the valid range for the specified keyTypealgorithm is not supported for DUKPT operationsPINPadDevice,
AlgorithmConstants,
KeyInfo(int, int, int)public KeyInfo(int keyType,
int masterKeyID,
int keyID,
int algorithm)
KEY_TYPE_MK_SK.keyType - The type of the key, e.g., KEY_TYPE_MK_SK.masterKeyID - The master key index (0 to 49).keyID - The specific key index (0, 1, or 2).algorithm - The cryptographic algorithm, e.g., ALG_3DES.@Deprecated public int describeContents()
@Deprecated public void writeToParcel(Parcel dest, int flags)