``` static CertificateFactory getCertificateFactory(final String type, final Provider provider) throws CertificateException { final CertificateFactorySpi spi = (CertificateFactorySpi) getImplEngine("CertificateFactory", type); if ( spi == null ) throw new CertificateException(type + " not found"); return CertificateFactory.getInstance(type, provider); } ```