Code: Select all
OwnerPIN mypin;
private FirstApp(byte bArray[], short bOffset, byte bLength){
backSomething = new byte[BS_LENGTH];
mypin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);
byte pin[]={0x00,0x00,0x00,0x00};
mypin.update (pin, (short) 0, (byte) 0x04);
register();
}
private void verifypin(APDU apdu){
byte[] buffer = apdu.getBuffer();
byte byteRead = (byte) apdu.setIncomingAndReceive();
if ( mypin.check ( buffer, ISO7816.OFFSET_CDATA, byteRead ) == false )
ISOException.throwIt(SW_VERIFICATION_FAILED);
}