public class SSLUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
TLS_PROTOCOL_PREFERENCES |
Modifier and Type | Method and Description |
---|---|
static String[] |
filterEnabledCipherSuites(String[] enabledCipherSuites,
String[] supportedCipherSuites,
List<String> cipherSuiteWhiteList,
List<String> cipherSuiteBlackList) |
static String[] |
filterEnabledProtocols(String[] enabledProtocols,
String[] supportedProtocols,
List<String> protocolWhiteList,
List<String> protocolBlackList) |
static String |
getIdFromSubjectDN(String dn) |
static KeyStore |
getInitializedKeyStore(String storePath,
String storePassword,
String keyStoreType) |
static KeyStore |
getInitializedKeyStore(URL storePath,
String storePassword,
String keyStoreType) |
static X509Certificate[] |
readCertificates(InputStream input) |
static X509Certificate[] |
readCertificates(URL certFile) |
static PrivateKey |
readPrivateKey(byte[] content,
String algorithm) |
static PrivateKey |
readPrivateKey(InputStream input) |
static PrivateKey |
readPrivateKey(URL url) |
static String |
retrieveIdentity(SSLEngine engine) |
static SSLContext |
tryGetSSLContext() |
static SSLContext |
tryGetSSLContext(String[] protocols) |
static void |
updateEnabledCipherSuites(SSLEngine engine,
List<String> cipherSuitesWhiteList,
List<String> cipherSuitesBlackList) |
static void |
updateEnabledCipherSuites(SSLSocket socket,
List<String> cipherSuitesWhiteList,
List<String> cipherSuitesBlackList) |
static void |
updateEnabledTlsProtocols(SSLEngine engine,
List<String> protocolWhiteList,
List<String> protocolBlackList) |
static void |
updateEnabledTlsProtocols(SSLSocket socket,
List<String> protocolWhiteList,
List<String> protocolBlackList) |
static void |
verifyHostname(SSLEngine engine,
String hostnameExpected) |
static void |
verifyHostname(String hostnameExpected,
X509Certificate cert) |
public static final String[] TLS_PROTOCOL_PREFERENCES
public static void verifyHostname(String hostnameExpected, X509Certificate cert)
public static KeyStore getInitializedKeyStore(String storePath, String storePassword, String keyStoreType) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public static KeyStore getInitializedKeyStore(URL storePath, String storePassword, String keyStoreType) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
public static X509Certificate[] readCertificates(URL certFile) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static X509Certificate[] readCertificates(InputStream input) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static PrivateKey readPrivateKey(URL url) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static PrivateKey readPrivateKey(InputStream input) throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public static PrivateKey readPrivateKey(byte[] content, String algorithm) throws NoSuchAlgorithmException, InvalidKeySpecException
public static void updateEnabledTlsProtocols(SSLEngine engine, List<String> protocolWhiteList, List<String> protocolBlackList)
public static void updateEnabledTlsProtocols(SSLSocket socket, List<String> protocolWhiteList, List<String> protocolBlackList)
public static String[] filterEnabledProtocols(String[] enabledProtocols, String[] supportedProtocols, List<String> protocolWhiteList, List<String> protocolBlackList)
public static String[] filterEnabledCipherSuites(String[] enabledCipherSuites, String[] supportedCipherSuites, List<String> cipherSuiteWhiteList, List<String> cipherSuiteBlackList)
public static void updateEnabledCipherSuites(SSLEngine engine, List<String> cipherSuitesWhiteList, List<String> cipherSuitesBlackList)
public static void updateEnabledCipherSuites(SSLSocket socket, List<String> cipherSuitesWhiteList, List<String> cipherSuitesBlackList)
public static SSLContext tryGetSSLContext() throws NoSuchAlgorithmException
NoSuchAlgorithmException
public static SSLContext tryGetSSLContext(String[] protocols) throws NoSuchAlgorithmException
NoSuchAlgorithmException
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.