| Modifier and Type | Field and Description |
|---|---|
static int |
AEAD_CCM |
static int |
AEAD_CHACHA20_POLY1305 |
static int |
AEAD_GCM |
protected AEADNonceGenerator |
encryptNonceGenerator |
| Constructor and Description |
|---|
TlsAEADCipher(TlsCryptoParameters cryptoParams,
TlsAEADCipherImpl encryptCipher,
TlsAEADCipherImpl decryptCipher,
int keySize,
int macSize,
int aeadType) |
| Modifier and Type | Method and Description |
|---|---|
TlsDecodeResult |
decodeCiphertext(long seqNo,
short recordType,
ProtocolVersion recordVersion,
byte[] ciphertext,
int ciphertextOffset,
int ciphertextLength)
Decode the passed in ciphertext using the current bulk cipher.
|
TlsEncodeResult |
encodePlaintext(long seqNo,
short contentType,
ProtocolVersion recordVersion,
int headerAllocation,
byte[] plaintext,
int plaintextOffset,
int plaintextLength)
Encode the passed in plaintext using the current bulk cipher.
|
int |
getCiphertextDecodeLimit(int plaintextLimit)
Return the maximum input size for a ciphertext given a maximum output size for the plaintext
of plaintextLimit bytes.
|
int |
getCiphertextEncodeLimit(int plaintextLimit)
Return the maximum output size for a ciphertext given a maximum input size for the plaintext of
plaintextLimit bytes.
|
int |
getPlaintextDecodeLimit(int ciphertextLimit)
Return the maximum output size for the plaintext given a maximum input size for the ciphertext of
ciphertextLimit bytes.
|
int |
getPlaintextEncodeLimit(int ciphertextLimit)
Return the maximum input size for the plaintext given a maximum output size for the ciphertext of
ciphertextLimit bytes.
|
void |
rekeyDecoder() |
void |
rekeyEncoder() |
boolean |
usesOpaqueRecordTypeDecode() |
boolean |
usesOpaqueRecordTypeEncode() |
public static final int AEAD_CCM
public static final int AEAD_CHACHA20_POLY1305
public static final int AEAD_GCM
protected final AEADNonceGenerator encryptNonceGenerator
public TlsAEADCipher(TlsCryptoParameters cryptoParams, TlsAEADCipherImpl encryptCipher, TlsAEADCipherImpl decryptCipher, int keySize, int macSize, int aeadType) throws java.io.IOException
java.io.IOExceptionpublic int getCiphertextDecodeLimit(int plaintextLimit)
TlsCiphergetCiphertextDecodeLimit in interface TlsCipherplaintextLimit - the maximum output size for the plaintext.public int getCiphertextEncodeLimit(int plaintextLimit)
TlsCiphergetCiphertextEncodeLimit in interface TlsCipherplaintextLimit - the maximum input size for the plaintext.public int getPlaintextDecodeLimit(int ciphertextLimit)
TlsCiphergetPlaintextDecodeLimit in interface TlsCipherciphertextLimit - the maximum input size for the ciphertext.public int getPlaintextEncodeLimit(int ciphertextLimit)
TlsCiphergetPlaintextEncodeLimit in interface TlsCipherciphertextLimit - the maximum output size for the ciphertext.public TlsEncodeResult encodePlaintext(long seqNo, short contentType, ProtocolVersion recordVersion, int headerAllocation, byte[] plaintext, int plaintextOffset, int plaintextLength) throws java.io.IOException
TlsCipherencodePlaintext in interface TlsCipherseqNo - sequence number of the message represented by plaintext.contentType - content type of the message represented by plaintext.recordVersion - ProtocolVersion used for the record.headerAllocation - extra bytes to allocate at start of returned byte array.plaintext - array holding input plaintext to the cipher.plaintextOffset - offset into input array the plaintext starts at.plaintextLength - length of the plaintext in the array.TlsEncodeResult containing the result of encoding (after 'headerAllocation' unused bytes).java.io.IOExceptionpublic TlsDecodeResult decodeCiphertext(long seqNo, short recordType, ProtocolVersion recordVersion, byte[] ciphertext, int ciphertextOffset, int ciphertextLength) throws java.io.IOException
TlsCipherdecodeCiphertext in interface TlsCipherseqNo - sequence number of the message represented by ciphertext.recordType - content type used in the record for this message.recordVersion - ProtocolVersion used for the record.ciphertext - array holding input ciphertext to the cipher.ciphertextOffset - offset into input array the ciphertext starts at.ciphertextLength - length of the ciphertext in the array.TlsDecodeResult containing the result of decoding.java.io.IOExceptionpublic void rekeyDecoder()
throws java.io.IOException
rekeyDecoder in interface TlsCipherjava.io.IOExceptionpublic void rekeyEncoder()
throws java.io.IOException
rekeyEncoder in interface TlsCipherjava.io.IOExceptionpublic boolean usesOpaqueRecordTypeDecode()
usesOpaqueRecordTypeDecode in interface TlsCipherpublic boolean usesOpaqueRecordTypeEncode()
usesOpaqueRecordTypeEncode in interface TlsCipher