Class SSLUtils
- java.lang.Object
-
- io.streamthoughts.azkarra.client.security.SSLUtils
-
public class SSLUtils extends Object
Utility class for SSL.
-
-
Constructor Summary
Constructors Constructor Description SSLUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static KeyManager[]
createKeyManagers(String keyStoreLocation, char[] keyPassword, String keyStoreType, String defaultAlgorithm)
static KeyStore
createKeyStore(String keyStoreLocation, char[] keyStorePassword, String keyStoreType)
Helper method to create a newKeyStore
.static TrustManager[]
createTrustManagers(String trustStoreLocation, char[] trustStorePassword, String trustStoreType, String defaultAlgorithm)
static X509TrustManager
getX509TrustManager(TrustManager[] trustManagers)
Helpers method to get the firstX509TrustManager
in the givenTrustManager
.
-
-
-
Method Detail
-
getX509TrustManager
public static X509TrustManager getX509TrustManager(TrustManager[] trustManagers)
Helpers method to get the firstX509TrustManager
in the givenTrustManager
.- Parameters:
trustManagers
- the TrustManager array to look-up.- Returns:
- the
X509TrustManager
ornull
.
-
createTrustManagers
public static TrustManager[] createTrustManagers(String trustStoreLocation, char[] trustStorePassword, String trustStoreType, String defaultAlgorithm) throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException
-
createKeyManagers
public static KeyManager[] createKeyManagers(String keyStoreLocation, char[] keyPassword, String keyStoreType, String defaultAlgorithm) throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException
-
createKeyStore
public static KeyStore createKeyStore(String keyStoreLocation, char[] keyStorePassword, String keyStoreType) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException
Helper method to create a newKeyStore
.- Parameters:
keyStoreLocation
- the location of the Keystore file.keyStorePassword
- the password of the Keystore.keyStoreType
- the type of the Keystore.- Returns:
- a new
KeyStore
instance. - Throws:
KeyStoreException
CertificateException
NoSuchAlgorithmException
IOException
-
-