@Test public void ensureBouncyCastleInstalled() throws CertificateException { CertificateFactory factory = CertificateFactory.getInstance("X.509"); assertThat(factory.getProvider().getName()).isEqualTo(BouncyCastleProvider.PROVIDER_NAME); }
/** * Sets the CertificateFactory instance on this Crypto instance * * @param provider the CertificateFactory provider name * @param certFactory the CertificateFactory the CertificateFactory instance to set */ public void setCertificateFactory(String provider, CertificateFactory certFactory) { if (provider == null || provider.length() == 0) { certFactMap.put(certFactory.getProvider().getName(), certFactory); } else { certFactMap.put(provider, certFactory); } }
/** * Sets the CertificateFactory instance on this Crypto instance * * @param provider the CertificateFactory provider name * @param certFactory the CertificateFactory the CertificateFactory instance to set */ public void setCertificateFactory(String provider, CertificateFactory certFactory) { if (provider == null || provider.length() == 0) { certFactMap.put(certFactory.getProvider().getName(), certFactory); } else { certFactMap.put(provider, certFactory); } }
public Provider getPkixProvider() { try { if (Security.getProvider("IBMCertPath") != null) { return Security.getProvider("IBMCertPath"); } return helper.createCertificateFactory("X.509").getProvider(); } catch (GeneralSecurityException e) { throw new IllegalStateException("unable to find CertificateFactory"); } }
@Override public CertificateFactory createCertificateFactory(final String type) throws CertificateException { checkNotNull(type); CertificateFactory obj; try { obj = CertificateFactory.getInstance(type, getProvider()); } catch (CertificateException e) { logFallback(e); obj = CertificateFactory.getInstance(type); } if (log.isTraceEnabled()) { log.trace("Created certificate-factory: {} ({})", obj.getType(), obj.getProvider().getName()); } return obj; }
certFactMap.put(provider, factory); certFactMap.put(factory.getProvider().getName(), factory); } catch (CertificateException e) { throw new WSSecurityException(
certFactMap.put(provider, factory); certFactMap.put(factory.getProvider().getName(), factory); } catch (CertificateException e) { throw new WSSecurityException(
"X.509", "BC"); LOG.debug("certificate factory provider: " + certificateFactory.getProvider().getName()); LOG.debug("certificate factory class: " + certificateFactory.getClass().getName());
certFactMap.put(provider, factory); certFactMap.put(factory.getProvider().getName(), factory); } catch (CertificateException e) { throw new WSSecurityException(
certFactMap.put(provider, factory); certFactMap.put(factory.getProvider().getName(), factory); } catch (CertificateException e) { throw new WSSecurityException(
CertificateFactory cf = CertificateFactory.getInstance("X.509"); PEMReader pr = new PEMReader(new InputStreamReader(fis), null, cf.getProvider().getName()); Object cert; while ((cert = pr.readObject()) != null) {