certificateHolderSet.addAll(certificatesStore.getMatches(null)); certificateHolderSet.addAll(timeStampToken.getCertificates().getMatches(null)); verifyCertificateChain(new CollectionStore<>(certificateHolderSet), certFromTimeStamp, timeStampToken.getTimeStampInfo().getGenTime());
public Collection engineGetMatches(Selector selector) { return _store.getMatches(selector); } }
public void engineInit(X509StoreParameters params) { if (!(params instanceof X509CollectionStoreParameters)) { throw new IllegalArgumentException(params.toString()); } _store = new CollectionStore(((X509CollectionStoreParameters)params).getCollection()); }
public Collection engineGetMatches(Selector selector) { return _store.getMatches(selector); } }
public void engineInit(X509StoreParameters params) { if (!(params instanceof X509CollectionStoreParameters)) { throw new IllegalArgumentException(params.toString()); } _store = new CollectionStore(((X509CollectionStoreParameters)params).getCollection()); }
public Collection engineGetMatches(Selector selector) { return _store.getMatches(selector); } }
public void engineInit(X509StoreParameters params) { if (!(params instanceof X509CollectionStoreParameters)) { throw new IllegalArgumentException(params.toString()); } _store = new CollectionStore(((X509CollectionStoreParameters)params).getCollection()); }
/** * Returns a colelction of certificate pairs which match the given * <code>selector</code>. * <p> * The returned collection contains * {@link org.bouncycastle.x509.X509CertificatePair}s. The selector must be * a {@link org.bouncycastle.x509.X509CertPairStoreSelector} to select * certificate pairs. * </p> * @return A collection with matching certificate pairs. */ public Collection engineGetMatches(Selector selector) { return _store.getMatches(selector); } }
/** * Initializes this store. * * @param params The {@link X509CollectionStoreParameters}s for this store. * @throws IllegalArgumentException if <code>params</code> is no instance of * <code>X509CollectionStoreParameters</code>. */ public void engineInit(X509StoreParameters params) { if (!(params instanceof X509CollectionStoreParameters)) { throw new IllegalArgumentException( "Initialization parameters must be an instance of " + X509CollectionStoreParameters.class.getName() + "."); } _store = new CollectionStore(((X509CollectionStoreParameters)params) .getCollection()); }
public Iterator<T> iterator() { return getMatches(null).iterator(); } }
/** * Create a new store containing the given certificates and return it as a certificate provider. * * @param manager the component manager. * @param certificates the certificates. * @return a certificate provider wrapping the collection of certificate. * @throws GeneralSecurityException if unable to initialize the provider. */ public static CertificateProvider getCertificateProvider(ComponentManager manager, Collection<CertifiedPublicKey> certificates) throws GeneralSecurityException { if (certificates == null || certificates.isEmpty()) { return null; } Collection<X509CertificateHolder> certs = new ArrayList<X509CertificateHolder>(certificates.size()); for (CertifiedPublicKey cert : certificates) { certs.add(BcUtils.getX509CertificateHolder(cert)); } return newCertificateProvider(manager, new CollectionStore(certs)); }
public Iterator<T> iterator() { return getMatches(null).iterator(); } }
/** * This method returns the List of certificates with the same SignerId. * * @param signerId * expected signerId. * @return If no match is found then an empty list is returned. */ @SuppressWarnings("unchecked") public List<CertificateToken> getBySignerId(SignerId signerId) { Collection<CertificatePoolEntity> values = entriesByPublicKeyHash.values(); for (CertificatePoolEntity entity : values) { List<CertificateToken> equivalentCertificates = entity.getEquivalentCertificates(); CertificateToken token = equivalentCertificates.iterator().next(); X509CertificateHolder x509CertificateHolder = DSSASN1Utils.getX509CertificateHolder(token); Store<X509CertificateHolder> store = new CollectionStore<X509CertificateHolder>(Collections.singleton(x509CertificateHolder)); Collection<X509CertificateHolder> matches = store.getMatches(signerId); if (!matches.isEmpty()) { return equivalentCertificates; } } return Collections.emptyList(); }
signedDataCerts = certStore.getMatches(sid);
public void refresh() throws ScepClientException { // getCACaps ScepHttpResponse getCaCapsResp = httpSend(Operation.GetCACaps); this.caCaps = CaCaps.getInstance(new String(getCaCapsResp.getContentBytes())); // getCACert ScepHttpResponse getCaCertResp = httpSend(Operation.GetCACert); this.authorityCertStore = retrieveCaCertStore(getCaCertResp, caCertValidator); X509CertificateHolder certHolder; try { certHolder = new X509CertificateHolder(this.authorityCertStore.getSignatureCert().getEncoded()); } catch (CertificateEncodingException ex) { throw new ScepClientException(ex); } catch (IOException ex) { throw new ScepClientException(ex); } this.responseSignerCerts = new CollectionStore<X509CertificateHolder>( Arrays.asList(certHolder)); }
signedDataCerts = certStore.getMatches(sid);
protected CMSSignedData modifySignedData(CMSSignedData sigData, AttributeTable unsignedAttributes, Collection<X509CertificateHolder> extraCertificates) throws IOException, CMSException { SignerInformation signerInformation = sigData.getSignerInfos().getSigners().iterator().next(); signerInformation = SignerInformation.replaceUnsignedAttributes(signerInformation, unsignedAttributes); Collection<X509CertificateHolder> certificates = new ArrayList<>(); certificates.addAll(sigData.getCertificates().getMatches(null)); if (extraCertificates != null) { certificates.addAll(extraCertificates); } Store<X509CertificateHolder> certificateStore = new CollectionStore<>(certificates); AuthenticodeSignedDataGenerator generator = new AuthenticodeSignedDataGenerator(); generator.addCertificates(certificateStore); generator.addSigners(new SignerInformationStore(signerInformation)); ASN1ObjectIdentifier contentType = new ASN1ObjectIdentifier(sigData.getSignedContentTypeOID()); ASN1Encodable content = ASN1Sequence.getInstance(sigData.getSignedContent().getContent()); return generator.generate(contentType, content); }
certificatesStore = new CollectionStore(newCertificateStore); newCrlsStore.add(x509CRLHolder); crlsStore = new CollectionStore(newCrlsStore); newOtherRevocationInfoFormatStore.add(DSSASN1Utils.toASN1Primitive(DSSUtils.getEncoded(basicOCSPResp))); otherRevocationInfoFormatStoreBasic = new CollectionStore(newOtherRevocationInfoFormatStore);