Examples of JcaCertStore


Examples of org.bouncycastle.cert.jcajce.JcaCertStore

    }

    private static Store certToStore(X509Certificate certificate) throws CertificateEncodingException {
        ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>();
        certList.add(certificate);
        return new JcaCertStore(certList);
    }
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

    ArrayList certList = new ArrayList();
    certList.add(userCertificate);

    X509CollectionStoreParameters x509CollectionStoreParameters =
       new X509CollectionStoreParameters(certList);
    JcaCertStore jcaCertStore = new JcaCertStore(certList);
    gen.addCertificates(jcaCertStore);

    /**
     * Genera il file p7m e lo salva nel path specificato.
     * Inserendo "false" come secondo parametro di generate() si
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

  CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
  ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA")
    .build(pair.getPrivate());
  X509Certificate cert = X509Certificates.createEphemeral(
    new X500Principal("CN=client"), pair);
  Store certs = new JcaCertStore(Collections.singleton(cert));
  gen.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(
    new JcaDigestCalculatorProviderBuilder().build()).build(
    sha1Signer, cert));
  gen.addCertificates(certs);
  CMSTypedData msg = new CMSAbsentContent();
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

    }

    private CMSSignedData getMessageData(List<X509Certificate> certs)
      throws IOException, CMSException, GeneralSecurityException {
  CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
  JcaCertStore store;
  try {
      store = new JcaCertStore(certs);
  } catch (CertificateEncodingException e) {
      IOException ioe = new IOException();
      ioe.initCause(e);

      throw ioe;
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

  if (certs.size() == 0) {
      res.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED,
        "GetNextCACert Not Supported");
  } else {
      CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
      JcaCertStore store;
      try {
    store = new JcaCertStore(certs);
      } catch (CertificateEncodingException e) {
    IOException ioe = new IOException();
    ioe.initCause(e);

    throw ioe;
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

      res.setHeader("Content-Type", "application/x-x509-ca-cert");
      bytes = certs.get(0).getEncoded();
  } else {
      res.setHeader("Content-Type", "application/x-x509-ca-ra-cert");
      CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
      JcaCertStore store;
      try {
    store = new JcaCertStore(certs);
      } catch (CertificateEncodingException e) {
    IOException ioe = new IOException();
    ioe.initCause(e);

    throw ioe;
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

    return enveloper.encode(bytes);
  }

  private JcaCertStore getCertificates() throws MessageEncodingException {
    Collection<X509Certificate> certColl = Collections.singleton(signerId);
    JcaCertStore certStore;
    try {
      certStore = new JcaCertStore(certColl);
    } catch (CertificateEncodingException e) {
      throw new MessageEncodingException(e);
    }
    return certStore;
  }
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

      DigestCalculator digestCalculator = digestCalculatorProvider.get(signerInfoGenerator.getDigestAlgorithm());

      this.timeStampTokenGenerator = new TimeStampTokenGenerator(digestCalculator, signerInfoGenerator, new ASN1ObjectIdentifier(BouncyCastleTimeStampServer.TSA_POLICY_ID));

      JcaCertStore certStore = new JcaCertStore(Arrays.asList(chain));
      this.timeStampTokenGenerator.addCertificates(certStore);
    } catch (Exception e) {
      throw new TimeStampException(e);
    }
  }
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

    return principal;
  }

  public static Store toStore(final Certificate[] chain) throws CertificateEncodingException {
    List<Certificate> list = Arrays.toList(chain);
    JcaCertStore certStore = new JcaCertStore(list);
    return certStore;
  }
View Full Code Here

Examples of org.bouncycastle.cert.jcajce.JcaCertStore

               CertificateEncodingException,
               OperatorCreationException,
               CMSException {
        ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>(1);
        certList.add(publicKey);
        JcaCertStore certs = new JcaCertStore(certList);

        CMSSignedDataGenerator gen = new CMSSignedDataGenerator();
        ContentSigner signer = new JcaContentSignerBuilder(getSignatureAlgorithm(publicKey))
            .setProvider(sBouncyCastleProvider)
            .build(privateKey);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.