Appendix C - Cryptography
C.4.1 Send data to DynaPro/DynaPro Go/DynaPro Mini
To send data use sendBigBlockData or use appropriate function like setCAPublicKey.
// Compose TLV Message
TLV_ComposeMessage(message, SerialNumber, out bOutMessage, out
nOutMessage);
// Use CBC MAC to encrypt message and add MAC, reference to C4
CBC_MAC(bOutMessage, nOutMessage, out bSecuredMessage, out
nSecuredMessageLength);
SetCAPublicKeyWithOperation(operation, bSecuredMessage,
nSecuredMessageLength);
C.4.2 Receive data from DynaPro/DynaPro Go/DynaPro Mini
Parse the data through TLV format. For encrypted data tag, use TDES_Decrypt_CBC to decrypt it.
C.5
Example of RequestSmartCard
Following sample code demonstrate an EMV transaction flow.
C.5.1 Host: RequestSmartCard
byte[] Amt = new byte[6]{0x0,0x0,0x0,0x01,0x0,0x0};
byte[] Cashback = new byte[6] {0x0,0x0,0x0,0x0,0x0,0x0};
int retCode = ipad.requestSmartCard (7,20,20,1,2,Amt,4,Cashback,null);
C.5.2 Device: OnEMVDataCompleteEvent
Host will receive callback event OnEMVDataCompleteEvent. In the callback, will extract TLV data. Data
format can reference to document 99875585 – 3.5.2 ARQC Request
void onEMVDatatComplete(byte status, byte[] data)
{
// for acquirer data
TLVData tlv = new TLVData(data);
Byte[] KSN = tlv.GetKSN();
}
C.5.3 Host: SendAcquirerResponse
Host should send out acquirer response to complete the EMV transaction, or transaction will be denied
with time out.
To generate the response data, reference to document 99875585 – 3.5.2.3 ARQC Response
byte[] approve[6] = new
byte[6]{(byte)0x70,0x04,(byte)0x8A,0x02,0x30,0x30};
byte[] Msg = new byte[47];
// Set Data Length
Msg[0] = 0;
Msg[1] = 45;
Msg[2] = (byte)0xF9;
Msg[3] = (byte)0x82;
IPAD, DynaPro, DynaPro Go, and DynaPro Mini| PIN Encryption Devices | Programmer's Reference (Microsoft Windows Store)
Page 67
Need help?
Do you have a question about the IPAD and is the answer not in the manual?
Questions and answers