Package org.bouncycastle.operator

Examples of org.bouncycastle.operator.ContentVerifierProvider


   * @param responderCert  the responder certificate
   * @return  true if the OCSP response verifies against the responder certificate
   */
  public boolean isSignatureValid(BasicOCSPResp ocspResp, Certificate responderCert) {
    try {
      ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider("BC").build(responderCert.getPublicKey());
      return ocspResp.isSignatureValid(verifierProvider);
    } catch (OperatorCreationException e) {
      return false;
    } catch (OCSPException e) {
      return false;
View Full Code Here


      return;
    }
    try {
      JcaX509CertificateHolder raHolder = new JcaX509CertificateHolder(ra);

      ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder()
          .build(ca);

      if (!raHolder.isSignatureValid(verifierProvider)) {
        LOGGER.debug("Signature verification failed for RA.");
        throw new ClientException("RA not issued by CA");
View Full Code Here

  }

  private boolean isSelfSigned(X509Certificate cert) throws ClientException {
    try {
      JcaX509CertificateHolder holder = new JcaX509CertificateHolder(cert);
      ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder()
          .build(holder);

      return holder.isSignatureValid(verifierProvider);
    } catch (Exception e) {
      throw new ClientException(e);
View Full Code Here

  if (signerInfo == null) {
      return false;
  }
  CMSSignatureAlgorithmNameGenerator sigNameGenerator = new DefaultCMSSignatureAlgorithmNameGenerator();
  SignatureAlgorithmIdentifierFinder sigAlgorithmFinder = new DefaultSignatureAlgorithmIdentifierFinder();
  ContentVerifierProvider verifierProvider;
  try {
      verifierProvider = new JcaContentVerifierProviderBuilder()
        .build(signer);
  } catch (OperatorCreationException e) {
      throw new RuntimeException(e);
View Full Code Here

   * @param responderCert  the responder certificate
   * @return  true if the OCSP response verifies against the responder certificate
   */
  public boolean isSignatureValid(BasicOCSPResp ocspResp, Certificate responderCert) {
    try {
      ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder().setProvider("BC").build(responderCert.getPublicKey());
      return ocspResp.isSignatureValid(verifierProvider);
    } catch (OperatorCreationException e) {
      return false;
    } catch (OCSPException e) {
      return false;
View Full Code Here

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

          ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);

          JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
          digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
          DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
View Full Code Here

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

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);

            JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
            digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
View Full Code Here

          for (Certificate cert : collection) {

            JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder();
            jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);

            JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
            digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
View Full Code Here

          for (Certificate cert : collection) {

            JcaContentVerifierProviderBuilder jcaContentVerifierProviderBuilder = new JcaContentVerifierProviderBuilder();
            jcaContentVerifierProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);

            JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
            digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
View Full Code Here

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

            ContentVerifierProvider contentVerifierProvider = jcaContentVerifierProviderBuilder.build((X509Certificate) cert);

            JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
            digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
            DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
View Full Code Here

TOP

Related Classes of org.bouncycastle.operator.ContentVerifierProvider

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.