protected static Collection findCertificates(X509AttributeCertStoreSelector certSelect, List certStores) throws AnnotatedException { Set certs = new HashSet(); Iterator iter = certStores.iterator(); while (iter.hasNext()) { Object obj = iter.next(); if (obj instanceof X509Store) { X509Store certStore = (X509Store)obj; try { certs.addAll(certStore.getMatches(certSelect)); } catch (StoreException e) { throw new AnnotatedException( "Problem while picking certificates from X.509 store.", e); } } } return certs; }
public static X509Store getInstance(String type, X509StoreParameters parameters, Provider provider) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type, provider); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
private static X509Store createStore(X509Util.Implementation impl, X509StoreParameters parameters) { X509StoreSpi spi = (X509StoreSpi)impl.getEngine(); spi.engineInit(parameters); return new X509Store(impl.getProvider(), spi); }
public static X509Store getInstance(String type, X509StoreParameters parameters) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
pkixParams.addAdditionalStore(X509Store.getInstance( "CERTIFICATE/LDAP", params, BouncyCastleProvider.PROVIDER_NAME)); pkixParams.addAdditionalStore(X509Store.getInstance( "CRL/LDAP", params, BouncyCastleProvider.PROVIDER_NAME)); pkixParams.addAdditionalStore(X509Store.getInstance( "ATTRIBUTECERTIFICATE/LDAP", params, BouncyCastleProvider.PROVIDER_NAME)); pkixParams.addAdditionalStore(X509Store.getInstance( "CERTIFICATEPAIR/LDAP", params, BouncyCastleProvider.PROVIDER_NAME));
private static X509Store createStore(X509Util.Implementation impl, X509StoreParameters parameters) { X509StoreSpi spi = (X509StoreSpi)impl.getEngine(); spi.engineInit(parameters); return new X509Store(impl.getProvider(), spi); }
public static X509Store getInstance(String type, X509StoreParameters parameters) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
pkixParams.addAdditionalStore(X509Store.getInstance( "CERTIFICATE/LDAP", params, BouncyCastleProvider.PROVIDER_NAME)); pkixParams.addAdditionalStore(X509Store.getInstance( "CRL/LDAP", params, BouncyCastleProvider.PROVIDER_NAME)); pkixParams.addAdditionalStore(X509Store.getInstance( "ATTRIBUTECERTIFICATE/LDAP", params, BouncyCastleProvider.PROVIDER_NAME)); pkixParams.addAdditionalStore(X509Store.getInstance( "CERTIFICATEPAIR/LDAP", params, BouncyCastleProvider.PROVIDER_NAME));
protected static Collection findCertificates(X509AttributeCertStoreSelector certSelect, List certStores) throws AnnotatedException { Set certs = new HashSet(); Iterator iter = certStores.iterator(); while (iter.hasNext()) { Object obj = iter.next(); if (obj instanceof X509Store) { X509Store certStore = (X509Store)obj; try { certs.addAll(certStore.getMatches(certSelect)); } catch (StoreException e) { throw new AnnotatedException( "Problem while picking certificates from X.509 store.", e); } } } return certs; }
public static X509Store getInstance(String type, X509StoreParameters parameters, Provider provider) throws NoSuchStoreException { try { X509Util.Implementation impl = X509Util.getImplementation("X509Store", type, provider); return createStore(impl, parameters); } catch (NoSuchAlgorithmException e) { throw new NoSuchStoreException(e.getMessage()); } }
public Collection<X59Certificate> getCertificates(String path) throws Exception { Security.addProvider(new BouncyCastleProvider()); CMSSignedData sd = new CMSSignedData(new FileInputStream(path)); X509Store store = sd.getCertificates("Collection", "BC"); Collection<X509Certificate> certificates = store.getMatches(X509CertStoreSelector.getInstance(new X509CertSelector())); return certificates; }
try certs.addAll(certStore.getMatches(certSelect));
crls.addAll(store.getMatches(crlSelect)); foundValidStore = true;
crls.addAll(store.getMatches(crlSelect)); foundValidStore = true;