code: 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));
      }
docs: 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.