public final class DataChannelCipherSDK extends java.lang.Object implements IDataChannelChipher
Modifier and Type | Field and Description |
---|---|
private boolean |
m_bSingleKey |
private long |
m_DecMsgCounter |
private byte[] |
m_decryptHelperBuff |
private long |
m_EncMsgCounter |
private javax.crypto.Cipher |
m_recvEngine |
private byte[] |
m_recvIV |
private javax.crypto.spec.SecretKeySpec |
m_recvKey |
private javax.crypto.Cipher |
m_sendEngine |
private byte[] |
m_sendIV |
private javax.crypto.spec.SecretKeySpec |
m_sendKey |
private static java.lang.Object[] |
ms_constructorargsGCMSpec |
private static java.lang.reflect.Constructor |
ms_constructorGCMSpec |
Constructor and Description |
---|
DataChannelCipherSDK() |
DataChannelCipherSDK(java.lang.String provider) |
Modifier and Type | Method and Description |
---|---|
private static java.security.spec.AlgorithmParameterSpec |
createGCMParameterSpec(byte[] iv) |
private static void |
createIV(byte[] iv,
long counter) |
void |
decryptGCM2(byte[] from,
int ifrom,
byte[] to,
int ito,
int len) |
void |
encryptGCM1(byte[] from,
int ifrom,
byte[] to,
int ito,
int len) |
byte[] |
getKeys()
Returns the currently used key(s) for encryption/decryption.
|
static int |
getMACSize() |
int |
setEncryptionKeysAES(byte[] keys)
Set both keys to different values, if keys.length == 2 * KEY_SIZE, else
set both keys to the same value.
|
int |
setEncryptionKeysAES(byte[] keys,
int offset,
int keylen)
Set both keys to different values, if keys.length == 2 * KEY_SIZE, else
set both keys to the same value.
|
private int |
setRecvKey(byte[] key,
int offset,
int len) |
private int |
setSendKey(byte[] key,
int offset,
int len) |
private javax.crypto.Cipher m_sendEngine
private javax.crypto.Cipher m_recvEngine
private long m_EncMsgCounter
private long m_DecMsgCounter
private javax.crypto.spec.SecretKeySpec m_sendKey
private javax.crypto.spec.SecretKeySpec m_recvKey
private byte[] m_sendIV
private byte[] m_recvIV
private boolean m_bSingleKey
private byte[] m_decryptHelperBuff
private static java.lang.reflect.Constructor ms_constructorGCMSpec
private static java.lang.Object[] ms_constructorargsGCMSpec
public DataChannelCipherSDK()
public DataChannelCipherSDK(java.lang.String provider)
private int setSendKey(byte[] key, int offset, int len)
private int setRecvKey(byte[] key, int offset, int len)
public int setEncryptionKeysAES(byte[] keys)
IDataChannelChipher
setEncryptionKeysAES
in interface IDataChannelChipher
keys
- Array which contains key(s) (send and receive key)public int setEncryptionKeysAES(byte[] keys, int offset, int keylen)
IDataChannelChipher
setEncryptionKeysAES
in interface IDataChannelChipher
keys
- Array which contains key(s) (send and receive key)public byte[] getKeys()
IDataChannelChipher
getKeys
in interface IDataChannelChipher
private static void createIV(byte[] iv, long counter)
private static java.security.spec.AlgorithmParameterSpec createGCMParameterSpec(byte[] iv)
public void encryptGCM1(byte[] from, int ifrom, byte[] to, int ito, int len) throws java.lang.Exception
encryptGCM1
in interface IDataChannelChipher
java.lang.Exception
public void decryptGCM2(byte[] from, int ifrom, byte[] to, int ito, int len) throws java.lang.Exception
decryptGCM2
in interface IDataChannelChipher
java.lang.Exception
public static int getMACSize()
Copyright © 2023. All rights reserved.