Package org.conscrypt
Class ConnectionStateTLS
java.lang.Object
org.conscrypt.ConnectionState
org.conscrypt.ConnectionStateTLS
public class ConnectionStateTLS extends ConnectionState
This class encapsulates the operating environment of the TLS v1
(http://www.ietf.org/rfc/rfc2246.txt) Record Protocol and provides
relating encryption/decryption functionality.
The work functionality is based on the security
parameters negotiated during the handshake.
-
Field Summary
Fields inherited from class org.conscrypt.ConnectionState
block_size, decCipher, encCipher, hash_size, logger, read_seq_num, write_seq_num -
Constructor Summary
Constructors Modifier Constructor Description protectedConnectionStateTLS(SSLSessionImpl session)Creates the instance of TLS v1 Connection State. -
Method Summary
Modifier and Type Method Description protected byte[]decrypt(byte type, byte[] fragment, int offset, int len)Retrieves the fragment of the Plaintext structure of the specified type from the provided data representing the Generic[Stream|Block]Cipher structure.protected byte[]encrypt(byte type, byte[] fragment, int offset, int len)Creates the GenericStreamCipher or GenericBlockCipher data structure for specified data of specified type.Methods inherited from class org.conscrypt.ConnectionState
decrypt, encrypt, getContentSize, getFragmentSize, getMinFragmentSize, getPaddingSize, incSequenceNumber, shutdown
-
Constructor Details
-
ConnectionStateTLS
Creates the instance of TLS v1 Connection State. All of the security parameters are provided by session object.- Parameters:
session- the sessin object which incapsulates all of the security parameters established by handshake protocol. The key calculation for the state is done according to the TLS v 1.0 Protocol specification. (http://www.ietf.org/rfc/rfc2246.txt)
-
-
Method Details
-
encrypt
protected byte[] encrypt(byte type, byte[] fragment, int offset, int len)Creates the GenericStreamCipher or GenericBlockCipher data structure for specified data of specified type.- Specified by:
encryptin classConnectionState- Parameters:
type- - the ContentType of the provided datafragment- - the byte array containing the data to be encrypted under the current connection state.offset- - the offset from which the data begins with.len- - the length of the data.- Throws:
AlertException- if alert was occurred.
-
decrypt
protected byte[] decrypt(byte type, byte[] fragment, int offset, int len)Retrieves the fragment of the Plaintext structure of the specified type from the provided data representing the Generic[Stream|Block]Cipher structure.- Specified by:
decryptin classConnectionState- Parameters:
type- - the ContentType of the data to be decrypted.fragment- - the byte array containing the data to be encrypted under the current connection state.offset- - the offset from which the data begins with.len- - the length of the data.- Throws:
AlertException- if alert was occurred.
-