Class OpenSslKeyMaterialProvider
java.lang.Object
io.netty.handler.ssl.OpenSslKeyMaterialProvider
- Direct Known Subclasses:
OpenSslCachingKeyMaterialProvider, OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi.ProviderFactory.OpenSslPopulatedKeyMaterialProvider
class OpenSslKeyMaterialProvider
extends java.lang.Object
Provides
OpenSslKeyMaterial for a given alias.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final java.util.concurrent.atomic.AtomicReference<OpenSslKeyMaterialProvider.MaterialCache> private final javax.net.ssl.X509KeyManagerprivate final java.lang.Stringprivate static final OpenSslKeyMaterialProvider.MaterialCache -
Constructor Summary
ConstructorsConstructorDescriptionOpenSslKeyMaterialProvider(javax.net.ssl.X509KeyManager keyManager, java.lang.String password) -
Method Summary
Modifier and TypeMethodDescription(package private) OpenSslKeyMaterialchooseKeyMaterial(ByteBufAllocator allocator, java.lang.String alias) Returns theOpenSslKeyMaterialornull(if none) that should be used during the handshake by OpenSSL.private OpenSslKeyMaterialcreateKeyMaterial(ByteBufAllocator allocator, java.security.cert.X509Certificate[] certificates, java.security.PrivateKey key) (package private) voiddestroy()Will be invoked once the provider should be destroyed.private void(package private) javax.net.ssl.X509KeyManagerReturns the underlyingX509KeyManagerthat is used.(package private) static voidvalidateKeyMaterialSupported(java.security.cert.X509Certificate[] keyCertChain, java.security.PrivateKey key, java.lang.String keyPassword, boolean allowSignatureFallback) private static voidvalidateSupported(java.security.cert.X509Certificate[] certificates) private static voidvalidateSupported(java.security.PrivateKey key, java.lang.String password, boolean allowSignatureFallback) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
SENTINEL_DESTROYED
-
keyManager
private final javax.net.ssl.X509KeyManager keyManager -
password
private final java.lang.String password -
cache
private final java.util.concurrent.atomic.AtomicReference<OpenSslKeyMaterialProvider.MaterialCache> cache
-
-
Constructor Details
-
OpenSslKeyMaterialProvider
OpenSslKeyMaterialProvider(javax.net.ssl.X509KeyManager keyManager, java.lang.String password)
-
-
Method Details
-
validateKeyMaterialSupported
static void validateKeyMaterialSupported(java.security.cert.X509Certificate[] keyCertChain, java.security.PrivateKey key, java.lang.String keyPassword, boolean allowSignatureFallback) throws javax.net.ssl.SSLException - Throws:
javax.net.ssl.SSLException
-
validateSupported
private static void validateSupported(java.security.PrivateKey key, java.lang.String password, boolean allowSignatureFallback) throws javax.net.ssl.SSLException - Throws:
javax.net.ssl.SSLException
-
validateSupported
private static void validateSupported(java.security.cert.X509Certificate[] certificates) throws javax.net.ssl.SSLException - Throws:
javax.net.ssl.SSLException
-
keyManager
javax.net.ssl.X509KeyManager keyManager()Returns the underlyingX509KeyManagerthat is used. -
chooseKeyMaterial
OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, java.lang.String alias) throws java.lang.Exception Returns theOpenSslKeyMaterialornull(if none) that should be used during the handshake by OpenSSL.- Throws:
java.lang.Exception
-
createKeyMaterial
private OpenSslKeyMaterial createKeyMaterial(ByteBufAllocator allocator, java.security.cert.X509Certificate[] certificates, java.security.PrivateKey key) throws java.lang.Exception - Throws:
java.lang.Exception
-
destroy
void destroy()Will be invoked once the provider should be destroyed. -
destroyCache
private void destroyCache()
-