Top Description Inners Fields Constructors Methods
org.bouncycastle.tls

pack-priv Class RecordStream

extends Object
Class Inheritance
Imports
java.io.EOFException, .IOException, .InputStream, .InterruptedIOException, .OutputStream, org.bouncycastle.tls.crypto.TlsCipher, .TlsDecodeResult, .TlsEncodeResult, .TlsNullNullCipher

An implementation of the TLS 1.0/1.1/1.2 record layer.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private int
private static int
private TlsProtocol
private boolean
private InputStream
private final RecordStream.Record
private OutputStream
private TlsCipher
private int
private TlsCipher
private TlsCipher
private final RecordStream.SequenceNumber
private TlsCipher
private final RecordStream.SequenceNumber
private ProtocolVersion

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
checkChangeCipherSpec(byte[] buf, int off, int len)

private static void
checkLength(int length, int limit, short alertDescription)

private short
checkRecordType(byte[] buf, int off)

pack-priv void
pack-priv TlsDecodeResult
decodeAndVerify(short recordType, ProtocolVersion recordVersion, byte[] ciphertext, int off, int len)

pack-priv void
enablePendingCipherRead(boolean deferred)

pack-priv void
pack-priv void
pack-priv int
pack-priv boolean
pack-priv void
pack-priv void
pack-priv void
pack-priv RecordPreview
previewOutputRecord(int contentLength)

pack-priv int
previewOutputRecordSize(int contentLength)

pack-priv RecordPreview
previewRecordHeader(byte[] recordHeader)

pack-priv boolean
readFullRecord(byte[] input, int inputOff, int inputLen)

pack-priv boolean
pack-priv void
setIgnoreChangeCipherSpec(boolean ignoreChangeCipherSpec)

pack-priv void
pack-priv void
setPlaintextLimit(int plaintextLimit)

pack-priv void
pack-priv void
writeRecord(short contentType, byte[] plaintext, int plaintextOffset, int plaintextLength)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ciphertextLimitback to summary
private int ciphertextLimit
DEFAULT_PLAINTEXT_LIMITback to summary
private static int DEFAULT_PLAINTEXT_LIMIT
handlerback to summary
private TlsProtocol handler
ignoreChangeCipherSpecback to summary
private boolean ignoreChangeCipherSpec
inputback to summary
private InputStream input
inputRecordback to summary
private final RecordStream.Record inputRecord
outputback to summary
private OutputStream output
pendingCipherback to summary
private TlsCipher pendingCipher
plaintextLimitback to summary
private int plaintextLimit
readCipherback to summary
private TlsCipher readCipher
readCipherDeferredback to summary
private TlsCipher readCipherDeferred
readSeqNoback to summary
private final RecordStream.SequenceNumber readSeqNo
writeCipherback to summary
private TlsCipher writeCipher
writeSeqNoback to summary
private final RecordStream.SequenceNumber writeSeqNo
writeVersionback to summary
private ProtocolVersion writeVersion

Constructor Detail

RecordStreamback to summary
pack-priv RecordStream(TlsProtocol handler, InputStream input, OutputStream output)

Method Detail

checkChangeCipherSpecback to summary
private void checkChangeCipherSpec(byte[] buf, int off, int len) throws IOException
checkLengthback to summary
private static void checkLength(int length, int limit, short alertDescription) throws IOException
checkRecordTypeback to summary
private short checkRecordType(byte[] buf, int off) throws IOException
closeback to summary
pack-priv void close() throws IOException
decodeAndVerifyback to summary
pack-priv TlsDecodeResult decodeAndVerify(short recordType, ProtocolVersion recordVersion, byte[] ciphertext, int off, int len) throws IOException
enablePendingCipherReadback to summary
pack-priv void enablePendingCipherRead(boolean deferred) throws IOException
enablePendingCipherWriteback to summary
pack-priv void enablePendingCipherWrite() throws IOException
finaliseHandshakeback to summary
pack-priv void finaliseHandshake() throws IOException
getPlaintextLimitback to summary
pack-priv int getPlaintextLimit()
needsKeyUpdateback to summary
pack-priv boolean needsKeyUpdate()
notifyChangeCipherSpecReceivedback to summary
pack-priv void notifyChangeCipherSpecReceived() throws IOException
notifyKeyUpdateReceivedback to summary
pack-priv void notifyKeyUpdateReceived() throws IOException
notifyKeyUpdateSentback to summary
pack-priv void notifyKeyUpdateSent() throws IOException
previewOutputRecordback to summary
pack-priv RecordPreview previewOutputRecord(int contentLength)
previewOutputRecordSizeback to summary
pack-priv int previewOutputRecordSize(int contentLength)
previewRecordHeaderback to summary
pack-priv RecordPreview previewRecordHeader(byte[] recordHeader) throws IOException
readFullRecordback to summary
pack-priv boolean readFullRecord(byte[] input, int inputOff, int inputLen) throws IOException
readRecordback to summary
pack-priv boolean readRecord() throws IOException
setIgnoreChangeCipherSpecback to summary
pack-priv void setIgnoreChangeCipherSpec(boolean ignoreChangeCipherSpec)
setPendingCipherback to summary
pack-priv void setPendingCipher(TlsCipher tlsCipher)
setPlaintextLimitback to summary
pack-priv void setPlaintextLimit(int plaintextLimit)
setWriteVersionback to summary
pack-priv void setWriteVersion(ProtocolVersion writeVersion)
writeRecordback to summary
pack-priv void writeRecord(short contentType, byte[] plaintext, int plaintextOffset, int plaintextLength) throws IOException
org.bouncycastle.tls back to summary

private Class RecordStream.Record

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv volatile byte[]
private final byte[]
pack-priv volatile int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
fillTo(InputStream input, int length)

pack-priv void
readFragment(InputStream input, int fragmentLength)

pack-priv boolean
pack-priv void
private void
resize(int length)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufback to summary
pack-priv volatile byte[] buf
headerback to summary
private final byte[] header
posback to summary
pack-priv volatile int pos

Constructor Detail

Recordback to summary
private Record()

Method Detail

fillToback to summary
pack-priv void fillTo(InputStream input, int length) throws IOException
readFragmentback to summary
pack-priv void readFragment(InputStream input, int fragmentLength) throws IOException
readHeaderback to summary
pack-priv boolean readHeader(InputStream input) throws IOException
resetback to summary
pack-priv void reset()
resizeback to summary
private void resize(int length)
org.bouncycastle.tls back to summary

private Class RecordStream.SequenceNumber

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized long
pack-priv synchronized long
nextValue(short alertDescription)

pack-priv synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exhaustedback to summary
private boolean exhausted
valueback to summary
private long value

Constructor Detail

SequenceNumberback to summary
private SequenceNumber()

Method Detail

currentValueback to summary
pack-priv synchronized long currentValue()
nextValueback to summary
pack-priv synchronized long nextValue(short alertDescription) throws TlsFatalAlert
resetback to summary
pack-priv synchronized void reset()