APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.ssl

pack-priv abstract Class OutputRecord

extends ByteArrayOutputStream
implements Record, Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable, sun.security.ssl.Record
Known Direct Subclasses
sun.security.ssl.QuicEngineOutputRecord, sun.security.ssl.SSLEngineOutputRecord, sun.security.ssl.SSLSocketOutputRecord, sun.security.ssl.DTLSOutputRecord
Imports
java.io.ByteArrayOutputStream, .Closeable, .IOException, .OutputStream, java.nio.ByteBuffer, java.util.concurrent.locks.ReentrantLock, jdk.internal.net.quic.QuicTLSEngine, sun.security.ssl.SSLCipher.SSLWriteCipher

OutputRecord takes care of the management of SSL/(D)TLS output records, including buffering, encryption, handshake messages marshal, etc.
Author
David Brownell

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv boolean
private int
private static final byte[]
pack-priv final HandshakeHash
pack-priv ProtocolVersion
pack-priv volatile boolean
pack-priv boolean
pack-priv int
pack-priv ProtocolVersion
pack-priv final ReentrantLock
pack-priv TransportContext
private static final int[]
private static final int[]
pack-priv SSLCipher.SSLWriteCipher
Inherited from java.io.ByteArrayOutputStream:
bufcount

Constructor Summary

AccessConstructor and Description
pack-priv
OutputRecord(HandshakeHash handshakeHash, SSLCipher.SSLWriteCipher writeCipher)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
calculateFragmentSize(int fragmentLimit)

pack-priv void
changeFragmentSize(int fragmentSize)

pack-priv void
changePacketSize(int packetSize)

pack-priv void
changeWriteCiphers(SSLCipher.SSLWriteCipher writeCipher, boolean useChangeCipherSpec)

pack-priv void
changeWriteCiphers(SSLCipher.SSLWriteCipher writeCipher, byte keyUpdateRequest)

public void
close()

Overrides java.io.ByteArrayOutputStream.close.

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

private static long
d10Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)

private static long
d13Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)

pack-priv void
deliver(byte[] source, int offset, int length)

pack-priv void
pack-priv Ciphertext
encode(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength)

pack-priv abstract void
encodeAlert(byte level, byte description)

pack-priv abstract void
pack-priv abstract void
encodeHandshake(byte[] buffer, int offset, int length)

pack-priv static ByteBuffer
encodeV2ClientHello(byte[] fragment, int offset, int length)

pack-priv void
pack-priv static long
encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)

pack-priv long
encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, int headerSize)

pack-priv void
pack-priv byte[]
pack-priv QuicTLSEngine.KeySpace
pack-priv int
pack-priv void
pack-priv boolean
pack-priv boolean
pack-priv void
pack-priv boolean
pack-priv void
pack-priv void
pack-priv void
setVersion(ProtocolVersion protocolVersion)

private static long
t10Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)

private long
t10Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, int headerSize)

private static long
t13Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)

private long
t13Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, int headerSize)

private static int
V3toV2CipherSuite(ByteBuffer dstBuf, byte byte1, byte byte2)

Inherited from java.io.ByteArrayOutputStream:
resetsizetoByteArraytoStringtoStringtoStringtoStringwritewritewriteByteswriteTo

Field Detail

firstMessageback to summary
pack-priv boolean firstMessage
fragmentSizeback to summary
private int fragmentSize
HANDSHAKE_MESSAGE_KEY_UPDATEback to summary
private static final byte[] HANDSHAKE_MESSAGE_KEY_UPDATE
handshakeHashback to summary
pack-priv final HandshakeHash handshakeHash
helloVersionback to summary
pack-priv ProtocolVersion helloVersion
isClosedback to summary
pack-priv volatile boolean isClosed
isFirstAppOutputRecordback to summary
pack-priv boolean isFirstAppOutputRecord
packetSizeback to summary
pack-priv int packetSize
protocolVersionback to summary
pack-priv ProtocolVersion protocolVersion
recordLockback to summary
pack-priv final ReentrantLock recordLock
tcback to summary
pack-priv TransportContext tc
V3toV2CipherMap1back to summary
private static final int[] V3toV2CipherMap1
V3toV2CipherMap3back to summary
private static final int[] V3toV2CipherMap3
writeCipherback to summary
pack-priv SSLCipher.SSLWriteCipher writeCipher

Constructor Detail

OutputRecordback to summary
pack-priv OutputRecord(HandshakeHash handshakeHash, SSLCipher.SSLWriteCipher writeCipher)

Method Detail

calculateFragmentSizeback to summary
pack-priv int calculateFragmentSize(int fragmentLimit)
changeFragmentSizeback to summary
pack-priv void changeFragmentSize(int fragmentSize)
changePacketSizeback to summary
pack-priv void changePacketSize(int packetSize)
changeWriteCiphersback to summary
pack-priv void changeWriteCiphers(SSLCipher.SSLWriteCipher writeCipher, boolean useChangeCipherSpec) throws IOException
changeWriteCiphersback to summary
pack-priv void changeWriteCiphers(SSLCipher.SSLWriteCipher writeCipher, byte keyUpdateRequest) throws IOException
closeback to summary
public void close() throws IOException

Overrides java.io.ByteArrayOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
d10Encryptback to summary
private static long d10Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)
d13Encryptback to summary
private static long d13Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)
deliverback to summary
pack-priv void deliver(byte[] source, int offset, int length) throws IOException
disposeWriteCipherback to summary
pack-priv void disposeWriteCipher()
encodeback to summary
pack-priv Ciphertext encode(ByteBuffer[] srcs, int srcsOffset, int srcsLength, ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException
encodeAlertback to summary
pack-priv abstract void encodeAlert(byte level, byte description) throws IOException
encodeChangeCipherSpecback to summary
pack-priv abstract void encodeChangeCipherSpec() throws IOException
encodeHandshakeback to summary
pack-priv abstract void encodeHandshake(byte[] buffer, int offset, int length) throws IOException
encodeV2ClientHelloback to summary
pack-priv static ByteBuffer encodeV2ClientHello(byte[] fragment, int offset, int length)
encodeV2NoCipherback to summary
pack-priv void encodeV2NoCipher() throws IOException
encryptback to summary
pack-priv static long encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)
encryptback to summary
pack-priv long encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, int headerSize)
finishHandshakeback to summary
pack-priv void finishHandshake()
getHandshakeMessageback to summary
pack-priv byte[] getHandshakeMessage()
getHandshakeMessageKeySpaceback to summary
pack-priv QuicTLSEngine.KeySpace getHandshakeMessageKeySpace()
getMaxPacketSizeback to summary
pack-priv int getMaxPacketSize()
initHandshakerback to summary
pack-priv void initHandshaker()
isClosedback to summary
pack-priv boolean isClosed()
isEmptyback to summary
pack-priv boolean isEmpty()
launchRetransmissionback to summary
pack-priv void launchRetransmission()
seqNumIsHugeback to summary
pack-priv boolean seqNumIsHuge()
setDeliverStreamback to summary
pack-priv void setDeliverStream(OutputStream outputStream)
setHelloVersionback to summary
pack-priv void setHelloVersion(ProtocolVersion helloVersion)
setVersionback to summary
pack-priv void setVersion(ProtocolVersion protocolVersion)
t10Encryptback to summary
private static long t10Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)
t10Encryptback to summary
private long t10Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, int headerSize)
t13Encryptback to summary
private static long t13Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, ProtocolVersion protocolVersion)
t13Encryptback to summary
private long t13Encrypt(SSLCipher.SSLWriteCipher encCipher, byte contentType, int headerSize)
V3toV2CipherSuiteback to summary
private static int V3toV2CipherSuite(ByteBuffer dstBuf, byte byte1, byte byte2)
sun.security.ssl back to summary

private final Class OutputRecord.T13PaddingHolder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final byte[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

zerosback to summary
private static final byte[] zeros

Constructor Detail

T13PaddingHolderback to summary
private T13PaddingHolder()