Package org.bouncycastle.cert.ocsp

Examples of org.bouncycastle.cert.ocsp.BasicOCSPResp


      }

      Object responseObject = resp.getResponseObject();

      if (responseObject instanceof BasicOCSPResp) {
        BasicOCSPResp basicOCSPResp = (BasicOCSPResp) responseObject;
        SingleResp[] singleResps = basicOCSPResp.getResponses();
        List<ValidationError> errors = new ArrayList<ValidationError>();
        for (SingleResp singleResp : singleResps) {
          CertificateStatus status = singleResp.getCertStatus();
          if (status != null) {
            RevokeReason revokeReason = null;
View Full Code Here


            };
        }
       
        ContentSigner contentSigner = new JcaContentSignerBuilder("SHA1withRSA")
            .setProvider("BC").build(ocspResponderPrivateKey);
        BasicOCSPResp basicOCSPResp = basicOCSPRespBuilder.build(contentSigner, chain, new Date(nonceTimeinMillis));

       
        OCSPRespBuilder ocspRespBuilder = new OCSPRespBuilder();
        OCSPResp ocspResp = ocspRespBuilder.build(OCSPRespBuilder.SUCCESSFUL, basicOCSPResp);
View Full Code Here

   
                    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);
   
                    ResponderIDType responderId = ocspIdentifier.addNewResponderID();
   
                    RespID respId = basicOcspResp.getResponderId();
                    ResponderID ocspResponderId = respId.toASN1Object();
                    DERTaggedObject derTaggedObject = (DERTaggedObject)ocspResponderId.toASN1Primitive();
                    if (2 == derTaggedObject.getTagNo()) {
                        ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject();
                        byte key[] = keyHashOctetString.getOctets();
View Full Code Here

      }

      Object responseObject = resp.getResponseObject();

      if (responseObject instanceof BasicOCSPResp) {
        BasicOCSPResp basicOCSPResp = (BasicOCSPResp) responseObject;
        SingleResp[] singleResps = basicOCSPResp.getResponses();
        List<ValidationError> errors = new ArrayList<ValidationError>();
        for (SingleResp singleResp : singleResps) {
          CertificateStatus status = singleResp.getCertStatus();
          if (status != null) {
            RevokeReason revokeReason = null;
View Full Code Here

      contentSignerBuilder.setProvider(BouncyCastleProviderHelper.PROVIDER_NAME);
      ContentSigner contentSigner = contentSignerBuilder.build(bcRequest.getIssuerPrivateKey());

      X509CertificateHolder[] chain = new X509CertificateHolder[] { new X509CertificateHolder(bcRequest.getIssuerCertificate().getEncoded()) };

      BasicOCSPResp basicResp = builder.build(contentSigner, chain, new Date());
      OCSPResp ocspResp = new OCSPRespBuilder().build(OCSPRespBuilder.SUCCESSFUL, basicResp);

      OCSPResponse response = new OCSPResponse(ocspResp.getEncoded());
      return response;
    } catch (Exception e) {
View Full Code Here

TOP

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

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.