Search in sources :

Example 1 with MseSetAuthenticationKeyApduCommand

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

the class Dnie method setKeysToAuthentication.

/**
 * {@inheritDoc}
 */
@Override
public void setKeysToAuthentication(final byte[] refPublicKey, final byte[] refPrivateKey) throws ApduConnectionException {
    final CommandApdu apdu = new MseSetAuthenticationKeyApduCommand((byte) 0x00, refPublicKey, refPrivateKey);
    final ResponseApdu res = getConnection().transmit(apdu);
    if (!res.isOk()) {
        throw new SecureChannelException(// $NON-NLS-1$
        "Error durante el establecimiento de las claves publica y privada " + "para atenticacion (error: " + HexUtils.hexify(res.getBytes(), true) + // $NON-NLS-1$ //$NON-NLS-2$
        ")");
    }
}
Also used : CommandApdu(es.gob.jmulticard.apdu.CommandApdu) MseSetAuthenticationKeyApduCommand(es.gob.jmulticard.apdu.iso7816four.MseSetAuthenticationKeyApduCommand) SecureChannelException(es.gob.jmulticard.apdu.connection.cwa14890.SecureChannelException) ResponseApdu(es.gob.jmulticard.apdu.ResponseApdu)

Aggregations

CommandApdu (es.gob.jmulticard.apdu.CommandApdu)1 ResponseApdu (es.gob.jmulticard.apdu.ResponseApdu)1 SecureChannelException (es.gob.jmulticard.apdu.connection.cwa14890.SecureChannelException)1 MseSetAuthenticationKeyApduCommand (es.gob.jmulticard.apdu.iso7816four.MseSetAuthenticationKeyApduCommand)1