public class DESedeSecureMessagingWrapper extends SecureMessagingWrapper implements Serializable
Modifier and Type | Field and Description |
---|---|
static IvParameterSpec |
ZERO_IV_PARAM_SPEC
Initialization vector consisting of 8 zero bytes.
|
Constructor and Description |
---|
DESedeSecureMessagingWrapper(SecretKey ksEnc,
SecretKey ksMac)
Constructs a secure messaging wrapper based on the secure messaging
session keys.
|
DESedeSecureMessagingWrapper(SecretKey ksEnc,
SecretKey ksMac,
boolean shouldCheckMAC)
Constructs a secure messaging wrapper based on the secure messaging
session keys.
|
DESedeSecureMessagingWrapper(SecretKey ksEnc,
SecretKey ksMac,
int maxTranceiveLength,
boolean shouldCheckMAC,
long ssc)
Constructs a secure messaging wrapper based on the secure messaging
session keys and the initial value of the send sequence counter.
|
DESedeSecureMessagingWrapper(SecretKey ksEnc,
SecretKey ksMac,
long ssc)
Constructs a secure messaging wrapper based on the secure messaging
session keys and the initial value of the send sequence counter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
SecretKey |
getEncryptionKey()
Gets the shared key for encrypting APDU payloads.
|
SecretKey |
getMACKey()
Get the shared key for computing message authentication codes over APDU payloads.
|
long |
getSendSequenceCounter()
Gets the current value of the send sequence counter.
|
String |
getType()
Returns the type of secure messaging wrapper.
|
int |
hashCode() |
String |
toString() |
ResponseAPDU |
unwrap(ResponseAPDU responseAPDU)
Unwraps the APDU buffer of a response APDU.
|
CommandAPDU |
wrap(CommandAPDU commandAPDU)
Wraps the APDU buffer of a command APDU.
|
getMaxTranceiveLength, shouldCheckMAC
public static final IvParameterSpec ZERO_IV_PARAM_SPEC
public DESedeSecureMessagingWrapper(SecretKey ksEnc, SecretKey ksMac) throws GeneralSecurityException
0L
.ksEnc
- the session key for encryptionksMac
- the session key for macsGeneralSecurityException
- when the available JCE providers cannot provide the necessary
cryptographic primitives
("DESede/CBC/Nopadding"
Cipher, "ISO9797Alg3Mac"
Mac).public DESedeSecureMessagingWrapper(SecretKey ksEnc, SecretKey ksMac, boolean shouldCheckMAC) throws GeneralSecurityException
0L
.ksEnc
- the session key for encryptionksMac
- the session key for macsshouldCheckMAC
- a boolean indicating whether this wrapper will check the MAC in wrapped response APDUsGeneralSecurityException
- when the available JCE providers cannot provide the necessary
cryptographic primitives
("DESede/CBC/Nopadding"
Cipher, "ISO9797Alg3Mac"
Mac).public DESedeSecureMessagingWrapper(SecretKey ksEnc, SecretKey ksMac, long ssc) throws GeneralSecurityException
ksEnc
- the session key for encryptionksMac
- the session key for macsssc
- the initial value of the send sequence counterGeneralSecurityException
- when the available JCE providers cannot provide the necessary cryptographic primitivespublic DESedeSecureMessagingWrapper(SecretKey ksEnc, SecretKey ksMac, int maxTranceiveLength, boolean shouldCheckMAC, long ssc) throws GeneralSecurityException
ksEnc
- the session key for encryptionksMac
- the session key for macsmaxTranceiveLength
- the maximum tranceive length, typical values are 256 or 65536shouldCheckMAC
- a boolean indicating whether this wrapper will check the MAC in wrapped response APDUsssc
- the initial value of the send sequence counterGeneralSecurityException
- when the available JCE providers cannot provide the necessary cryptographic primitivespublic String getType()
"DESede"
will be returned.getType
in interface APDUWrapper
public CommandAPDU wrap(CommandAPDU commandAPDU)
wrap
in interface APDUWrapper
commandAPDU
- buffer containing the command APDUpublic ResponseAPDU unwrap(ResponseAPDU responseAPDU)
unwrap
in interface APDUWrapper
responseAPDU
- the response APDUpublic SecretKey getEncryptionKey()
SecureMessagingWrapper
getEncryptionKey
in class SecureMessagingWrapper
public SecretKey getMACKey()
SecureMessagingWrapper
getMACKey
in class SecureMessagingWrapper
public long getSendSequenceCounter()
getSendSequenceCounter
in class SecureMessagingWrapper
Copyright © 2018. All rights reserved.