public class AESSecureMessagingWrapper extends SecureMessagingWrapper implements java.io.Serializable
Constructor and Description |
---|
AESSecureMessagingWrapper(javax.crypto.SecretKey ksEnc,
javax.crypto.SecretKey ksMac,
long sscIV,
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 |
---|---|
long |
getSendSequenceCounter()
Gets the current value of the send sequence counter.
|
net.sf.scuba.smartcards.ResponseAPDU |
unwrap(net.sf.scuba.smartcards.ResponseAPDU responseAPDU,
int len)
Unwraps the buffer of a response APDU.
|
net.sf.scuba.smartcards.CommandAPDU |
wrap(net.sf.scuba.smartcards.CommandAPDU commandAPDU)
Wraps the apdu buffer
capdu of a command apdu. |
public AESSecureMessagingWrapper(javax.crypto.SecretKey ksEnc, javax.crypto.SecretKey ksMac, long sscIV, long ssc) throws java.security.GeneralSecurityException
ksEnc
- the session key for encryptionksMac
- the session key for macssscIV
- the send sequence counter to use as initialization vectorssc
- the initial value of the send sequence counterjava.security.GeneralSecurityException
- when the available JCE providers cannot provide the necessary cryptographic primitivespublic long getSendSequenceCounter()
getSendSequenceCounter
in class SecureMessagingWrapper
public net.sf.scuba.smartcards.CommandAPDU wrap(net.sf.scuba.smartcards.CommandAPDU commandAPDU)
capdu
of a command apdu.
As a side effect, this method increments the internal send
sequence counter maintained by this wrapper.wrap
in interface net.sf.scuba.smartcards.APDUWrapper
commandAPDU
- buffer containing the command apdu.public net.sf.scuba.smartcards.ResponseAPDU unwrap(net.sf.scuba.smartcards.ResponseAPDU responseAPDU, int len)
unwrap
in interface net.sf.scuba.smartcards.APDUWrapper
responseAPDU
- buffer containing the response apdulen
- length of the actual response apdu