public class SecureMessagingWrapper
extends java.lang.Object
implements net.sf.scuba.smartcards.APDUWrapper, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static javax.crypto.spec.IvParameterSpec |
ZERO_IV_PARAM_SPEC |
Constructor and Description |
---|
SecureMessagingWrapper(javax.crypto.SecretKey ksEnc,
javax.crypto.SecretKey ksMac)
Constructs a secure messaging wrapper based on the secure messaging
session keys.
|
SecureMessagingWrapper(javax.crypto.SecretKey ksEnc,
javax.crypto.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.
|
SecureMessagingWrapper(javax.crypto.SecretKey ksEnc,
javax.crypto.SecretKey ksMac,
java.lang.String cipherAlg,
java.lang.String macAlg) |
SecureMessagingWrapper(javax.crypto.SecretKey ksEnc,
javax.crypto.SecretKey ksMac,
java.lang.String cipherAlg,
java.lang.String macAlg,
long ssc) |
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 apdu buffer
rapdu 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 static final javax.crypto.spec.IvParameterSpec ZERO_IV_PARAM_SPEC
public SecureMessagingWrapper(javax.crypto.SecretKey ksEnc, javax.crypto.SecretKey ksMac) throws java.security.GeneralSecurityException
0L
.ksEnc
- the session key for encryptionksMac
- the session key for macsjava.security.GeneralSecurityException
- when the available JCE providers cannot provide the necessary
cryptographic primitives
("DESede/CBC/Nopadding" Cipher, "ISO9797Alg3Mac" Mac).public SecureMessagingWrapper(javax.crypto.SecretKey ksEnc, javax.crypto.SecretKey ksMac, long ssc) throws java.security.GeneralSecurityException
ksEnc
- the session key for encryptionksMac
- the session key for macsssc
- the initial value of the send sequence counterjava.security.GeneralSecurityException
- when the available JCE providers cannot provide the necessary
cryptographic primitives ("DESede/CBC/Nopadding" Cipher,
"ISO9797Alg3Mac" Mac).public SecureMessagingWrapper(javax.crypto.SecretKey ksEnc, javax.crypto.SecretKey ksMac, java.lang.String cipherAlg, java.lang.String macAlg) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public SecureMessagingWrapper(javax.crypto.SecretKey ksEnc, javax.crypto.SecretKey ksMac, java.lang.String cipherAlg, java.lang.String macAlg, long ssc) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public long getSendSequenceCounter()
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)
rapdu
of a response apdu.unwrap
in interface net.sf.scuba.smartcards.APDUWrapper
responseAPDU
- buffer containing the response apdu.len
- length of the actual response apdu.