Package org.bouncycastle.cms.jcajce

Examples of org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder


            byte[] signatureBytes = new byte[signature.readableBytes()];
            signature.getBytes(signature.readerIndex(), signatureBytes);

            CMSSignedData signedData = new CMSSignedData(message, signatureBytes);

            SignerInformationVerifier verifier = new JcaSimpleSignerInfoVerifierBuilder().build(publicKey);

            Iterator<SignerInformation> signerIter = signedData.getSignerInfos().getSigners().iterator();

            while (signerIter.hasNext()) {
                SignerInformation each = signerIter.next();
View Full Code Here


              try {
                  String alias = aliases.nextElement();
                  if (!keystore.isCertificateEntry(alias))
                      continue;
                  X509Certificate certStoreX509 = (X509Certificate)keystore.getCertificate(alias);
                  ts.isSignatureValid(new JcaSimpleSignerInfoVerifierBuilder().setProvider(provider).build(certStoreX509));
                  return true;
              }
              catch (Exception ex) {
              }
          }
View Full Code Here

      Collection certCollection = certStore.getMatches(signer.getSID());

      Iterator certIt = certCollection.iterator();
      X509CertificateHolder cert = (X509CertificateHolder) certIt.next();

      if(signer.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BC").build(cert)))
      {
        verified = true;
      }

      // salva il certificato se non ha già fatto
View Full Code Here

      LOGGER.debug(
        "Verifying pkiMessage using key belonging to [issuer={}; serial={}]",
        cert.getIssuer(), cert.getSerialNumber());
      SignerInformationVerifier verifier;
      try {
    verifier = new JcaSimpleSignerInfoVerifierBuilder().build(cert);
    signerInfo.verify(verifier);

    LOGGER.debug("pkiMessage verified.");
      } catch (Exception e) {
    throw new MessageDecodingException(e);
View Full Code Here

              try {
                  String alias = aliases.nextElement();
                  if (!keystore.isCertificateEntry(alias))
                      continue;
                  X509Certificate certStoreX509 = (X509Certificate)keystore.getCertificate(alias);
                  ts.isSignatureValid(new JcaSimpleSignerInfoVerifierBuilder().setProvider(provider).build(certStoreX509));
                  return true;
              }
              catch (Exception ex) {
              }
          }
View Full Code Here

      if (cert != null) {
        SignerInformationVerifier signerInformationVerifier = null;

        if (detached) {
          JcaSimpleSignerInfoVerifierBuilder builder = new JcaSimpleSignerInfoVerifierBuilder();
          builder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
          signerInformationVerifier = builder.build((X509Certificate) cert);
        } else {
          JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder();
          jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);

          ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);
View Full Code Here

        if (cert != null) {
          SignerInformationVerifier signerInformationVerifier = null;

          if (detached) {
            JcaSimpleSignerInfoVerifierBuilder builder = new JcaSimpleSignerInfoVerifierBuilder();
            builder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            signerInformationVerifier = builder.build((X509Certificate) cert);
          } else {
            JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder();
            jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);
View Full Code Here

      CMSProcessable content = new CMSProcessableByteArray(theBytes);
      CMSSignedData s = new CMSSignedData(content, Base64.decodeBase64(theSignature));

      ourLog.debug("Verifying message against public key with alias[{}]", myKeyAlias);

      SignerInformationVerifier vib = new JcaSimpleSignerInfoVerifierBuilder().build(pubKey);

      SignerInformationStore signers = s.getSignerInfos();
      boolean verified = false;

      for (Iterator<?> i = signers.getSigners().iterator(); i.hasNext();) {
View Full Code Here

        if (cert != null) {
          SignerInformationVerifier signerInformationVerifier = null;

          if (detached) {
            JcaSimpleSignerInfoVerifierBuilder builder = new JcaSimpleSignerInfoVerifierBuilder();
            builder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            signerInformationVerifier = builder.build((X509Certificate) cert);
          } else {
            JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder();
            jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);
View Full Code Here

        if (cert != null) {
          SignerInformationVerifier signerInformationVerifier = null;

          if (detached) {
            JcaSimpleSignerInfoVerifierBuilder builder = new JcaSimpleSignerInfoVerifierBuilder();
            builder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            signerInformationVerifier = builder.build((X509Certificate) cert);
          } else {
            JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder();
            jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);
View Full Code Here

TOP

Related Classes of org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder

Copyright © 2018 www.massapicom. 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.