Package org.bouncycastle.operator

Examples of org.bouncycastle.operator.DigestCalculator


            return false;
        try {
            X509Certificate[] cs = (X509Certificate[])getSignCertificateChain();
            SingleResp sr = basicResp.getResponses()[0];
            CertificateID cid = sr.getCertID();
            DigestCalculator digestalg = new JcaDigestCalculatorProviderBuilder().build().get(new AlgorithmIdentifier(cid.getHashAlgOID(), DERNull.INSTANCE));
            X509Certificate sigcer = getSigningCertificate();
            X509Certificate isscer = cs[1];
            CertificateID tis = new CertificateID(
                digestalg, new JcaX509CertificateHolder(isscer), sigcer.getSerialNumber());
            return tis.equals(cid);
View Full Code Here


      JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(digestCalculatorProvider);

      SignerInfoGenerator signerInfoGenerator = signerInfoGeneratorBuilder.build(contentSigner, (X509Certificate) certificate);

      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);
View Full Code Here

        RSAKeyParameters rsaSpec = new RSAKeyParameters(false, rsaPubKey.getModulus(), rsaPubKey.getPublicExponent());

        SubjectPublicKeyInfo subjectPublicKeyInfo =
            SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(rsaSpec);

        DigestCalculator digestCalc = new JcaDigestCalculatorProviderBuilder()
            .setProvider("BC").build().get(CertificateID.HASH_SHA1);
       
        X509v3CertificateBuilder certificateGenerator = new X509v3CertificateBuilder(
              issuerName
            , new BigInteger(128, new SecureRandom())
View Full Code Here

            boolean revoked, X509Certificate issuerCertificate,
            X509Certificate ocspResponderCertificate,
            PrivateKey ocspResponderPrivateKey, String signatureAlgorithm,
            long nonceTimeinMillis)
            throws Exception {
        DigestCalculator digestCalc = new JcaDigestCalculatorProviderBuilder()
            .setProvider("BC").build().get(CertificateID.HASH_SHA1);
        X509CertificateHolder issuerHolder = new X509CertificateHolder(issuerCertificate.getEncoded());
        CertificateID certId = new CertificateID(digestCalc, issuerHolder, certificate.getSerialNumber());
       
        // request
View Full Code Here

      JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(digestCalculatorProvider);

      SignerInfoGenerator signerInfoGenerator = signerInfoGeneratorBuilder.build(contentSigner, (X509Certificate) certificate);

      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);
View Full Code Here

      JcaSignerInfoGeneratorBuilder signerInfoGeneratorBuilder = new JcaSignerInfoGeneratorBuilder(digestCalculatorProvider);

      SignerInfoGenerator signerInfoGenerator = signerInfoGeneratorBuilder.build(contentSigner, (X509Certificate) certificate);

      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);
View Full Code Here

      SubjectPublicKeyInfo keyInfo = SubjectPublicKeyInfo.getInstance(bcRequest.getIssuerCertificate().getPublicKey().getEncoded());

      JcaDigestCalculatorProviderBuilder digestCalculatorProviderBuilder = new JcaDigestCalculatorProviderBuilder();
      digestCalculatorProviderBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
      DigestCalculatorProvider digestCalculatorProvider = digestCalculatorProviderBuilder.build();
      DigestCalculator digestCalculator = digestCalculatorProvider.get(CertificateID.HASH_SHA1);

      BasicOCSPRespBuilder builder = new BasicOCSPRespBuilder(keyInfo, digestCalculator);

      Extension ocspNonce = ocspReq.getExtension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce);
      if (ocspNonce != null) {
View Full Code Here

TOP

Related Classes of org.bouncycastle.operator.DigestCalculator

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.