public interface PINPadExtendDevice extends PINPadDevice
The PINPad device object is obtained from the POSTerminal
, its' as follows:
PINPadExtendDevice pinPadDevice = (PINPadExtendDevice) POSTerminal.getInstance().getDevice("com.cloudpos.device.pinpad");Among them, the "com.cloudpos.device.pinpad" string is to identify the PINPad device, defined by the specific implementation.
Uses the PINPad device object to control the operation of the PINPad device.
An app can request permission to access the device, as shown below:
PINPadDevice.listenForPinBlock(KeyInfo, String, boolean, OperationListener, int)
and PINPadDevice.waitForPinBlock(KeyInfo, String, boolean, int)
.
PINPadDevice.calculateMac(KeyInfo, int, byte[])
.
PINPadDevice.encryptData(KeyInfo, byte[])
.
PINPadDevice.updateUserKey(int, int, byte[],int, byte[])
and PINPadDevice.updateUserKey(int, int, byte[])
.
Device
CHECK_TYPE_CUP, CHECK_TYPE_NONE, KEY_TYPE_FIX, KEY_TYPE_MK_SK, KEY_TYPE_PUBLIC, KEY_TYPE_TDUKPT, KEY_TYPE_TDUKPT_2009, KEY_TYPE_TDUKPT_2009_RESPONSE, USER_KEY_ID_DATA, USER_KEY_ID_MAC, USER_KEY_ID_PIN
Modifier and Type | Method and Description |
---|---|
byte[] |
decryptData(KeyInfo keyInfo,
byte[] cipherdata,
int mode,
byte[] IV)
Decrypt the data using user key defined in
KeyInfo |
byte[] |
getMasterKeyCheckValue(int masterKeyID,
int algoCheckValue)
Get check value for master key。
|
byte[] |
getTransportKeyCheckValue(int keyID,
int checkType)
Get check value for transport key.
|
calculateMac, calculateResponseMac, changePin, clearText, createPin, encryptData, encryptData, getDukptStatus, getLastPINLength, getMkStatus, getRandom, getSessionKeyCheckValue, getSkStatus, getSN, listenForOfflinePin, listenForPinBlock, listenForPinBlock, open, selectPinblockFormat, setAllowByPass, setGUIConfiguration, setGUIConfiguration, setPINLength, setupCallbackHandler, showText, showText, updateMasterKey, updateMasterKeyWithCheck, updateMasterKeyWithCheckByMK, updateUserKey, updateUserKey, updateUserKey, updateUserKey, updateUserKeyWithCheck, updateUserKeyWithTR31Format, verifyResponseMac, waitForOfflinePin, waitForPinBlock, waitForPinBlock
cancelRequest, close, getFailCount, getUsageCount, open
byte[] getTransportKeyCheckValue(int keyID, int checkType) throws DeviceException
keyID
- key index。checkType
- now only support the default format, must be specified with 0DeviceException
- For specific definitions, refer to the documentation of DeviceException
.byte[] getMasterKeyCheckValue(int masterKeyID, int algoCheckValue) throws DeviceException
masterKeyID
- master key index。algoCheckValue
- ALGO_CHECK_VALUE 0--ALGO_CHECK_VALUE_DEFAULT;1--ALGO_CHECK_VALUE_SE919DeviceException
- For specific definitions, refer to the documentation of DeviceException
.byte[] decryptData(KeyInfo keyInfo, byte[] cipherdata, int mode, byte[] IV) throws DeviceException
KeyInfo
keyInfo
- cipherdata
- data buffer.mode
- 0--MODE_EBC;1--MODE_CBC;2--MODE_CFB;3--MODE_OFB.NoPadding.IV
- initial vector, only for CBC, CFB, OFB modeDeviceException
- for the standard reasons that are documented in
DeviceException
.