public class SSLRecordProtocol extends Object
Modifier and Type | Field and Description |
---|---|
protected static int |
MAX_CIPHERED_DATA_LENGTH
Maximum length of allowed ciphered data fragment
as specified by TLS specification.
|
protected static int |
MAX_COMPRESSED_DATA_LENGTH
Maximum length of allowed compressed data fragment
as specified by TLS specification.
|
protected static int |
MAX_DATA_LENGTH
Maximum length of allowed plain data fragment
as specified by TLS specification.
|
protected static int |
MAX_SSL_PACKET_SIZE
Maximum length of ssl record.
|
Modifier | Constructor and Description |
---|---|
protected |
SSLRecordProtocol(HandshakeProtocol handshakeProtocol,
AlertProtocol alertProtocol,
SSLInputStream in,
Appendable appData)
Creates an instance of record protocol and tunes
up the client protocols to use ut.
|
Modifier and Type | Method and Description |
---|---|
protected void |
alert(byte level,
byte description)
Passes the alert information to the alert protocol.
|
protected byte[] |
getChangeCipherSpecMesage(SSLSessionImpl session)
Returns the change cipher spec message to be sent to another peer.
|
protected int |
getDataSize(int record_size)
Returns the upper bound of length of data containing in the record with
specified length.
|
protected int |
getMinRecordSize()
Returns the minimum possible length of the SSL record.
|
protected int |
getRecordSize(int data_size)
Returns the record length for the specified incoming data length.
|
protected SSLSessionImpl |
getSession()
Returns the session obtained during the handshake negotiation.
|
protected void |
setVersion(byte[] ver)
Sets up the SSL version used in this connection.
|
protected void |
shutdown()
Shuts down the protocol.
|
protected int |
unwrap()
Retrieves the fragment field of TLSCiphertext, and than
depending on the established Connection State
decrypts and decompresses it.
|
protected byte[] |
wrap(byte content_type,
byte[] fragment,
int offset,
int len)
Depending on the Connection State (Session) encrypts and compress
the provided data, and packs it into TLSCiphertext structure.
|
protected byte[] |
wrap(byte content_type,
DataStream dataStream)
Depending on the Connection State (Session) encrypts and compress
the provided data, and packs it into TLSCiphertext structure.
|
protected static final int MAX_DATA_LENGTH
protected static final int MAX_COMPRESSED_DATA_LENGTH
protected static final int MAX_CIPHERED_DATA_LENGTH
protected static final int MAX_SSL_PACKET_SIZE
protected SSLRecordProtocol(HandshakeProtocol handshakeProtocol, AlertProtocol alertProtocol, SSLInputStream in, Appendable appData)
handshakeProtocol:
- HandshakeProtocolalertProtocol:
- AlertProtocolin:
- SSLInputStreamappData:
- Appendableprotected SSLSessionImpl getSession()
protected int getMinRecordSize()
protected int getRecordSize(int data_size)
protected int getDataSize(int record_size)
protected byte[] wrap(byte content_type, DataStream dataStream)
content_type:
- intprotected byte[] wrap(byte content_type, byte[] fragment, int offset, int len)
content_type:
- intfragment:
- byte[]protected byte[] getChangeCipherSpecMesage(SSLSessionImpl session)
protected int unwrap() throws IOException
IOException
- if some io errors have been occurredEndOfSourceException
- if underlying input stream
has ran out of data.EndOfBufferException
- if there was not enough data
to build complete ssl packet.protected void alert(byte level, byte description)
level:
- bytedescription:
- byteprotected void setVersion(byte[] ver)
ver:
- byte[]protected void shutdown()