⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sslcontextfactory.java

📁 mina是以Java实现的一个开源的网络程序框架
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     * will all be ignored.     *     * @param factory the factory.     */    public void setKeyManagerFactory(KeyManagerFactory factory) {        this.keyManagerFactory = factory;    }    /**     * Sets the algorithm to use when creating the {@link KeyManagerFactory}     * using {@link KeyManagerFactory#getInstance(java.lang.String)} or     * {@link KeyManagerFactory#getInstance(java.lang.String, java.lang.String)}.     * <p>     * This property will be ignored if a {@link KeyManagerFactory} has been     * set directly using {@link #setKeyManagerFactory(KeyManagerFactory)}.     * </p>     * <p>     * If this property isn't set while no {@link KeyManagerFactory} has been     * set using {@link #setKeyManagerFactory(KeyManagerFactory)} and     * {@link #setKeyManagerFactoryAlgorithmUseDefault(boolean)} has been set to     * <code>true</code> the value returned     * by {@link KeyManagerFactory#getDefaultAlgorithm()} will be used instead.     * </p>     *     * @param algorithm the algorithm to use.     */    public void setKeyManagerFactoryAlgorithm(String algorithm) {        this.keyManagerFactoryAlgorithm = algorithm;    }    /**     * Sets the provider to use when creating the {@link KeyManagerFactory}     * using     * {@link KeyManagerFactory#getInstance(java.lang.String, java.lang.String)}.     * <p>     * This property will be ignored if a {@link KeyManagerFactory} has been     * set directly using {@link #setKeyManagerFactory(KeyManagerFactory)}.     * </p>     * <p>     * If this property isn't set and no {@link KeyManagerFactory} has been set     * using {@link #setKeyManagerFactory(KeyManagerFactory)}     * {@link KeyManagerFactory#getInstance(java.lang.String)} will be used     * to create the {@link KeyManagerFactory}.     * </p>     *     * @param provider the name of the provider.     */    public void setKeyManagerFactoryProvider(String provider) {        this.keyManagerFactoryProvider = provider;    }    /**     * Sets the {@link KeyStore} which will be used in the call to     * {@link KeyManagerFactory#init(java.security.KeyStore, char[])} when     * the {@link SSLContext} is created.     *     * @param keyStore the key store.     */    public void setKeyManagerFactoryKeyStore(KeyStore keyStore) {        this.keyManagerFactoryKeyStore = keyStore;    }    /**     * Sets the password which will be used in the call to     * {@link KeyManagerFactory#init(java.security.KeyStore, char[])} when     * the {@link SSLContext} is created.     *     * @param password the password. Use <code>null</code> to disable password.     */    public void setKeyManagerFactoryKeyStorePassword(String password) {        if (password != null) {            this.keyManagerFactoryKeyStorePassword = password.toCharArray();        } else {            this.keyManagerFactoryKeyStorePassword = null;        }    }    /**     * Sets the {@link TrustManagerFactory} to use. If this is set the     * properties which are used by this factory bean to create a     * {@link TrustManagerFactory} will all be ignored.     *     * @param factory     *            the factory.     */    public void setTrustManagerFactory(TrustManagerFactory factory) {        this.trustManagerFactory = factory;    }    /**     * Sets the algorithm to use when creating the {@link TrustManagerFactory}     * using {@link TrustManagerFactory#getInstance(java.lang.String)} or     * {@link TrustManagerFactory#getInstance(java.lang.String, java.lang.String)}.     * <p>     * This property will be ignored if a {@link TrustManagerFactory} has been     * set directly using {@link #setTrustManagerFactory(TrustManagerFactory)}.     * </p>     * <p>     * If this property isn't set while no {@link TrustManagerFactory} has been     * set using {@link #setTrustManagerFactory(TrustManagerFactory)} and     * {@link #setTrustManagerFactoryAlgorithmUseDefault(boolean)} has been set to     * <code>true</code> the value returned     * by {@link TrustManagerFactory#getDefaultAlgorithm()} will be used instead.     * </p>     *     * @param algorithm the algorithm to use.     */    public void setTrustManagerFactoryAlgorithm(String algorithm) {        this.trustManagerFactoryAlgorithm = algorithm;    }    /**     * Sets the {@link KeyStore} which will be used in the call to     * {@link TrustManagerFactory#init(java.security.KeyStore)} when     * the {@link SSLContext} is created.     * <p>     * This property will be ignored if {@link ManagerFactoryParameters} has been     * set directly using {@link #setTrustManagerFactoryParameters(ManagerFactoryParameters)}.     * </p>     *     * @param keyStore the key store.     */    public void setTrustManagerFactoryKeyStore(KeyStore keyStore) {        this.trustManagerFactoryKeyStore = keyStore;    }    /**     * Sets the {@link ManagerFactoryParameters} which will be used in the call to     * {@link TrustManagerFactory#init(javax.net.ssl.ManagerFactoryParameters)} when     * the {@link SSLContext} is created.     *     * @param parameters describing provider-specific trust material.     */    public void setTrustManagerFactoryParameters(            ManagerFactoryParameters parameters) {        this.trustManagerFactoryParameters = parameters;    }    /**     * Sets the provider to use when creating the {@link TrustManagerFactory}     * using     * {@link TrustManagerFactory#getInstance(java.lang.String, java.lang.String)}.     * <p>     * This property will be ignored if a {@link TrustManagerFactory} has been     * set directly using {@link #setTrustManagerFactory(TrustManagerFactory)}.     * </p>     * <p>     * If this property isn't set and no {@link TrustManagerFactory} has been set     * using {@link #setTrustManagerFactory(TrustManagerFactory)}     * {@link TrustManagerFactory#getInstance(java.lang.String)} will be used     * to create the {@link TrustManagerFactory}.     * </p>     *     * @param provider the name of the provider.     */    public void setTrustManagerFactoryProvider(String provider) {        this.trustManagerFactoryProvider = provider;    }    /**     * Sets the {@link SecureRandom} to use when initializing the     * {@link SSLContext}. The JVM's default will be used if this isn't set.     *     * @param secureRandom the {@link SecureRandom} or <code>null</code> if the     *        JVM's default should be used.     * @see SSLContext#init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)     */    public void setSecureRandom(SecureRandom secureRandom) {        this.secureRandom = secureRandom;    }    /**     * Sets the SSLSession cache size for the {@link SSLSessionContext} for use in client mode.     *     * @param size the new session cache size limit; zero means there is no limit.     * @see SSLSessionContext#setSessionCacheSize(int size)     */    public void setClientSessionCacheSize(int size) {        this.clientSessionCacheSize = size;    }    /**     * Set the SSLSession timeout limit for the {@link SSLSessionContext} for use in client mode.     *     * @param seconds the new session timeout limit in seconds; zero means there is no limit.     * @see SSLSessionContext#setSessionTimeout(int seconds)     */    public void setClientSessionTimeout(int seconds) {        this.clientSessionTimeout = seconds;    }    /**     * Sets the SSLSession cache size for the {@link SSLSessionContext} for use in server mode.     *     * @param serverSessionCacheSize the new session cache size limit; zero means there is no limit.     * @see SSLSessionContext#setSessionCacheSize(int)     */    public void setServerSessionCacheSize(int serverSessionCacheSize) {        this.serverSessionCacheSize = serverSessionCacheSize;    }    /**     * Set the SSLSession timeout limit for the {@link SSLSessionContext} for use in server mode.     *     * @param serverSessionTimeout the new session timeout limit in seconds; zero means there is no limit.     * @see SSLSessionContext#setSessionTimeout(int)     */    public void setServerSessionTimeout(int serverSessionTimeout) {        this.serverSessionTimeout = serverSessionTimeout;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -