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 classA utility wrapper that abstracts operations on the underlying native BIO instance. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SSLParametersImpl.AliasChooserprivate final NativeCrypto.SSLHandshakeCallbacksprivate X509Certificate[]private final ReadWriteLockprivate final SSLParametersImplprivate final SSLParametersImpl.PSKCallbacksprivate long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateNativeSsl(long ssl, SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser aliasChooser, SSLParametersImpl.PSKCallbacks pskCallbacks) -
Method Summary
Modifier and TypeMethodDescription(package private) voidchooseClientCertificate(byte[] keyTypeBytes, int[] signatureAlgs, byte[][] asn1DerEncodedPrincipals) (package private) intclientPSKKeyRequested(String identityHint, byte[] identityBytesOut, byte[] key) (package private) voidclose()(package private) void(package private) int(package private) voiddoHandshake(FileDescriptor fd, int timeoutMillis) private void(package private) byte[]exportKeyingMaterial(String label, byte[] context, int length) protected final voidfinalize()(package private) void(package private) byte[](package private) String(package private) intgetError(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) longgetTime()(package private) long(package private) byte[](package private) byte[](package private) String(package private) voidinitialize(String hostname, OpenSSLKey channelIdPrivateKey) (package private) voidprivate booleanisClient()(package private) booleanisClosed()(package private) NativeSsl.BioWrappernewBio()(package private) static NativeSslnewInstance(SSLParametersImpl parameters, NativeCrypto.SSLHandshakeCallbacks handshakeCallbacks, SSLParametersImpl.AliasChooser chooser, SSLParametersImpl.PSKCallbacks pskCallbacks) (package private) voidofferToResumeSession(long sslSessionNativePointer) (package private) intread(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) (package private) intreadDirectByteBuffer(long destAddress, int destLength) (package private) intserverPSKKeyRequested(String identityHint, String identity, byte[] key) private voidsetCertificate(String alias) private void(package private) voidsetTimeout(long millis) private voidsetTlsChannelId(OpenSSLKey channelIdPrivateKey) (package private) voidshutdown()(package private) voidprivate voidverifyWithSniMatchers(String serverName) (package private) boolean(package private) boolean(package private) voidwrite(FileDescriptor fd, byte[] buf, int offset, int len, int timeoutMillis) (package private) intwriteDirectByteBuffer(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:
CertificateExceptionIOException
-
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:
IOExceptionCertificateException
-
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
-