use of es.gob.jmulticard.apdu.bit4id.stcm.VerifyApduCommand in project jmulticard by ctt-gob-es.
the class StCard method verifyPin.
@Override
public void verifyPin(final PasswordCallback pinPc) throws ApduConnectionException, PinException {
if (pinPc == null) {
// $NON-NLS-1$
throw new BadPinException("No se ha establecido un PasswordCallback");
}
final CommandApdu chv = new VerifyApduCommand(CLA, pinPc);
final ResponseApdu verifyResponse = sendArbitraryApdu(chv);
if (!verifyResponse.isOk()) {
if (verifyResponse.getStatusWord().getMsb() == ERROR_PIN_SW1) {
throw new BadPinException(verifyResponse.getStatusWord().getLsb() - (byte) 0xC0);
}
throw new ApduConnectionException(// $NON-NLS-1$
"Error en el envio de la verificacion de PIN con respuesta: " + verifyResponse.getStatusWord());
}
}
Aggregations