Examples of OCSPResponse


Examples of br.net.woodstock.rockframework.security.cert.OCSPResponse

      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) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

Examples of org.bouncycastle.asn1.ocsp.OCSPResponse

        Object  response)
        throws OCSPException
    {
      if (response == null)
      {
              return new OCSPResp(new OCSPResponse(new OCSPResponseStatus(status),null));
      }
        if (response instanceof BasicOCSPResp)
        {
            BasicOCSPResp   r = (BasicOCSPResp)response;
            ASN1OctetString octs;
           
            try
            {
                octs = new DEROctetString(r.getEncoded());
            }
            catch (IOException e)
            {
                throw new OCSPException("can't encode object.", e);
            }

            ResponseBytes   rb = new ResponseBytes(
                    OCSPObjectIdentifiers.id_pkix_ocsp_basic, octs);

            return new OCSPResp(new OCSPResponse(
                                    new OCSPResponseStatus(status), rb));
        }

        throw new OCSPException("unknown response object");
    }
View Full Code Here

Examples of org.bouncycastle.asn1.ocsp.OCSPResponse

    private TestResult response()
    {
        try
        {
            ASN1InputStream aIn = new ASN1InputStream(new ByteArrayInputStream(response));
            OCSPResponse    resp = OCSPResponse.getInstance(aIn.readObject());
            ResponseBytes   rBytes = ResponseBytes.getInstance(resp.getResponseBytes());
           
            aIn = new ASN1InputStream(new ByteArrayInputStream(rBytes.getResponse().getOctets()));
           
            BasicOCSPResponse   bResp = BasicOCSPResponse.getInstance(aIn.readObject());
           
            resp = new OCSPResponse(resp.getResponseStatus(), new ResponseBytes(rBytes.getResponseType(), new DEROctetString(bResp.getEncoded())));
           
            if (!isSameAs(resp.getEncoded(), response))
            {
                return new SimpleTestResult(false, getName() + ": OCSP response failed to re-encode");
            }
           
            return new SimpleTestResult(true, getName() + ": Okay");
View Full Code Here

Examples of sun.security.provider.certpath.OCSPResponse

                ("Exception while encoding OCSPRequest", ce);
        } catch (IOException ioe) {
            throw new CertPathValidatorException
                ("Exception while encoding OCSPRequest", ioe);
        }
        OCSPResponse ocspResponse = check(Collections.singletonList(certId),
            responderURI, responderCert, date);
        return (RevocationStatus) ocspResponse.getSingleResponse(certId);
    }
View Full Code Here

Examples of sun.security.provider.certpath.OCSPResponse

                    throw ioe;
                }
            }
        }

        OCSPResponse ocspResponse = null;
        try {
            ocspResponse = new OCSPResponse(response, date, responderCert);
        } catch (IOException ioe) {
            // response decoding exception
            throw new CertPathValidatorException(ioe);
        }
        if (ocspResponse.getResponseStatus() != ResponseStatus.SUCCESSFUL) {
            throw new CertPathValidatorException
                ("OCSP response error: " + ocspResponse.getResponseStatus());
        }

        // Check that the response includes a response for all of the
        // certs that were supplied in the request
        for (CertId certId : certIds) {
            SingleResponse sr = ocspResponse.getSingleResponse(certId);
            if (sr == null) {
                if (debug != null) {
                    debug.println("No response found for CertId: " + certId);
                }
                throw new CertPathValidatorException(
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.