use of es.gob.jmulticard.apdu.gide.RetriesLeftApduCommand in project jmulticard by ctt-gob-es.
the class SmartCafePkcs15Applet method getPinRetriesLeft.
private int getPinRetriesLeft() throws PinException {
final CommandApdu verifyCommandApdu = new RetriesLeftApduCommand();
final ResponseApdu verifyResponse;
try {
verifyResponse = getConnection().transmit(verifyCommandApdu);
} catch (final ApduConnectionException e) {
throw new PinException(// $NON-NLS-1$
"Error obteniendo el PIN del CallbackHandler: " + e, // $NON-NLS-1$
e);
}
if (verifyResponse.isOk() || verifyResponse.getBytes().length > 2) {
return verifyResponse.getBytes()[1];
}
throw new PinException(// $NON-NLS-1$
"Error comprobando los intentos restantes de PIN con respuesta: " + HexUtils.hexify(verifyResponse.getBytes(), true));
}
Aggregations