use of es.gob.jmulticard.apdu.gide.VerifyApduCommand in project jmulticard by ctt-gob-es.
the class SmartCafePkcs15Applet method verifyPin.
@Override
public void verifyPin(final PasswordCallback psc) throws ApduConnectionException, PinException {
if (psc == null) {
throw new IllegalArgumentException(// $NON-NLS-1$
"No se puede verificar el titular con un PasswordCallback nulo");
}
VerifyApduCommand verifyCommandApdu = new VerifyApduCommand(psc);
final ResponseApdu verifyResponse = getConnection().transmit(verifyCommandApdu);
verifyCommandApdu = null;
if (!verifyResponse.isOk()) {
if (verifyResponse.getStatusWord().getMsb() == ERROR_PIN_SW1) {
throw new BadPinException(verifyResponse.getStatusWord().getLsb() - (byte) 0xC0);
} else if (verifyResponse.getStatusWord().getMsb() == (byte) 0x69 && verifyResponse.getStatusWord().getLsb() == (byte) 0x83) {
throw new AuthenticationModeLockedException();
} else {
throw new ApduConnectionException(new Iso7816FourCardException(// $NON-NLS-1$ //$NON-NLS-2$
"Error en la verificacion de PIN (" + verifyResponse.getStatusWord() + ")", verifyResponse.getStatusWord()));
}
}
}
Aggregations