Package org.summerboot.jexpress.security
Class SSLUtil
java.lang.Object
org.summerboot.jexpress.security.SSLUtil
- Author:
- Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Stringstatic final HostnameVerifierTo ignore the host name verificationstatic final TrustManager[]protected static final X509Certificate[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyManagerFactorybuildKeyManagerFactory(String keyStorePath, char[] keyStorePwd, String keyAlias, char[] keyPwd) static KeyManager[]buildKeyManagers(String keyStorePath, char[] keyStorePwd, String keyAlias, char[] keyPwd) static SSLContextbuildSSLContext(String keyStorePath, char[] keyStorePwd, String keyAlias, char[] keyPwd, String protocol, String trustStorePath, char[] trustStorePwd) static SSLContextbuildSSLContext(KeyManager[] kms, TrustManager[] tms, String protocol) static TrustManagerFactorybuildTrustManagerFactory(String trustStorePath, char[] trustStorePwd) static TrustManager[]buildTrustManagers(String trustStorePath, char[] trustStorePwd)
-
Field Details
-
DEFAULT_PROTOCOL
-
IGNORE_HOST_NAME_VERIFIER
To ignore the host name verification -
TRUSTED_CERTIFICATE
-
TRUST_ALL_CERTIFICATES
-
-
Constructor Details
-
SSLUtil
public SSLUtil()
-
-
Method Details
-
buildKeyManagerFactory
public static KeyManagerFactory buildKeyManagerFactory(String keyStorePath, char[] keyStorePwd, String keyAlias, char[] keyPwd) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
buildKeyManagers
public static KeyManager[] buildKeyManagers(String keyStorePath, char[] keyStorePwd, String keyAlias, char[] keyPwd) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
buildTrustManagerFactory
public static TrustManagerFactory buildTrustManagerFactory(String trustStorePath, char[] trustStorePwd) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
buildTrustManagers
public static TrustManager[] buildTrustManagers(String trustStorePath, char[] trustStorePwd) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
buildSSLContext
public static SSLContext buildSSLContext(String keyStorePath, char[] keyStorePwd, String keyAlias, char[] keyPwd, String protocol, String trustStorePath, char[] trustStorePwd) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-
buildSSLContext
public static SSLContext buildSSLContext(KeyManager[] kms, TrustManager[] tms, String protocol) throws GeneralSecurityException, IOException - Throws:
GeneralSecurityExceptionIOException
-