|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ibm.jc.JCUtil
Various utility functions for use with an OpenPlatform/JavaCard.
| Method Summary | |
static int |
arrayFill(byte[] a,
int apos,
int len,
byte fill)
Fills the byte array beginning at the specified position, for the specified length with the specified byte value. |
static int |
atoi(java.lang.String str)
Return int value of given numerical String (dec, hex, oct). |
static byte[] |
check9000(byte[] apdu)
Check if response APDU has status 9000. |
static byte[] |
chop9000(byte[] apdu)
Check if response APDU has status 9000 and chop status. |
static int |
cmp(byte[] a,
int apos,
byte[] b,
int bpos,
int len)
Array compare. |
static short |
crc(byte[] buf,
int off,
int len)
compute CCITT-CRC for given byte array range. |
static int |
getMSBF(byte[] b,
int pos,
int n)
Get Most Significant Byte First. |
static int |
getStatus(byte[] apdu)
Extract status from given response APDU. |
static byte |
lrc(byte[] data,
int off,
int len)
|
static void |
putMSBF(int v,
byte[] b,
int pos,
int n)
Put Most Significant Byte First. |
static short |
tclcrc(byte[] buf,
int off,
int len)
compute ISO 14443-3 CRC for given byte array range. |
static short |
updatecrc(short fcs,
byte b)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void putMSBF(int v,
byte[] b,
int pos,
int n)
v - Value to be written.b - target byte array.n - number of bytes to be written.
public static int getMSBF(byte[] b,
int pos,
int n)
b - byte array to be read.n - number of bytes to be read.
public static int cmp(byte[] a,
int apos,
byte[] b,
int bpos,
int len)
a - byte array A.apos - offset into the A array.bpos - offset into the B array.len - number of bytes to be compared.
public static int arrayFill(byte[] a,
int apos,
int len,
byte fill)
a - target byte array.apos - offset into the array where to start filling.len - number of bytes to be filled.fill - the byte value used for filling.
public static int getStatus(byte[] apdu)
JCException - if response APDU is shorter than two bytespublic static byte[] check9000(byte[] apdu)
JCException - if status is not 9000public static byte[] chop9000(byte[] apdu)
JCException - if status is not 9000public static int atoi(java.lang.String str)
public static byte lrc(byte[] data,
int off,
int len)
public static short crc(byte[] buf,
int off,
int len)
public static short tclcrc(byte[] buf,
int off,
int len)
public static short updatecrc(short fcs,
byte b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||