Package io.netty.handler.ssl
Class OpenSslX509KeyManagerFactory
- java.lang.Object
-
- javax.net.ssl.KeyManagerFactory
-
- io.netty.handler.ssl.OpenSslX509KeyManagerFactory
-
public final class OpenSslX509KeyManagerFactory extends javax.net.ssl.KeyManagerFactorySpecialKeyManagerFactorythat pre-compute the keymaterial used whenSslProvider.OPENSSLorSslProvider.OPENSSL_REFCNTis used and so will improve handshake times and its performance. Because the keymaterial is pre-computed any modification to theKeyStoreis ignored afterKeyManagerFactory.init(KeyStore, char[])is called.KeyManagerFactory.init(ManagerFactoryParameters)is not supported by this implementation and so a call to it will always result in anInvalidAlgorithmParameterException.
-
-
Constructor Summary
Constructors Constructor Description OpenSslX509KeyManagerFactory()OpenSslX509KeyManagerFactory(java.lang.String algorithm, java.security.Provider provider)OpenSslX509KeyManagerFactory(java.security.Provider provider)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OpenSslX509KeyManagerFactorynewEngineBased(java.io.File certificateChain, java.lang.String password)Create a new initializedOpenSslX509KeyManagerFactorywhich loads itsPrivateKeydirectly from anOpenSSL enginevia the ENGINE_load_private_key function.static OpenSslX509KeyManagerFactorynewEngineBased(java.security.cert.X509Certificate[] certificateChain, java.lang.String password)Create a new initializedOpenSslX509KeyManagerFactorywhich loads itsPrivateKeydirectly from anOpenSSL enginevia the ENGINE_load_private_key function.static OpenSslX509KeyManagerFactorynewKeyless(java.io.File chain)static OpenSslX509KeyManagerFactorynewKeyless(java.io.InputStream chain)static OpenSslX509KeyManagerFactorynewKeyless(java.security.cert.X509Certificate... certificateChain)Returns a new initializedOpenSslX509KeyManagerFactorywhich will provide its private key by using theOpenSslPrivateKeyMethod.
-
-
-
Constructor Detail
-
OpenSslX509KeyManagerFactory
public OpenSslX509KeyManagerFactory()
-
OpenSslX509KeyManagerFactory
public OpenSslX509KeyManagerFactory(java.security.Provider provider)
-
OpenSslX509KeyManagerFactory
public OpenSslX509KeyManagerFactory(java.lang.String algorithm, java.security.Provider provider) throws java.security.NoSuchAlgorithmException- Throws:
java.security.NoSuchAlgorithmException
-
-
Method Detail
-
newEngineBased
public static OpenSslX509KeyManagerFactory newEngineBased(java.io.File certificateChain, java.lang.String password) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
Create a new initializedOpenSslX509KeyManagerFactorywhich loads itsPrivateKeydirectly from anOpenSSL enginevia the ENGINE_load_private_key function.- Throws:
java.security.cert.CertificateExceptionjava.io.IOExceptionjava.security.KeyStoreExceptionjava.security.NoSuchAlgorithmExceptionjava.security.UnrecoverableKeyException
-
newEngineBased
public static OpenSslX509KeyManagerFactory newEngineBased(java.security.cert.X509Certificate[] certificateChain, java.lang.String password) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
Create a new initializedOpenSslX509KeyManagerFactorywhich loads itsPrivateKeydirectly from anOpenSSL enginevia the ENGINE_load_private_key function.- Throws:
java.security.cert.CertificateExceptionjava.io.IOExceptionjava.security.KeyStoreExceptionjava.security.NoSuchAlgorithmExceptionjava.security.UnrecoverableKeyException
-
newKeyless
public static OpenSslX509KeyManagerFactory newKeyless(java.io.File chain) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
- Throws:
java.security.cert.CertificateExceptionjava.io.IOExceptionjava.security.KeyStoreExceptionjava.security.NoSuchAlgorithmExceptionjava.security.UnrecoverableKeyException
-
newKeyless
public static OpenSslX509KeyManagerFactory newKeyless(java.io.InputStream chain) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
- Throws:
java.security.cert.CertificateExceptionjava.io.IOExceptionjava.security.KeyStoreExceptionjava.security.NoSuchAlgorithmExceptionjava.security.UnrecoverableKeyException
-
newKeyless
public static OpenSslX509KeyManagerFactory newKeyless(java.security.cert.X509Certificate... certificateChain) throws java.security.cert.CertificateException, java.io.IOException, java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
Returns a new initializedOpenSslX509KeyManagerFactorywhich will provide its private key by using theOpenSslPrivateKeyMethod.- Throws:
java.security.cert.CertificateExceptionjava.io.IOExceptionjava.security.KeyStoreExceptionjava.security.NoSuchAlgorithmExceptionjava.security.UnrecoverableKeyException
-
-