Package org.bouncycastle.cert.ocsp

Examples of org.bouncycastle.cert.ocsp.OCSPResp


            signatureConfig.setTspOldProtocol(signatureConfig.getTspUrl().contains("edelweb"));
        }
       
        final RevocationData revocationData = new RevocationData();
        revocationData.addCRL(crl);
        OCSPResp ocspResp = PkiTestUtils.createOcspResp(x509, false,
                x509, x509, keyPair.getPrivate(), "SHA1withRSA", cal.getTimeInMillis());
        revocationData.addOCSP(ocspResp.getEncoded());

        RevocationDataService revocationDataService = new RevocationDataService(){
            @Override
            public RevocationData getRevocationData(List<X509Certificate> certificateChain) {
                return revocationData;
View Full Code Here


                    DigestAlgAndValueType digestAlgAndValue = ocspRef.addNewDigestAlgAndValue();
                    XAdESSignatureFacet.setDigestAlgAndValue(digestAlgAndValue, ocsp, signatureConfig.getDigestAlgo());
   
                    OCSPIdentifierType ocspIdentifier = ocspRef.addNewOCSPIdentifier();
                   
                    OCSPResp ocspResp = new OCSPResp(ocsp);
                   
                    BasicOCSPResp basicOcspResp = (BasicOCSPResp)ocspResp.getResponseObject();
                   
                    Calendar cal = Calendar.getInstance();
                    cal.setTime(basicOcspResp.getProducedAt());
                    ocspIdentifier.setProducedAt(cal);
   
View Full Code Here

      if (url == null) {
        return new ValidationError[] { new ValidationError(OCSPCertificateValidator.VALIDATOR_NAME, "No url found for validation") };
      }

      OCSPReq req = this.buildRequest(x509Certificate, x509Issuer);
      OCSPResp resp = this.sendRequest(req, url);
      if (resp.getStatus() != OCSPResponseStatus.SUCCESSFUL) {
        return new ValidationError[] { new ValidationError(OCSPCertificateValidator.VALIDATOR_NAME, "Certificate not valid") };
      }
      return new ValidationError[0];
    } catch (Exception e) {
      throw new CertificateException(e);
View Full Code Here

    InputStream inputStream = connection.getInputStream();

    String encoding = connection.getContentEncoding();

    byte[] bytes = this.readBytes(inputStream, encoding);
    OCSPResp resp = new OCSPResp(bytes);
    return resp;
  }
View Full Code Here

      if (url == null) {
        return new ValidationError[] { new ValidationError(OCSPCertificateValidator.VALIDATOR_NAME, "No url found for validation") };
      }

      OCSPReq req = this.buildRequest(x509Certificate, x509Issuer);
      OCSPResp resp = this.sendRequest(req, url);
      if (resp.getStatus() != OCSPResponseStatus.SUCCESSFUL) {
        return new ValidationError[] { new ValidationError(OCSPCertificateValidator.VALIDATOR_NAME, "Certificate not valid") };
      }
      return new ValidationError[0];
    } catch (Exception e) {
      throw new CertificateException(e);
View Full Code Here

    InputStream inputStream = connection.getInputStream();

    String encoding = connection.getContentEncoding();

    byte[] bytes = this.readBytes(inputStream, encoding);
    OCSPResp resp = new OCSPResp(bytes);
    return resp;
  }
View Full Code Here

        CoreLog.getInstance().getLog().info("No url found for validation");
        return false;
      }

      OCSPReq req = this.buildRequest(x509Certificate, x509Issuer);
      OCSPResp resp = this.sendRequest(req, url);
      if (resp.getStatus() == OCSPResponseStatus.SUCCESSFUL) {
        return true;
      }
      return false;
    } catch (Exception e) {
      throw new CertificateException(e);
View Full Code Here

    InputStream inputStream = connection.getInputStream();

    String encoding = connection.getContentEncoding();

    byte[] bytes = this.readBytes(inputStream, encoding);
    OCSPResp resp = new OCSPResp(bytes);
    return resp;
  }
View Full Code Here

      if (url == null) {
        return new ValidationError[] { new ValidationError(OCSPCertificateValidator.VALIDATOR_NAME, "No url found for validation") };
      }

      OCSPReq req = this.buildRequest(x509Certificate, x509Issuer);
      OCSPResp resp = this.sendRequest(req, url);
      if (resp.getStatus() != OCSPResponseStatus.SUCCESSFUL) {
        return new ValidationError[] { new ValidationError(OCSPCertificateValidator.VALIDATOR_NAME, "Response invalid") };
      }

      Object responseObject = resp.getResponseObject();

      if (responseObject instanceof BasicOCSPResp) {
        BasicOCSPResp basicOCSPResp = (BasicOCSPResp) responseObject;
        SingleResp[] singleResps = basicOCSPResp.getResponses();
        List<ValidationError> errors = new ArrayList<ValidationError>();
View Full Code Here

    InputStream inputStream = connection.getInputStream();

    String encoding = connection.getContentEncoding();

    byte[] bytes = this.readBytes(inputStream, encoding);
    OCSPResp resp = new OCSPResp(bytes);
    return resp;
  }
View Full Code Here

TOP

Related Classes of org.bouncycastle.cert.ocsp.OCSPResp

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.