Package com.complexible.common.net.ssl
Class SSLContextFactory
java.lang.Object
com.complexible.common.net.ssl.SSLContextFactory
Utility class for creating SSLContext instances for use by a Netty stack.
- Since:
- 0.8
- Version:
- 2.0
- Author:
- Michael Grove
-
Method Summary
Modifier and TypeMethodDescriptionstatic SSLEngineclientEngine(SSLContext theContext) Create an SSLEngine for a SNARL Clientstatic SSLContextcreateSSLContext(String theKeyStorePath, char[] theKeyStorePasswd, String theTrustStorePath, char[] theTrustStorePasswd) Create a SSLContext w/ the default keystore type ofSTORE_TYPE.static SSLContextcreateSSLContext(String theKeyStoreType, String theKeyStorePath, char[] theKeyStorePasswd, String theTrustStoreType, String theTrustStorePath, char[] theTrustStorePasswd) Create a SSLContext with the specified keystore type.static Stringstatic SSLEngineserverEngine(SSLContext theContext) Create an SSLEngine for a SNARL serverstatic URLvalidateResourceURL(String thePath)
-
Method Details
-
clientEngine
Create an SSLEngine for a SNARL Client- Parameters:
theContext- the client SSL context- Returns:
- the client SSL engine created from the context
-
serverEngine
Create an SSLEngine for a SNARL server- Parameters:
theContext- the server SSL context- Returns:
- the server SSL engine created from the context
-
createSSLContext
public static SSLContext createSSLContext(String theKeyStorePath, char[] theKeyStorePasswd, String theTrustStorePath, char[] theTrustStorePasswd) throws SSLException Create a SSLContext w/ the default keystore type ofSTORE_TYPE. One of the keystore path or trust store path must be non-null- Parameters:
theKeyStorePath- the location of the keystore, or null to create the context w/o a key storetheKeyStorePasswd- the keystore passwordtheTrustStorePath- the location of the trust store, or null to create the context w/o a trust storetheTrustStorePasswd- the trust store password- Returns:
- the new SSLContext
- Throws:
SSLException- if there was an error creating the context
-
createSSLContext
public static SSLContext createSSLContext(String theKeyStoreType, String theKeyStorePath, char[] theKeyStorePasswd, String theTrustStoreType, String theTrustStorePath, char[] theTrustStorePasswd) throws SSLException Create a SSLContext with the specified keystore type. One of the keystore path or trust store path must be non-null- Parameters:
theKeyStoreType- the keystore typetheKeyStorePath- the location of the keystore, or null to create the context w/o a key storetheKeyStorePasswd- the keystore passwordtheTrustStoreType- the trust store typetheTrustStorePath- the location of the trust store, or null to create the context w/o a trust storetheTrustStorePasswd- the trust store password- Returns:
- the new SSLContext
- Throws:
SSLException- if there was an error creating the context
-
path
-
validateResourceURL
public static URL validateResourceURL(String thePath) throws KeyStoreException, MalformedURLException
-