class OadrPKISecurity {

	public static TrustManagerFactory createTrustManagerFactory(List<String> trustedCertificateFilePath)
			throws OadrSecurityException {
		TrustManagerFactory tmf = null;
		try {
			KeyStore ts = KeyStore.getInstance(KeyStore.getDefaultType());
			ts.load(null, null);
			for (String certPath : trustedCertificateFilePath) {
				X509Certificate cert = OadrPKISecurity.parseCertificate(certPath);
				File file = new File(certPath);
				ts.setCertificateEntry(file.getName(), cert);
			}
			tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
			tmf.init(ts);
		} catch (KeyStoreException | NoSuchAlgorithmException | CertificateException | IOException e) {
			throw new OadrSecurityException(e);
		}
		return tmf;
	}

	private  OadrPKISecurity();

}