Top Description Inners Fields Constructors Methods
org.conscrypt

pack-priv final Class NativeSsl

extends Object
Class Inheritance
Static Imports
org.conscrypt.NativeConstants.SSL_MODE_CBC_RECORD_SPLITTING, .NativeConstants.SSL_OP_CIPHER_SERVER_PREFERENCE, .NativeConstants.SSL_OP_NO_TICKET, .NativeConstants.SSL_RECEIVED_SHUTDOWN, .NativeConstants.SSL_SENT_SHUTDOWN, .NativeConstants.SSL_VERIFY_FAIL_IF_NO_PEER_CERT, .NativeConstants.SSL_VERIFY_NONE, .NativeConstants.SSL_VERIFY_PEER

A utility wrapper that abstracts operations on the underlying native SSL instance.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
NativeSsl.BioWrapper

A utility wrapper that abstracts operations on the underlying native BIO instance.

Field Summary

Modifier and TypeField and Description
private final SSLParametersImpl.AliasChooser
private final NativeCrypto.SSLHandshakeCallbacks
private X509Certificate[]
private final ReadWriteLock
private final SSLParametersImpl
private final SSLParametersImpl.PSKCallbacks
private volatile long

Constructor Summary

AccessConstructor and Description
private
NativeSsl(long ssl, SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser aliasChooser, SSLParametersImpl.PSKCallbacks pskCallbacks)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
chooseClientCertificate(byte[] keyTypeBytes, int[] signatureAlgs, byte[][] asn1DerEncodedPrincipals)

pack-priv int
clientPSKKeyRequested(String identityHint, byte[] identityBytesOut, byte[] key)

pack-priv void
pack-priv void
pack-priv void
doHandshake(FileDescriptor fd, int timeoutMillis)

pack-priv int
private void
pack-priv byte[]
exportKeyingMaterial(String label, byte[] context, int length)

protected final void
finalize()

Overrides java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
pack-priv void
pack-priv byte[]
private Set<String>
pack-priv String
pack-priv int
getError(int result)

pack-priv X509Certificate[]
pack-priv int
pack-priv byte[]
pack-priv X509Certificate[]
pack-priv byte[]
pack-priv int
pack-priv String
pack-priv byte[]
pack-priv long
pack-priv long
pack-priv byte[]
pack-priv byte[]
pack-priv String
pack-priv void
initialize(String hostname, OpenSSLKey channelIdPrivateKey)

pack-priv void
private boolean
pack-priv boolean
pack-priv NativeSsl.BioWrapper
pack-priv static NativeSsl
pack-priv void
offerToResumeSession(long sslSessionNativePointer)

pack-priv int
read(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis)

pack-priv int
readDirectByteBuffer(long destAddress, int destLength)

pack-priv int
serverPSKKeyRequested(String identityHint, String identity, byte[] key)

private void
private void
pack-priv void
setTimeout(long millis)

private void
setTlsChannelId(OpenSSLKey channelIdPrivateKey)

pack-priv void
pack-priv void
private void
pack-priv boolean
pack-priv boolean
pack-priv void
write(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis)

pack-priv int
writeDirectByteBuffer(long sourceAddress, int sourceLength)

Inherited from java.lang.Object:
cloneequalsgetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasChooserback to summary
private final SSLParametersImpl.AliasChooser aliasChooser
handshakeCallbacksback to summary
private final NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks
localCertificatesback to summary
private X509Certificate[] localCertificates
lockback to summary
private final ReadWriteLock lock
parametersback to summary
private final SSLParametersImpl parameters
pskCallbacksback to summary
private final SSLParametersImpl.PSKCallbacks pskCallbacks
sslback to summary
private volatile long ssl

Constructor Detail

NativeSslback to summary
private NativeSsl(long ssl, SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser aliasChooser, SSLParametersImpl.PSKCallbacks pskCallbacks)

Method Detail

chooseClientCertificateback to summary
pack-priv void chooseClientCertificate(byte[] keyTypeBytes, int[] signatureAlgs, byte[][] asn1DerEncodedPrincipals) throws SSLException, CertificateEncodingException
clientPSKKeyRequestedback to summary
pack-priv int clientPSKKeyRequested(String identityHint, byte[] identityBytesOut, byte[] key)
Annotations
@SuppressWarnings:deprecation
See Also
NativeCrypto.SSLHandshakeCallbacks#clientPSKKeyRequested(String, byte[], byte[])
closeback to summary
pack-priv void close()
configureServerCertificateback to summary
pack-priv void configureServerCertificate() throws IOException
doHandshakeback to summary
pack-priv void doHandshake(FileDescriptor fd, int timeoutMillis) throws CertificateException, IOException
doHandshakeback to summary
pack-priv int doHandshake() throws IOException
enablePSKKeyManagerIfRequestedback to summary
private void enablePSKKeyManagerIfRequested() throws SSLException
Annotations
@SuppressWarnings:deprecation
exportKeyingMaterialback to summary
pack-priv byte[] exportKeyingMaterial(String label, byte[] context, int length) throws SSLException
finalizeback to summary
protected final void finalize() throws Throwable

Overrides java.lang.Object.finalize.

Doc from java.lang.Object.finalize.

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. A subclass overrides the finalize method to dispose of system resources or to perform other cleanup.

When running in a Java virtual machine in which finalization has been disabled or removed, the garbage collector will never call finalize(). In a Java virtual machine in which finalization is enabled, the garbage collector might call finalize only after an indefinite delay.

The general contract of finalize is that it is invoked if and when the Java virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The finalize method may take any action, including making this object available again to other threads; the usual purpose of finalize, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.

The finalize method of class Object performs no special action; it simply returns normally. Subclasses of Object may override this definition.

The Java programming language does not guarantee which thread will invoke the finalize method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.

After the finalize method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.

The finalize method is never invoked more than once by a Java virtual machine for any given object.

Any exception thrown by the finalize method causes the finalization of this object to be halted, but is otherwise ignored.

Annotations
@Override
Exceptions
Throwable:
the Exception raised by this method
forceReadback to summary
pack-priv void forceRead() throws IOException
getApplicationProtocolback to summary
pack-priv byte[] getApplicationProtocol()
getCipherKeyTypesback to summary
private Set<String> getCipherKeyTypes()
getCipherSuiteback to summary
pack-priv String getCipherSuite()
getErrorback to summary
pack-priv int getError(int result)
getLocalCertificatesback to summary
pack-priv X509Certificate[] getLocalCertificates()
getMaxSealOverheadback to summary
pack-priv int getMaxSealOverhead()
getPeerCertificateOcspDataback to summary
pack-priv byte[] getPeerCertificateOcspData()
getPeerCertificatesback to summary
pack-priv X509Certificate[] getPeerCertificates() throws CertificateException
getPeerTlsSctDataback to summary
pack-priv byte[] getPeerTlsSctData()
getPendingReadableBytesback to summary
pack-priv int getPendingReadableBytes()
getRequestedServerNameback to summary
pack-priv String getRequestedServerName()
getSessionIdback to summary
pack-priv byte[] getSessionId()
getTimeback to summary
pack-priv long getTime()
getTimeoutback to summary
pack-priv long getTimeout()
getTlsChannelIdback to summary
pack-priv byte[] getTlsChannelId() throws SSLException
getTlsUniqueback to summary
pack-priv byte[] getTlsUnique()
getVersionback to summary
pack-priv String getVersion()
initializeback to summary
pack-priv void initialize(String hostname, OpenSSLKey channelIdPrivateKey) throws IOException
interruptback to summary
pack-priv void interrupt()
isClientback to summary
private boolean isClient()
isClosedback to summary
pack-priv boolean isClosed()
newBioback to summary
pack-priv NativeSsl.BioWrapper newBio()
newInstanceback to summary
pack-priv static NativeSsl newInstance(SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser chooser, SSLParametersImpl.PSKCallbacks pskCallbacks) throws SSLException
offerToResumeSessionback to summary
pack-priv void offerToResumeSession(long sslSessionNativePointer) throws SSLException
readback to summary
pack-priv int read(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) throws IOException
readDirectByteBufferback to summary
pack-priv int readDirectByteBuffer(long destAddress, int destLength) throws IOException, CertificateException
serverPSKKeyRequestedback to summary
pack-priv int serverPSKKeyRequested(String identityHint, String identity, byte[] key)
Annotations
@SuppressWarnings:deprecation
See Also
NativeCrypto.SSLHandshakeCallbacks#serverPSKKeyRequested(String, String, byte[])
setCertificateback to summary
private void setCertificate(String alias) throws CertificateEncodingException, SSLException
setCertificateValidationback to summary
private void setCertificateValidation() throws SSLException
setTimeoutback to summary
pack-priv void setTimeout(long millis)
setTlsChannelIdback to summary
private void setTlsChannelId(OpenSSLKey channelIdPrivateKey) throws SSLException
shutdownback to summary
pack-priv void shutdown(FileDescriptor fd) throws IOException
shutdownback to summary
pack-priv void shutdown() throws IOException
verifyWithSniMatchersback to summary
private void verifyWithSniMatchers(String serverName) throws SSLHandshakeException
wasShutdownReceivedback to summary
pack-priv boolean wasShutdownReceived()
wasShutdownSentback to summary
pack-priv boolean wasShutdownSent()
writeback to summary
pack-priv void write(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) throws IOException
writeDirectByteBufferback to summary
pack-priv int writeDirectByteBuffer(long sourceAddress, int sourceLength) throws IOException
org.conscrypt back to summary

pack-priv final Class NativeSsl.BioWrapper

extends Object
Class Inheritance

A utility wrapper that abstracts operations on the underlying native BIO instance.

Field Summary

Modifier and TypeField and Description
private volatile long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv int
pack-priv int
readDirectByteBuffer(long destAddress, int destLength)

pack-priv int
writeDirectByteBuffer(long address, int length)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bioback to summary
private volatile long bio

Constructor Detail

BioWrapperback to summary
private BioWrapper() throws SSLException

Method Detail

closeback to summary
pack-priv void close()
getPendingWrittenBytesback to summary
pack-priv int getPendingWrittenBytes()
readDirectByteBufferback to summary
pack-priv int readDirectByteBuffer(long destAddress, int destLength) throws IOException
writeDirectByteBufferback to summary
pack-priv int writeDirectByteBuffer(long address, int length) throws IOException