com.ecebs.rtd.enabler.common
Class APDUUtils

java.lang.Object
  extended by com.ecebs.rtd.enabler.common.APDUUtils

public class APDUUtils
extends Object

Provides utility methods for helping carrying out card operations.

Author:
kyleb

Method Summary
static byte[] constructAPDU(byte CLA, byte INS, byte P1, byte P2, byte[] data)
          Creates a byte array containg a valid APDU based on the supplied parameters.
static byte[] constructAPDU(byte CLA, byte INS, byte P1, byte P2, byte[] data, byte Le)
          Creates a byte array containg a valid APDU based on the supplied parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

constructAPDU

public static byte[] constructAPDU(byte CLA,
                                   byte INS,
                                   byte P1,
                                   byte P2,
                                   byte[] data)
Creates a byte array containg a valid APDU based on the supplied parameters. Lc will be determined by the size of data. If data == null, Lc will be omitted. If the payload is greater that 255 bytes, only the first 255 bytes will be inserted in to the created APDU.

Parameters:
CLA - Instruction class
INS - Instruction code
P1 - Instruction parameters for the command (1st byte)
P2 - Instruction parameters for the command (2nd byte)
data - Payload to be sent
Returns:
The created APDU

constructAPDU

public static byte[] constructAPDU(byte CLA,
                                   byte INS,
                                   byte P1,
                                   byte P2,
                                   byte[] data,
                                   byte Le)
Creates a byte array containg a valid APDU based on the supplied parameters. Lc will be determined by the size of data. If data == null, Lc will be set to 0. If the payload is greater that 255 bytes, only the first 255 bytes will be inserted in to the created APDU.

Parameters:
CLA - Instruction class
INS - Instruction code
P1 - Instruction parameters for the command (1st byte)
P2 - Instruction parameters for the command (2nd byte)
data - Payload to be sent
Le - Maximum number of response bytes expected
Returns:
The created APDU


Copyright © 2013 Ecebs Ltd. All Rights Reserved.