Java tutorial
//package com.java2s; import java.security.NoSuchProviderException; import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; public class Main { static CertificateFactory createX509CertificateFactory(String provider) throws CertificateException, NoSuchProviderException { if (provider == null) { return CertificateFactory.getInstance("X.509"); } return CertificateFactory.getInstance("X.509", provider); } }