Package org.conscrypt
Class NativeSsl
java.lang.Object
org.conscrypt.NativeSsl
A utility wrapper that abstracts operations on the underlying native SSL instance.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) final class
A utility wrapper that abstracts operations on the underlying native BIO instance. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SSLParametersImpl.AliasChooser
private final NativeCrypto.SSLHandshakeCallbacks
private X509Certificate[]
private final ReadWriteLock
private final SSLParametersImpl
private final SSLParametersImpl.PSKCallbacks
private long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
NativeSsl
(long ssl, SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser aliasChooser, SSLParametersImpl.PSKCallbacks pskCallbacks) -
Method Summary
Modifier and TypeMethodDescription(package private) void
chooseClientCertificate
(byte[] keyTypeBytes, int[] signatureAlgs, byte[][] asn1DerEncodedPrincipals) (package private) int
clientPSKKeyRequested
(String identityHint, byte[] identityBytesOut, byte[] key) (package private) void
close()
(package private) void
(package private) int
(package private) void
doHandshake
(FileDescriptor fd, int timeoutMillis) private void
(package private) byte[]
exportKeyingMaterial
(String label, byte[] context, int length) protected final void
finalize()
(package private) void
(package private) byte[]
(package private) String
(package private) int
getError
(int result) (package private) X509Certificate[]
(package private) int
(package private) byte[]
(package private) X509Certificate[]
(package private) byte[]
(package private) int
(package private) String
(package private) byte[]
(package private) long
getTime()
(package private) long
(package private) byte[]
(package private) byte[]
(package private) String
(package private) void
initialize
(String hostname, OpenSSLKey channelIdPrivateKey) (package private) void
private boolean
isClient()
(package private) boolean
isClosed()
(package private) NativeSsl.BioWrapper
newBio()
(package private) static NativeSsl
newInstance
(SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser chooser, SSLParametersImpl.PSKCallbacks pskCallbacks) (package private) void
offerToResumeSession
(long sslSessionNativePointer) (package private) int
read
(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) (package private) int
readDirectByteBuffer
(long destAddress, int destLength) (package private) int
serverPSKKeyRequested
(String identityHint, String identity, byte[] key) private void
setCertificate
(String alias) private void
(package private) void
setTimeout
(long millis) private void
setTlsChannelId
(OpenSSLKey channelIdPrivateKey) (package private) void
shutdown()
(package private) void
private void
verifyWithSniMatchers
(String serverName) (package private) boolean
(package private) boolean
(package private) void
write
(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) (package private) int
writeDirectByteBuffer
(long sourceAddress, int sourceLength)
-
Field Details
-
parameters
-
handshakeCallbacks
-
aliasChooser
-
pskCallbacks
-
localCertificates
-
lock
-
ssl
private volatile long ssl
-
-
Constructor Details
-
NativeSsl
private NativeSsl(long ssl, SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser aliasChooser, SSLParametersImpl.PSKCallbacks pskCallbacks)
-
-
Method Details
-
newInstance
static NativeSsl newInstance(SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser chooser, SSLParametersImpl.PSKCallbacks pskCallbacks) throws SSLException - Throws:
SSLException
-
newBio
NativeSsl.BioWrapper newBio() -
offerToResumeSession
- Throws:
SSLException
-
getSessionId
byte[] getSessionId() -
getTime
long getTime() -
getTimeout
long getTimeout() -
setTimeout
void setTimeout(long millis) -
getCipherSuite
String getCipherSuite() -
getPeerCertificates
- Throws:
CertificateException
-
getLocalCertificates
X509Certificate[] getLocalCertificates() -
getPeerCertificateOcspData
byte[] getPeerCertificateOcspData() -
getTlsUnique
byte[] getTlsUnique() -
exportKeyingMaterial
- Throws:
SSLException
-
getPeerTlsSctData
byte[] getPeerTlsSctData() -
clientPSKKeyRequested
- See Also:
-
serverPSKKeyRequested
- See Also:
-
chooseClientCertificate
void chooseClientCertificate(byte[] keyTypeBytes, int[] signatureAlgs, byte[][] asn1DerEncodedPrincipals) throws SSLException, CertificateEncodingException -
setCertificate
-
getVersion
String getVersion() -
getRequestedServerName
String getRequestedServerName() -
getTlsChannelId
- Throws:
SSLException
-
initialize
- Throws:
IOException
-
configureServerCertificate
- Throws:
IOException
-
verifyWithSniMatchers
- Throws:
SSLHandshakeException
-
getCipherKeyTypes
-
doHandshake
- Throws:
CertificateException
IOException
-
doHandshake
- Throws:
IOException
-
read
- Throws:
IOException
-
write
void write(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) throws IOException - Throws:
IOException
-
enablePSKKeyManagerIfRequested
- Throws:
SSLException
-
setTlsChannelId
- Throws:
SSLException
-
setCertificateValidation
- Throws:
SSLException
-
interrupt
void interrupt() -
shutdown
- Throws:
IOException
-
shutdown
- Throws:
IOException
-
wasShutdownReceived
boolean wasShutdownReceived() -
wasShutdownSent
boolean wasShutdownSent() -
readDirectByteBuffer
- Throws:
IOException
CertificateException
-
writeDirectByteBuffer
- Throws:
IOException
-
forceRead
- Throws:
IOException
-
getPendingReadableBytes
int getPendingReadableBytes() -
getMaxSealOverhead
int getMaxSealOverhead() -
close
void close() -
isClosed
boolean isClosed() -
getError
int getError(int result) -
getApplicationProtocol
byte[] getApplicationProtocol() -
isClient
private boolean isClient() -
finalize
-