public class DESedeSecureMessagingWrapper extends SecureMessagingWrapper implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static javax.crypto.spec.IvParameterSpec |
ZERO_IV_PARAM_SPEC |
Constructor and Description |
---|
DESedeSecureMessagingWrapper(javax.crypto.SecretKey ksEnc,
javax.crypto.SecretKey ksMac)
Constructs a secure messaging wrapper based on the secure messaging
session keys.
|
DESedeSecureMessagingWrapper(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.
|
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 DESedeSecureMessagingWrapper(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 DESedeSecureMessagingWrapper(javax.crypto.SecretKey ksEnc, javax.crypto.SecretKey ksMac, long ssc) throws java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException
ksEnc
- the session key for encryptionksMac
- the session key for macsssc
- the initial value of the send sequence counterjavax.crypto.NoSuchPaddingException
- when the available JCE providers cannot provide the necessary cryptographic primitivesjava.security.NoSuchAlgorithmException
- when the available JCE providers cannot provide the necessary cryptographic primitivespublic 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 apdupublic 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 apdulen
- length of the actual response apdupublic long getSendSequenceCounter()
getSendSequenceCounter
in class SecureMessagingWrapper