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

public final Class OpenSslX509KeyManagerFactory

extends KeyManagerFactory
Class Inheritance
Static Imports
io.netty.util.internal.ObjectUtil.checkNonEmpty, .ObjectUtil.checkNotNull

Special KeyManagerFactory that pre-compute the keymaterial used when SslProvider#OPENSSL or SslProvider#OPENSSL_REFCNT is used and so will improve handshake times and its performance. Because the keymaterial is pre-computed any modification to the KeyStore is ignored after init(KeyStore, char[]) is called. init(ManagerFactoryParameters) is not supported by this implementation and so a call to it will always result in an InvalidAlgorithmParameterException.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi

Constructor Summary

AccessConstructor and Description
public
public
public
private

Method Summary

Modifier and TypeMethod and Description
public static OpenSslX509KeyManagerFactory
newEngineBased(File certificateChain, String password)

Create a new initialized OpenSslX509KeyManagerFactory which loads its PrivateKey directly from an OpenSSL engine via the ENGINE_load_private_key function.

public static OpenSslX509KeyManagerFactory
newEngineBased(X509Certificate[] certificateChain, String password)

Create a new initialized OpenSslX509KeyManagerFactory which loads its PrivateKey directly from an OpenSSL engine via the ENGINE_load_private_key function.

public static OpenSslX509KeyManagerFactory
public static OpenSslX509KeyManagerFactory
public static OpenSslX509KeyManagerFactory
newKeyless(X509Certificate... certificateChain)

Returns a new initialized OpenSslX509KeyManagerFactory which will provide its private key by using the OpenSslPrivateKeyMethod.

private static OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi
private static OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi
pack-priv OpenSslKeyMaterialProvider
Inherited from javax.net.ssl.KeyManagerFactory:
getAlgorithmgetDefaultAlgorithmgetInstancegetInstancegetInstancegetKeyManagersgetProviderinitinit

Field Detail

spiback to summary
private final OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi spi

Constructor Detail

OpenSslX509KeyManagerFactoryback to summary
public OpenSslX509KeyManagerFactory()
OpenSslX509KeyManagerFactoryback to summary
public OpenSslX509KeyManagerFactory(Provider provider)
OpenSslX509KeyManagerFactoryback to summary
public OpenSslX509KeyManagerFactory(String algorithm, Provider provider) throws NoSuchAlgorithmException
OpenSslX509KeyManagerFactoryback to summary
private OpenSslX509KeyManagerFactory(OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi spi)

Method Detail

newEngineBasedback to summary
public static OpenSslX509KeyManagerFactory newEngineBased(File certificateChain, String password) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

Create a new initialized OpenSslX509KeyManagerFactory which loads its PrivateKey directly from an OpenSSL engine via the ENGINE_load_private_key function.

newEngineBasedback to summary
public static OpenSslX509KeyManagerFactory newEngineBased(X509Certificate[] certificateChain, String password) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

Create a new initialized OpenSslX509KeyManagerFactory which loads its PrivateKey directly from an OpenSSL engine via the ENGINE_load_private_key function.

newKeylessback to summary
public static OpenSslX509KeyManagerFactory newKeyless(File chain) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

See OpenSslX509KeyManagerFactory#newEngineBased(X509Certificate[], String).

newKeylessback to summary
public static OpenSslX509KeyManagerFactory newKeyless(InputStream chain) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

See OpenSslX509KeyManagerFactory#newEngineBased(X509Certificate[], String).

newKeylessback to summary
public static OpenSslX509KeyManagerFactory newKeyless(X509Certificate... certificateChain) throws CertificateException, IOException, KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

Returns a new initialized OpenSslX509KeyManagerFactory which will provide its private key by using the OpenSslPrivateKeyMethod.

newOpenSslKeyManagerFactorySpiback to summary
private static OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi newOpenSslKeyManagerFactorySpi(Provider provider)
newOpenSslKeyManagerFactorySpiback to summary
private static OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi newOpenSslKeyManagerFactorySpi(String algorithm, Provider provider) throws NoSuchAlgorithmException
newProviderback to summary
pack-priv OpenSslKeyMaterialProvider newProvider()
io.netty.handler.ssl back to summary

private final Class OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi

extends KeyManagerFactorySpi
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv final KeyManagerFactory
private volatile OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi.ProviderFactory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected KeyManager[]
engineGetKeyManagers()

Implements abstract javax.net.ssl.KeyManagerFactorySpi.engineGetKeyManagers.

Returns one key manager for each type of key material.
protected synchronized void
engineInit(KeyStore
the key store or null
keyStore
,
char[]
the password for recovering keys
chars
)

Implements abstract javax.net.ssl.KeyManagerFactorySpi.engineInit.

Initializes this factory with a source of key material.
protected void
engineInit(ManagerFactoryParameters
an implementation of a provider-specific parameter specification
managerFactoryParameters
)

Implements abstract javax.net.ssl.KeyManagerFactorySpi.engineInit.

Initializes this factory with a source of key material.
pack-priv OpenSslKeyMaterialProvider
private static String
password(char[] password)

Field Detail

kmfback to summary
pack-priv final KeyManagerFactory kmf
providerFactoryback to summary
private volatile OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi.ProviderFactory providerFactory

Constructor Detail

OpenSslKeyManagerFactorySpiback to summary
pack-priv OpenSslKeyManagerFactorySpi(KeyManagerFactory kmf)

Method Detail

engineGetKeyManagersback to summary
protected KeyManager[] engineGetKeyManagers()

Implements abstract javax.net.ssl.KeyManagerFactorySpi.engineGetKeyManagers.

Doc from javax.net.ssl.KeyManagerFactorySpi.engineGetKeyManagers.

Returns one key manager for each type of key material.

Returns:KeyManager[]

the key managers

Annotations
@Override
engineInitback to summary
protected synchronized void engineInit(KeyStore keyStore, char[] chars) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException

Implements abstract javax.net.ssl.KeyManagerFactorySpi.engineInit.

Doc from javax.net.ssl.KeyManagerFactorySpi.engineInit.

Initializes this factory with a source of key material.

Parameters
keyStore:KeyStore

the key store or null

chars:char[]

the password for recovering keys

Annotations
@Override
Exceptions
KeyStoreException:
if this operation fails
NoSuchAlgorithmException:
if the specified algorithm is not available from the specified provider.
UnrecoverableKeyException:
if the key cannot be recovered
engineInitback to summary
protected void engineInit(ManagerFactoryParameters managerFactoryParameters) throws InvalidAlgorithmParameterException

Implements abstract javax.net.ssl.KeyManagerFactorySpi.engineInit.

Doc from javax.net.ssl.KeyManagerFactorySpi.engineInit.

Initializes this factory with a source of key material.

In some cases, initialization parameters other than a keystore and password may be needed by a provider. Users of that particular provider are expected to pass an implementation of the appropriate ManagerFactoryParameters as defined by the provider. The provider can then call the specified methods in the ManagerFactoryParameters implementation to obtain the needed information.

Parameters
managerFactoryParameters:ManagerFactoryParameters

an implementation of a provider-specific parameter specification

Annotations
@Override
Exceptions
InvalidAlgorithmParameterException:
if there is problem with the parameters
newProviderback to summary
pack-priv OpenSslKeyMaterialProvider newProvider()
passwordback to summary
private static String password(char[] password)
io.netty.handler.ssl back to summary

private final Class OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi.ProviderFactory

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.handler.ssl.OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi.ProviderFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Iterable<String>
private final X509KeyManager
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
ProviderFactory(X509KeyManager keyManager, String password, Iterable<String> aliases)

Method Summary

Modifier and TypeMethod and Description
pack-priv OpenSslKeyMaterialProvider
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasesback to summary
private final Iterable<String> aliases
keyManagerback to summary
private final X509KeyManager keyManager
passwordback to summary
private final String password

Constructor Detail

ProviderFactoryback to summary
pack-priv ProviderFactory(X509KeyManager keyManager, String password, Iterable<String> aliases)

Method Detail

newProviderback to summary
pack-priv OpenSslKeyMaterialProvider newProvider()
io.netty.handler.ssl back to summary

private final Class OpenSslX509KeyManagerFactory.OpenSslKeyManagerFactorySpi.ProviderFactory.OpenSslPopulatedKeyMaterialProvider

extends OpenSslKeyMaterialProvider
Class Inheritance

OpenSslKeyMaterialProvider implementation that pre-compute the OpenSslKeyMaterial for all aliases.

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv OpenSslKeyMaterial
chooseKeyMaterial(ByteBufAllocator allocator, String alias)

Overrides io.netty.handler.ssl.OpenSslKeyMaterialProvider.chooseKeyMaterial.

Returns the OpenSslKeyMaterial or null (if none) that should be used during the handshake by OpenSSL.
pack-priv void
destroy()

Overrides io.netty.handler.ssl.OpenSslKeyMaterialProvider.destroy.

Will be invoked once the provider should be destroyed.
Inherited from io.netty.handler.ssl.OpenSslKeyMaterialProvider:
keyManagervalidateKeyMaterialSupported

Field Detail

materialMapback to summary
private final Map<String, Object> materialMap

Constructor Detail

OpenSslPopulatedKeyMaterialProviderback to summary
pack-priv OpenSslPopulatedKeyMaterialProvider(X509KeyManager keyManager, String password, Iterable<String> aliases)

Method Detail

chooseKeyMaterialback to summary
pack-priv OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, String alias) throws Exception

Overrides io.netty.handler.ssl.OpenSslKeyMaterialProvider.chooseKeyMaterial.

Doc from io.netty.handler.ssl.OpenSslKeyMaterialProvider.chooseKeyMaterial.

Returns the OpenSslKeyMaterial or null (if none) that should be used during the handshake by OpenSSL.

Annotations
@Override
destroyback to summary
pack-priv void destroy()

Overrides io.netty.handler.ssl.OpenSslKeyMaterialProvider.destroy.

Doc from io.netty.handler.ssl.OpenSslKeyMaterialProvider.destroy.

Will be invoked once the provider should be destroyed.

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

private final Class OpenSslX509KeyManagerFactory.OpenSslKeyStore

extends KeyStore
Class Inheritance

Constructor Summary

AccessConstructor and Description
private
OpenSslKeyStore(final X509Certificate[] certificateChain, final boolean keyless)

Method Summary

Inherited from java.security.KeyStore:
aliasescontainsAliasdeleteEntryentryInstanceOfgetAttributesgetCertificategetCertificateAliasgetCertificateChaingetCreationDategetDefaultTypegetEntrygetInstancegetInstancegetInstancegetInstancegetInstancegetKeygetProvidergetTypeisCertificateEntryisKeyEntryloadloadsetCertificateEntrysetEntrysetKeyEntrysetKeyEntrysizestorestore

Constructor Detail

OpenSslKeyStoreback to summary
private OpenSslKeyStore(final X509Certificate[] certificateChain, final boolean keyless)