My CHV verification algorithm works if the pin is 8
chars long but if it's fewer than 8 it fails.
Can somebody tell me what is wrong with the following
code:
boolean performCHV(CardChannel channel, int numCHV)
throws CardServiceInabilityException,
CardTerminalException, GSMException
{
byte [] password = new byte [8];
performCHVCommand.setLength(0);
performCHVCommand.append(GSMAPDU.CLASS_BYTE);
performCHVCommand.append(GSMAPDU.VERIFY_BYTE);
performCHVCommand.append((byte)0x00);
performCHVCommand.append((byte)numCHV);
performCHVCommand.append((byte)0x08);
performCHVCommand.append(password);
CardTerminalIOControl ioctrl = new
CardTerminalIOControl(8, 3000, null, null);
CHVControl chvctrl = new CHVControl("Enter
your password", numCHV, CHVEncoder.STRING_ENCODING, 0,
ioctrl);
ResponseAPDU response = null;
response =
(ResponseAPDU)channel.sendVerifiedAPDU(performCHVCommand,
chvctrl, getCHVDialog());
GSMResponseAPDU resp = new
GSMResponseAPDU(response.getBytes());
} // performCHV
final CHVDialog getCHVDialog()
{
return CHV_dialog;
}
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.