Modifier and Type | Field and Description |
---|---|
protected TlsCryptoParameters |
cryptoParams |
protected TlsAEADCipherImpl |
decryptCipher |
protected byte[] |
decryptImplicitNonce |
protected TlsAEADCipherImpl |
encryptCipher |
protected byte[] |
encryptImplicitNonce |
protected int |
macSize |
static int |
NONCE_RFC5288 |
static int |
NONCE_RFC7905 |
protected int |
nonceMode |
protected int |
record_iv_length |
Constructor and Description |
---|
TlsAEADCipher(TlsCryptoParameters cryptoParams,
TlsAEADCipherImpl encryptCipher,
TlsAEADCipherImpl decryptCipher,
int cipherKeySize,
int macSize) |
TlsAEADCipher(TlsCryptoParameters cryptoParams,
TlsAEADCipherImpl encryptCipher,
TlsAEADCipherImpl decryptCipher,
int cipherKeySize,
int macSize,
int nonceMode) |
Modifier and Type | Method and Description |
---|---|
byte[] |
decodeCiphertext(long seqNo,
short type,
byte[] ciphertext,
int offset,
int len)
Validate and decrypt the passed in cipher text using the current cipher suite.
|
byte[] |
encodePlaintext(long seqNo,
short type,
byte[] plaintext,
int offset,
int len)
Encrypt and MAC the passed in plain text using the current cipher suite.
|
protected byte[] |
getAdditionalData(long seqNo,
short type,
int len) |
int |
getPlaintextLimit(int ciphertextLimit)
Return the maximum size for the plaintext given ciphertextlimit bytes of ciphertext.
|
public static final int NONCE_RFC5288
public static final int NONCE_RFC7905
protected final TlsCryptoParameters cryptoParams
protected final int macSize
protected final int record_iv_length
protected final TlsAEADCipherImpl decryptCipher
protected final TlsAEADCipherImpl encryptCipher
protected final byte[] encryptImplicitNonce
protected final byte[] decryptImplicitNonce
protected final int nonceMode
public TlsAEADCipher(TlsCryptoParameters cryptoParams, TlsAEADCipherImpl encryptCipher, TlsAEADCipherImpl decryptCipher, int cipherKeySize, int macSize) throws java.io.IOException
java.io.IOException
public TlsAEADCipher(TlsCryptoParameters cryptoParams, TlsAEADCipherImpl encryptCipher, TlsAEADCipherImpl decryptCipher, int cipherKeySize, int macSize, int nonceMode) throws java.io.IOException
java.io.IOException
public int getPlaintextLimit(int ciphertextLimit)
TlsCipher
getPlaintextLimit
in interface TlsCipher
ciphertextLimit
- the maximum number of bytes of ciphertext.public byte[] encodePlaintext(long seqNo, short type, byte[] plaintext, int offset, int len) throws java.io.IOException
TlsCipher
encodePlaintext
in interface TlsCipher
seqNo
- sequence number of the message represented by plaintext.type
- content type of the message represented by plaintext.plaintext
- array holding input plain text to the cipher.offset
- offset into input array the plain text starts at.len
- length of the plaintext in the array.java.io.IOException
public byte[] decodeCiphertext(long seqNo, short type, byte[] ciphertext, int offset, int len) throws java.io.IOException
TlsCipher
decodeCiphertext
in interface TlsCipher
seqNo
- sequence number of the message represented by ciphertext.type
- content type of the message represented by ciphertext.ciphertext
- array holding input cipher text to the cipher.offset
- offset into input array the cipher text starts at.len
- length of the cipher text in the array.java.io.IOException
protected byte[] getAdditionalData(long seqNo, short type, int len) throws java.io.IOException
java.io.IOException