Examples of ResponseBytes


Examples of org.bouncycastle.asn1.ocsp.ResponseBytes

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

Examples of org.bouncycastle.asn1.ocsp.ResponseBytes

    }

    public Object getResponseObject()
        throws OCSPException
    {
        ResponseBytes   rb = this.resp.getResponseBytes();

        if (rb == null)
        {
            return null;
        }

        if (rb.getResponseType().equals(OCSPObjectIdentifiers.id_pkix_ocsp_basic))
        {
            try
            {
                ASN1Primitive obj = ASN1Primitive.fromByteArray(rb.getResponse().getOctets());
                return new BasicOCSPResp(BasicOCSPResponse.getInstance(obj));
            }
            catch (Exception e)
            {
                throw new OCSPException("problem decoding object: " + e, e);
            }
        }

        return rb.getResponse();
    }
View Full Code Here

Examples of org.bouncycastle.asn1.ocsp.ResponseBytes

    }

    public Object getResponseObject()
        throws OCSPException
    {
        ResponseBytes   rb = this.resp.getResponseBytes();

        if (rb == null)
        {
            return null;
        }

        if (rb.getResponseType().equals(OCSPObjectIdentifiers.id_pkix_ocsp_basic))
        {
            try
            {
                ASN1InputStream aIn = new ASN1InputStream(rb.getResponse().getOctets());
                return new BasicOCSPResp(
                            BasicOCSPResponse.getInstance(aIn.readObject()));
            }
            catch (Exception e)
            {
                throw new OCSPException("problem decoding object: " + e, e);
            }
        }

        return rb.getResponse();
    }
View Full Code Here

Examples of org.bouncycastle.asn1.ocsp.ResponseBytes

    }

    public Object getResponseObject()
        throws OCSPException
    {
        ResponseBytes   rb = this.resp.getResponseBytes();

        if (rb == null)
        {
            return null;
        }

        if (rb.getResponseType().equals(OCSPObjectIdentifiers.id_pkix_ocsp_basic))
        {
            try
            {
                ASN1InputStream aIn = new ASN1InputStream(
                        new ByteArrayInputStream(rb.getResponse().getOctets()));
                return new BasicOCSPResp(
                            BasicOCSPResponse.getInstance(aIn.readObject()));
            }
            catch (Exception e)
            {
                throw new OCSPException("problem decoding object: " + e, e);
            }
        }

        return rb.getResponse();
    }
View Full Code Here

Examples of org.bouncycastle.asn1.ocsp.ResponseBytes

    {
        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");
            }
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.