Search in sources :

Example 1 with InternalAuthenticateApduCommand

use of es.gob.jmulticard.apdu.iso7816four.InternalAuthenticateApduCommand in project jmulticard by ctt-gob-es.

the class Dnie method getInternalAuthenticateMessage.

/**
 * {@inheritDoc}
 */
@Override
public byte[] getInternalAuthenticateMessage(final byte[] randomIfd, final byte[] chrCCvIfd) throws ApduConnectionException {
    final CommandApdu apdu = new InternalAuthenticateApduCommand((byte) 0x00, randomIfd, chrCCvIfd);
    final ResponseApdu res = getConnection().transmit(apdu);
    if (res.isOk()) {
        return res.getData();
    }
    throw new ApduConnectionException(// $NON-NLS-1$
    "Respuesta invalida en la obtencion del mensaje de autenticacion interna con el codigo: " + res.getStatusWord());
}
Also used : CommandApdu(es.gob.jmulticard.apdu.CommandApdu) ResponseApdu(es.gob.jmulticard.apdu.ResponseApdu) ApduConnectionException(es.gob.jmulticard.apdu.connection.ApduConnectionException) InternalAuthenticateApduCommand(es.gob.jmulticard.apdu.iso7816four.InternalAuthenticateApduCommand)

Aggregations

CommandApdu (es.gob.jmulticard.apdu.CommandApdu)1 ResponseApdu (es.gob.jmulticard.apdu.ResponseApdu)1 ApduConnectionException (es.gob.jmulticard.apdu.connection.ApduConnectionException)1 InternalAuthenticateApduCommand (es.gob.jmulticard.apdu.iso7816four.InternalAuthenticateApduCommand)1