public class SSLUtils extends Object
IAIKX509TrustManager.
This TrustManager implementation features CRL checking.SSLUtils caches secure socket factories for given ConnectionParameters.| Constructor and Description |
|---|
SSLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static SSLSocketFactory |
getSSLSocketFactory(at.gv.egovernment.moa.id.commons.api.ConfigurationProvider conf,
at.gv.egovernment.moa.id.commons.api.ConnectionParameterInterface connParam)
Creates an
SSLSocketFactory which utilizes an
IAIKX509TrustManager for the given trust store,
and the given key store. |
static void |
initialize() |
static String |
readHttpsURL(at.gv.egovernment.moa.id.commons.api.ConfigurationProvider conf,
ConnectionParameter connParam)
Reads a file, given by URL, into a byte array,
securing the connection by IAIKX509TrustManager.
|
public static void initialize()
public static SSLSocketFactory getSSLSocketFactory(at.gv.egovernment.moa.id.commons.api.ConfigurationProvider conf, at.gv.egovernment.moa.id.commons.api.ConnectionParameterInterface connParam) throws IOException, GeneralSecurityException, at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException, iaik.pki.PKIException
SSLSocketFactory which utilizes an
IAIKX509TrustManager for the given trust store,
and the given key store.conf - configuration provider providing a generic properties pointing
to trusted CA store and certificate store rootconnParam - connection parameter containing the client key store settings
to be used in case of client authentication;
if connParam.getClientKeyStore() == null, client authentication
is assumed to be disabledSSLSocketFactory to be used by an HttpsURLConnectionIOException - thrown while reading key store fileGeneralSecurityException - thrown while creating the socket factoryat.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException - on invalid configuration dataiaik.pki.PKIException - while initializing the IAIKX509TrustManagerpublic static String readHttpsURL(at.gv.egovernment.moa.id.commons.api.ConfigurationProvider conf, ConnectionParameter connParam) throws at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException, iaik.pki.PKIException, IOException, GeneralSecurityException
connParam - containing URL and accepted server certificatesconf - ConfigurationProvider for readingat.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException - on invalid configuration dataiaik.pki.PKIException - on invalid configuration dataIOException - on data-reading problemsGeneralSecurityException - on security issuesCopyright © 2017. All rights reserved.