Package org.bouncycastle.cms

Examples of org.bouncycastle.cms.SignerInformation.verify()


            Collection          certCollection = certs.getCertificates(signer.getSID());

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

            assertEquals(true, signer.verify(cert, "BC"));
        }
       
        checkSignerStoreReplacement(s, signers);
    }
   
View Full Code Here


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

            assertNull(cSigner.getSignedAttributes().get(PKCSObjectIdentifiers.pkcs_9_at_contentType));
            assertEquals(true, cSigner.verify(cert, "BC"));
        }
    }

    private void encapsulatedTest(
        KeyPair         signaturePair,
View Full Code Here

            Collection          certCollection = certsAndCrls.getCertificates(signer.getSID());
   
            Iterator        certIt = certCollection.iterator();
            X509Certificate cert = (X509Certificate)certIt.next();
   
            assertEquals(true, signer.verify(cert, "BC"));
        }

        //
        // check for CRLs
        //
View Full Code Here

            Collection          certCollection = certs.getCertificates(signer.getSID());

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

            assertEquals(true, signer.verify(cert, "BC"));
        }
    }
}
View Full Code Here

            Collection          certCollection = certStore.getCertificates(signer.getSID());
   
            Iterator        certIt = certCollection.iterator();
            X509Certificate cert = (X509Certificate)certIt.next();
   
            assertEquals(true, signer.verify(cert, "BC"));
           
            if (contentDigest != null)
            {
                assertTrue(MessageDigest.isEqual(contentDigest, signer.getContentDigest()));
            }
View Full Code Here

            Collection          certCollection = certsAndCrls.getCertificates(signer.getSID());

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

            assertEquals(true, signer.verify(cert, null));
        }
    }

    public void testSHA1WithRSAStream()
        throws Exception
View Full Code Here

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

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

            assertEquals(true, signer.verify(cert, null));

            if (contentDigest != null)
            {
                assertTrue(MessageDigest.isEqual(contentDigest, signer.getContentDigest()));
            }
View Full Code Here

        SignerInformation signer = (SignerInformation) i.next();
        try {

          ourLog.debug("Signer: {}", signer.getSID());

          if (signer.verify(vib)) {
            verified = true;
          }
        } catch (CMSSignerDigestMismatchException e) {
          throw new SignatureVerificationException(e);
        }
View Full Code Here

            digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();

            SignerInformationVerifier signerInformationVerifier = new SignerInformationVerifier(contentVerifierProvider, digestCalculatorProvider);

            if (!signerInformation.verify(signerInformationVerifier)) {
              verified = false;
            }
          }
        }
      }
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.