public class AESSecureMessagingWrapper extends SecureMessagingWrapper implements Serializable
Constructor and Description |
---|
AESSecureMessagingWrapper(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.
|
AESSecureMessagingWrapper(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 (in this case
"AES" ). |
int |
hashCode() |
String |
toString() |
ResponseAPDU |
unwrap(ResponseAPDU responseAPDU)
Unwraps the buffer of a response APDU.
|
CommandAPDU |
wrap(CommandAPDU commandAPDU)
Wraps the APDU buffer of a command apdu.
|
getMaxTranceiveLength, shouldCheckMAC
public AESSecureMessagingWrapper(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 AESSecureMessagingWrapper(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()
"AES"
).getType
in interface APDUWrapper
public long getSendSequenceCounter()
getSendSequenceCounter
in class SecureMessagingWrapper
public CommandAPDU wrap(CommandAPDU commandAPDU)
wrap
in interface APDUWrapper
commandAPDU
- buffer containing the command apdu.public 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
Copyright © 2018. All rights reserved.