Package org.jmrtd.protocol
Class BACAPDUSender
- java.lang.Object
-
- org.jmrtd.protocol.BACAPDUSender
-
- All Implemented Interfaces:
APDULevelBACCapable
public class BACAPDUSender extends Object implements APDULevelBACCapable
A low-level APDU sender to support the BAC protocol.- Since:
- 0.7.0
- Version:
- $Revision: 1799 $
- Author:
- The JMRTD team ([email protected])
-
-
Constructor Summary
Constructors Constructor Description BACAPDUSender(net.sf.scuba.smartcards.CardService service)
Creates an APDU sender for tranceiving BAC protocol APDUs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
sendGetChallenge()
Sends aGET CHALLENGE
command to the passport.byte[]
sendGetChallenge(net.sf.scuba.smartcards.APDUWrapper wrapper)
Sends aGET CHALLENGE
command to the passport.byte[]
sendMutualAuth(byte[] rndIFD, byte[] rndICC, byte[] kIFD, SecretKey kEnc, SecretKey kMac)
Sends anEXTERNAL AUTHENTICATE
command to the passport.
-
-
-
Method Detail
-
sendGetChallenge
public byte[] sendGetChallenge() throws net.sf.scuba.smartcards.CardServiceException
Sends aGET CHALLENGE
command to the passport.- Specified by:
sendGetChallenge
in interfaceAPDULevelBACCapable
- Returns:
- a byte array of length 8 containing the challenge
- Throws:
net.sf.scuba.smartcards.CardServiceException
- on tranceive error
-
sendGetChallenge
public byte[] sendGetChallenge(net.sf.scuba.smartcards.APDUWrapper wrapper) throws net.sf.scuba.smartcards.CardServiceException
Sends aGET CHALLENGE
command to the passport.- Parameters:
wrapper
- secure messaging wrapper- Returns:
- a byte array of length 8 containing the challenge
- Throws:
net.sf.scuba.smartcards.CardServiceException
- on tranceive error
-
sendMutualAuth
public byte[] sendMutualAuth(byte[] rndIFD, byte[] rndICC, byte[] kIFD, SecretKey kEnc, SecretKey kMac) throws net.sf.scuba.smartcards.CardServiceException
Sends anEXTERNAL AUTHENTICATE
command to the passport. This is part of BAC. The resulting byte array has length 32 and containsrndICC
(first 8 bytes),rndIFD
(next 8 bytes), their key materialkICC
(last 16 bytes).- Specified by:
sendMutualAuth
in interfaceAPDULevelBACCapable
- Parameters:
rndIFD
- our challengerndICC
- their challengekIFD
- our key materialkEnc
- the static encryption keykMac
- the static mac key- Returns:
- a byte array of length 32 containing the response that was sent
by the passport, decrypted (using
kEnc
) and verified (usingkMac
) - Throws:
net.sf.scuba.smartcards.CardServiceException
- on tranceive error
-
-