Package org.jmrtd.protocol
Class SecureMessagingWrapper
- java.lang.Object
-
- org.jmrtd.protocol.SecureMessagingWrapper
-
- All Implemented Interfaces:
Serializable
,net.sf.scuba.smartcards.APDUWrapper
- Direct Known Subclasses:
AESSecureMessagingWrapper
,DESedeSecureMessagingWrapper
public abstract class SecureMessagingWrapper extends Object implements Serializable, net.sf.scuba.smartcards.APDUWrapper
Secure messaging wrapper base class.- Version:
- $Revision: 1799 $
- Author:
- The JMRTD team
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SecureMessagingWrapper(int maxTranceiveLength, boolean shouldCheckMAC)
Creates a secure messaging wrapper.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SecretKey
getEncryptionKey()
Returns the shared key for encrypting APDU payloads.abstract SecretKey
getMACKey()
Returns the shared key for computing message authentication codes over APDU payloads.int
getMaxTranceiveLength()
Returns the maximum tranceive length of wrapped command and response APDUs, typical values are 256 and 65536.abstract long
getSendSequenceCounter()
Returns the send sequence counter.boolean
shouldCheckMAC()
Returns a boolean indicating whether this wrapper will check the MAC in wrapped response APDUs.
-
-
-
Constructor Detail
-
SecureMessagingWrapper
public SecureMessagingWrapper(int maxTranceiveLength, boolean shouldCheckMAC)
Creates a secure messaging wrapper.- Parameters:
maxTranceiveLength
- Returns the maximum tranceive length of wrapped command and response APDUs, typical values are 256 and 65536shouldCheckMAC
- a boolean indicating whether this wrapper will check the MAC in wrapped response APDUs
-
-
Method Detail
-
getSendSequenceCounter
public abstract long getSendSequenceCounter()
Returns the send sequence counter.- Returns:
- the send sequence counter
-
getEncryptionKey
public abstract SecretKey getEncryptionKey()
Returns the shared key for encrypting APDU payloads.- Returns:
- the encryption key
-
getMACKey
public abstract SecretKey getMACKey()
Returns the shared key for computing message authentication codes over APDU payloads.- Returns:
- the MAC key
-
shouldCheckMAC
public boolean shouldCheckMAC()
Returns a boolean indicating whether this wrapper will check the MAC in wrapped response APDUs.- Returns:
- a boolean indicating whether this wrapper will check the MAC in wrapped response APDUs
-
getMaxTranceiveLength
public int getMaxTranceiveLength()
Returns the maximum tranceive length of wrapped command and response APDUs, typical values are 256 and 65536.- Returns:
- the maximum tranceive length of wrapped command and response APDUs
-
-