Package org.apache.commons.net.util
Class SSLContextUtils
java.lang.Object
org.apache.commons.net.util.SSLContextUtils
General utilities for SSLContext.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic SSLContext
createSSLContext
(String protocol, KeyManager[] keyManagers, TrustManager[] trustManagers) Create and initialize an SSLContext.static SSLContext
createSSLContext
(String protocol, KeyManager keyManager, TrustManager trustManager) Create and initialize an SSLContext.
-
Method Details
-
createSSLContext
public static SSLContext createSSLContext(String protocol, KeyManager keyManager, TrustManager trustManager) throws IOException Create and initialize an SSLContext.- Parameters:
protocol
- the protocol used to instantiate the contextkeyManager
- the key manager, may benull
trustManager
- the trust manager, may benull
- Returns:
- the initialized context.
- Throws:
IOException
- this is used to wrap anyGeneralSecurityException
that occurs
-
createSSLContext
public static SSLContext createSSLContext(String protocol, KeyManager[] keyManagers, TrustManager[] trustManagers) throws IOException Create and initialize an SSLContext.- Parameters:
protocol
- the protocol used to instantiate the contextkeyManagers
- the array of key managers, may benull
but array entries must not benull
trustManagers
- the array of trust managers, may benull
but array entries must not benull
- Returns:
- the initialized context.
- Throws:
IOException
- this is used to wrap anyGeneralSecurityException
that occurs
-