org.bouncycastle.ocsp

Class BasicOCSPResp

Implemented Interfaces:
java.security.cert.X509Extension

public class BasicOCSPResp
extends java.lang.Object
implements java.security.cert.X509Extension

 BasicOCSPResponse       ::= SEQUENCE {
    tbsResponseData      ResponseData,
    signatureAlgorithm   AlgorithmIdentifier,
    signature            BIT STRING,
    certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
 

Constructor Summary

BasicOCSPResp(BasicOCSPResponse resp)

Method Summary

CertStore
getCertificates(String type, String provider)
Return the certificates, if any associated with the response.
X509Certificate[]
getCerts(String provider)
Set
getCriticalExtensionOIDs()
byte[]
getEncoded()
return the ASN.1 encoded representation of this object.
byte[]
getExtensionValue(String oid)
Set
getNonCriticalExtensionOIDs()
Date
getProducedAt()
RespID
getResponderId()
RespData
getResponseData()
Deprecated. RespData class is no longer required as all functionality is available on this class.
X509Extensions
getResponseExtensions()
SingleResp[]
getResponses()
byte[]
getSignature()
String
getSignatureAlgOID()
byte[]
getTBSResponseData()
Return the DER encoding of the tbsResponseData field.
int
getVersion()
boolean
hasUnsupportedCriticalExtension()
RFC 2650 doesn't specify any critical extensions so we return true if any are encountered.
boolean
verify(PublicKey key, String sigProvider)
verify the signature against the tbsResponseData object we contain.

Constructor Details

BasicOCSPResp

public BasicOCSPResp(BasicOCSPResponse resp)

Method Details

getCertificates

public CertStore getCertificates(String type,
                                 String provider)
            throws NoSuchAlgorithmException,
                   NoSuchProviderException,
                   OCSPException
Return the certificates, if any associated with the response.

Parameters:
type - type of CertStore to create
provider - provider to use

Returns:
a CertStore, possibly empty

Throws:
OCSPException -


getCerts

public X509Certificate[] getCerts(String provider)
            throws OCSPException,
                   NoSuchProviderException


getCriticalExtensionOIDs

public Set getCriticalExtensionOIDs()


getEncoded

public byte[] getEncoded()
            throws IOException
return the ASN.1 encoded representation of this object.


getExtensionValue

public byte[] getExtensionValue(String oid)


getNonCriticalExtensionOIDs

public Set getNonCriticalExtensionOIDs()


getProducedAt

public Date getProducedAt()


getResponderId

public RespID getResponderId()


getResponseData

public RespData getResponseData()

Deprecated. RespData class is no longer required as all functionality is available on this class.

Returns:
the RespData object


getResponseExtensions

public X509Extensions getResponseExtensions()


getResponses

public SingleResp[] getResponses()


getSignature

public byte[] getSignature()


getSignatureAlgOID

public String getSignatureAlgOID()


getTBSResponseData

public byte[] getTBSResponseData()
            throws OCSPException
Return the DER encoding of the tbsResponseData field.

Returns:
DER encoding of tbsResponseData

Throws:
OCSPException - in the event of an encoding error.


getVersion

public int getVersion()


hasUnsupportedCriticalExtension

public boolean hasUnsupportedCriticalExtension()
RFC 2650 doesn't specify any critical extensions so we return true if any are encountered.

Returns:
true if any critical extensions are present.


verify

public boolean verify(PublicKey key,
                      String sigProvider)
            throws OCSPException,
                   NoSuchProviderException
verify the signature against the tbsResponseData object we contain.