Search in sources :

Example 1 with RetriesLeftApduCommand

use of es.gob.jmulticard.apdu.dnie.RetriesLeftApduCommand in project jmulticard by ctt-gob-es.

the class Dnie 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);
    }
    return verifyResponse.getStatusWord().getLsb() - (byte) 0xC0;
}
Also used : CommandApdu(es.gob.jmulticard.apdu.CommandApdu) ResponseApdu(es.gob.jmulticard.apdu.ResponseApdu) BadPinException(es.gob.jmulticard.card.BadPinException) PinException(es.gob.jmulticard.card.PinException) RetriesLeftApduCommand(es.gob.jmulticard.apdu.dnie.RetriesLeftApduCommand) ApduConnectionException(es.gob.jmulticard.apdu.connection.ApduConnectionException)

Example 2 with RetriesLeftApduCommand

use of es.gob.jmulticard.apdu.dnie.RetriesLeftApduCommand in project jmulticard by ctt-gob-es.

the class Ceres 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);
    }
    return verifyResponse.getStatusWord().getLsb() - (byte) 0xC0;
}
Also used : CommandApdu(es.gob.jmulticard.apdu.CommandApdu) ResponseApdu(es.gob.jmulticard.apdu.ResponseApdu) BadPinException(es.gob.jmulticard.card.BadPinException) PinException(es.gob.jmulticard.card.PinException) RetriesLeftApduCommand(es.gob.jmulticard.apdu.dnie.RetriesLeftApduCommand) ApduConnectionException(es.gob.jmulticard.apdu.connection.ApduConnectionException)

Aggregations

CommandApdu (es.gob.jmulticard.apdu.CommandApdu)2 ResponseApdu (es.gob.jmulticard.apdu.ResponseApdu)2 ApduConnectionException (es.gob.jmulticard.apdu.connection.ApduConnectionException)2 RetriesLeftApduCommand (es.gob.jmulticard.apdu.dnie.RetriesLeftApduCommand)2 BadPinException (es.gob.jmulticard.card.BadPinException)2 PinException (es.gob.jmulticard.card.PinException)2