Top Description Inners Fields Constructors Methods
io.netty.handler.ssl

pack-priv abstract Class ConscryptAlpnSslEngine

extends JdkSslEngine
Class Inheritance
Known Direct Subclasses
io.netty.handler.ssl.ConscryptAlpnSslEngine.ClientEngine, io.netty.handler.ssl.ConscryptAlpnSslEngine.ServerEngine
Static Imports
io.netty.handler.ssl.SslUtils.toSSLHandshakeException, io.netty.util.internal.ObjectUtil.checkNotNull, java.lang.Math.min

A JdkSslEngine that uses the Conscrypt provider or SSL with ALPN.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv final int

Returns:

the maximum size of the encrypted output buffer required for the wrap operation.
calculateOutNetBufSize
(int
the number of plaintext bytes to be wrapped.
plaintextBytes
,
int
the number of buffers that the plaintext bytes are spread across.
numBuffers
)

Calculates the maximum size of the encrypted output buffer required to wrap the given plaintext bytes.

pack-priv final int

Returns:

the maximum size of the encrypted output buffer required for the wrap operation.
calculateRequiredOutBufSpace
(int
the number of plaintext bytes to be wrapped.
plaintextBytes
,
int
the number of buffers that the plaintext bytes are spread across.
numBuffers
)

Calculate the space necessary in an out buffer to hold the max size that the given plaintextBytes and numBuffers can produce when encrypted.

private int
calculateSpace(int plaintextBytes, int numBuffers, long maxPacketLength)

pack-priv static ConscryptAlpnSslEngine
newClientEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated as a consequence of JdkApplicationProtocolNegotiator being deprecated.
pack-priv static ConscryptAlpnSslEngine
newServerEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated as a consequence of JdkApplicationProtocolNegotiator being deprecated.
pack-priv final SSLEngineResult
unwrap(ByteBuffer[] srcs, ByteBuffer[] dests)

Inherited from io.netty.handler.ssl.JdkSslEngine:
beginHandshakecloseInboundcloseOutboundgetDelegatedTaskgetEnabledCipherSuitesgetEnabledProtocolsgetEnableSessionCreationgetHandshakeSessiongetHandshakeStatusgetNeedClientAuthgetNegotiatedApplicationProtocolgetPeerHostgetPeerPortgetSessiongetSSLParametersgetSupportedCipherSuitesgetSupportedProtocolsgetUseClientModegetWantClientAuthgetWrappedEngineisInboundDoneisOutboundDonesetEnabledCipherSuitessetEnabledProtocolssetEnableSessionCreationsetNeedClientAuthsetNegotiatedApplicationProtocolsetSSLParameterssetUseClientModesetWantClientAuthunwrapunwrapunwrapwrapwrapwrap

Field Detail

USE_BUFFER_ALLOCATORback to summary
private static final boolean USE_BUFFER_ALLOCATOR

Constructor Detail

ConscryptAlpnSslEngineback to summary
private ConscryptAlpnSslEngine(SSLEngine engine, ByteBufAllocator alloc, List<String> protocols)

Method Detail

calculateOutNetBufSizeback to summary
pack-priv final int calculateOutNetBufSize(int plaintextBytes, int numBuffers)

Calculates the maximum size of the encrypted output buffer required to wrap the given plaintext bytes. Assumes as a worst case that there is one TLS record per buffer.

Parameters
plaintextBytes:int

the number of plaintext bytes to be wrapped.

numBuffers:int

the number of buffers that the plaintext bytes are spread across.

Returns:int

the maximum size of the encrypted output buffer required for the wrap operation.

calculateRequiredOutBufSpaceback to summary
pack-priv final int calculateRequiredOutBufSpace(int plaintextBytes, int numBuffers)

Calculate the space necessary in an out buffer to hold the max size that the given plaintextBytes and numBuffers can produce when encrypted. Assumes as a worst case that there is one TLS record per buffer.

Parameters
plaintextBytes:int

the number of plaintext bytes to be wrapped.

numBuffers:int

the number of buffers that the plaintext bytes are spread across.

Returns:int

the maximum size of the encrypted output buffer required for the wrap operation.

calculateSpaceback to summary
private int calculateSpace(int plaintextBytes, int numBuffers, long maxPacketLength)
newClientEngineback to summary
pack-priv static ConscryptAlpnSslEngine newClientEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated

as a consequence of JdkApplicationProtocolNegotiator being deprecated. See corresponding docs for further information.

newServerEngineback to summary
pack-priv static ConscryptAlpnSslEngine newServerEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated

as a consequence of JdkApplicationProtocolNegotiator being deprecated. See corresponding docs for further information.

unwrapback to summary
pack-priv final SSLEngineResult unwrap(ByteBuffer[] srcs, ByteBuffer[] dests) throws SSLException
io.netty.handler.ssl back to summary

private final Class ConscryptAlpnSslEngine.BufferAdapter

extends AllocatedBuffer
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
private final ByteBuf

Constructor Summary

AccessConstructor and Description
pack-priv
BufferAdapter(ByteBuf nettyBuffer)

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
nioBuffer()

Implements abstract org.conscrypt.AllocatedBuffer.nioBuffer.

Returns the ByteBuffer that backs this buffer.
public AllocatedBuffer
release()

Implements abstract org.conscrypt.AllocatedBuffer.release.

Returns the delegate ByteBuffer for reuse or garbage collection.
public AllocatedBuffer
retain()

Overrides org.conscrypt.AllocatedBuffer.retain.

Returns the current instance for backward compatibility.
Inherited from org.conscrypt.AllocatedBuffer:
wrap

Field Detail

bufferback to summary
private final ByteBuffer buffer
nettyBufferback to summary
private final ByteBuf nettyBuffer

Constructor Detail

BufferAdapterback to summary
pack-priv BufferAdapter(ByteBuf nettyBuffer)

Method Detail

nioBufferback to summary
public ByteBuffer nioBuffer()

Implements abstract org.conscrypt.AllocatedBuffer.nioBuffer.

Doc from org.conscrypt.AllocatedBuffer.nioBuffer.

Returns the ByteBuffer that backs this buffer.

Annotations
@Override
releaseback to summary
public AllocatedBuffer release()

Implements abstract org.conscrypt.AllocatedBuffer.release.

Doc from org.conscrypt.AllocatedBuffer.release.

Returns the delegate ByteBuffer for reuse or garbage collection.

Returns:AllocatedBuffer

this AllocatedBuffer instance

Annotations
@Override
retainback to summary
public AllocatedBuffer retain()

Overrides org.conscrypt.AllocatedBuffer.retain.

Doc from org.conscrypt.AllocatedBuffer.retain.

Returns the current instance for backward compatibility.

Annotations
@Override
io.netty.handler.ssl back to summary

private final Class ConscryptAlpnSslEngine.BufferAllocatorAdapter

extends BufferAllocator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteBufAllocator

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public AllocatedBuffer
allocateDirectBuffer(int capacity)

Implements abstract org.conscrypt.BufferAllocator.allocateDirectBuffer.

Allocates a direct (i.e. non-heap) buffer with the given capacity.
Inherited from org.conscrypt.BufferAllocator:
unpooled

Field Detail

allocback to summary
private final ByteBufAllocator alloc

Constructor Detail

BufferAllocatorAdapterback to summary
pack-priv BufferAllocatorAdapter(ByteBufAllocator alloc)

Method Detail

allocateDirectBufferback to summary
public AllocatedBuffer allocateDirectBuffer(int capacity)

Implements abstract org.conscrypt.BufferAllocator.allocateDirectBuffer.

Doc from org.conscrypt.BufferAllocator.allocateDirectBuffer.

Allocates a direct (i.e. non-heap) buffer with the given capacity.

Annotations
@Override
io.netty.handler.ssl back to summary

private final Class ConscryptAlpnSslEngine.ClientEngine

extends ConscryptAlpnSslEngine
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final JdkApplicationProtocolNegotiator.ProtocolSelectionListener

Constructor Summary

AccessConstructor and Description
pack-priv
ClientEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated as a consequence of JdkApplicationProtocolNegotiator being deprecated.

Method Summary

Modifier and TypeMethod and Description
private void
Inherited from io.netty.handler.ssl.ConscryptAlpnSslEngine:
calculateOutNetBufSizecalculateRequiredOutBufSpacenewClientEnginenewServerEngineunwrap

Field Detail

protocolListenerback to summary
private final JdkApplicationProtocolNegotiator.ProtocolSelectionListener protocolListener

Constructor Detail

ClientEngineback to summary
pack-priv ClientEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated

as a consequence of JdkApplicationProtocolNegotiator being deprecated. See corresponding docs for further information.

Method Detail

selectProtocolback to summary
private void selectProtocol() throws SSLException
io.netty.handler.ssl back to summary

private final Class ConscryptAlpnSslEngine.ServerEngine

extends ConscryptAlpnSslEngine
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final JdkApplicationProtocolNegotiator.ProtocolSelector

Constructor Summary

AccessConstructor and Description
pack-priv
ServerEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated as a consequence of JdkApplicationProtocolNegotiator being deprecated.

Method Summary

Modifier and TypeMethod and Description
private void
Inherited from io.netty.handler.ssl.ConscryptAlpnSslEngine:
calculateOutNetBufSizecalculateRequiredOutBufSpacenewClientEnginenewServerEngineunwrap

Field Detail

protocolSelectorback to summary
private final JdkApplicationProtocolNegotiator.ProtocolSelector protocolSelector

Constructor Detail

ServerEngineback to summary
pack-priv ServerEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator)

Deprecated

as a consequence of JdkApplicationProtocolNegotiator being deprecated. See corresponding docs for further information.

Method Detail

selectProtocolback to summary
private void selectProtocol() throws SSLException