Search in sources :

Example 1 with GetChallenge

use of org.openecard.common.apdu.GetChallenge in project open-ecard by ecsec.

the class TerminalAuthentication method getChallenge.

/**
 * Gets a challenge from the PICC.
 * Sends a Get Challenge APDU. (Protocol step 3)
 * See BSI-TR-03110, version 2.10, part 3, B.11.6.
 *
 * @return Challenge
 * @throws ProtocolException
 */
public byte[] getChallenge() throws ProtocolException {
    try {
        CardCommandAPDU getChallenge = new GetChallenge();
        CardResponseAPDU response = getChallenge.transmit(dispatcher, slotHandle);
        return response.getData();
    } catch (APDUException e) {
        throw new ProtocolException(e.getResult());
    }
}
Also used : CardCommandAPDU(org.openecard.common.apdu.common.CardCommandAPDU) ProtocolException(org.openecard.common.sal.protocol.exception.ProtocolException) APDUException(org.openecard.common.apdu.exception.APDUException) CardResponseAPDU(org.openecard.common.apdu.common.CardResponseAPDU) GetChallenge(org.openecard.common.apdu.GetChallenge)

Aggregations

GetChallenge (org.openecard.common.apdu.GetChallenge)1 CardCommandAPDU (org.openecard.common.apdu.common.CardCommandAPDU)1 CardResponseAPDU (org.openecard.common.apdu.common.CardResponseAPDU)1 APDUException (org.openecard.common.apdu.exception.APDUException)1 ProtocolException (org.openecard.common.sal.protocol.exception.ProtocolException)1