Bouncy Castle Cryptography Library 1.45

## org.bouncycastle.ocsp
Class BasicOCSPResp

    java.lang.Object
      org.bouncycastle.ocsp.BasicOCSPResp

All 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
`boolean` `equals(java.lang.Object o)`
`java.security.cert.CertStore` `getCertificates(java.lang.String type, java.lang.String provider)` Return the certificates, if any associated with the response.
`java.security.cert.X509Certificate[]` `getCerts(java.lang.String provider)`
`java.util.Set` `getCriticalExtensionOIDs()`
`byte[]` `getEncoded()` return the ASN.1 encoded representation of this object.
`byte[]` `getExtensionValue(java.lang.String oid)`
`java.util.Set` `getNonCriticalExtensionOIDs()`
`java.util.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()`
`java.lang.String` `getSignatureAlgName()`
`java.lang.String` `getSignatureAlgOID()`
`byte[]` `getTBSResponseData()` Return the DER encoding of the tbsResponseData field.
`int` `getVersion()`
`int` `hashCode()`
`boolean` `hasUnsupportedCriticalExtension()` RFC 2650 doesn't specify any critical extensions so we return true if any are encountered.
`boolean` `verify(java.security.PublicKey key, java.lang.String sigProvider)` verify the signature against the tbsResponseData object we contain.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BasicOCSPResp

    public BasicOCSPResp(BasicOCSPResponse resp)

Method Detail

### 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()

### getResponderId

    public RespID getResponderId()

### getProducedAt

    public java.util.Date getProducedAt()

### getResponses

    public SingleResp[] getResponses()

### getResponseExtensions

    public X509Extensions getResponseExtensions()

### hasUnsupportedCriticalExtension

    public boolean hasUnsupportedCriticalExtension()

  RFC 2650 doesn't specify any critical extensions so we return true if any are encountered.

  Specified by:
    `hasUnsupportedCriticalExtension` in interface `java.security.cert.X509Extension`
  Returns:
    true if any critical extensions are present.

### getCriticalExtensionOIDs

    public java.util.Set getCriticalExtensionOIDs()

  Specified by:
    `getCriticalExtensionOIDs` in interface `java.security.cert.X509Extension`

### getNonCriticalExtensionOIDs

    public java.util.Set getNonCriticalExtensionOIDs()

  Specified by:
    `getNonCriticalExtensionOIDs` in interface `java.security.cert.X509Extension`

### getExtensionValue

    public byte[] getExtensionValue(java.lang.String oid)

  Specified by:
    `getExtensionValue` in interface `java.security.cert.X509Extension`

### getSignatureAlgName

    public java.lang.String getSignatureAlgName()

### getSignatureAlgOID

    public java.lang.String getSignatureAlgOID()

### getResponseData

    public RespData getResponseData()

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

  Returns:
    the RespData object

### getSignature

    public byte[] getSignature()

### getCerts

    public java.security.cert.X509Certificate[] getCerts(java.lang.String provider)
                                                  throws OCSPException,
                                                         java.security.NoSuchProviderException

  Throws:
    `OCSPException`
    `java.security.NoSuchProviderException`

### getCertificates

    public java.security.cert.CertStore getCertificates(java.lang.String type,
                                                        java.lang.String provider)
                                                 throws java.security.NoSuchAlgorithmException,
                                                        java.security.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:
    `java.security.NoSuchAlgorithmException`
    `java.security.NoSuchProviderException`
    `OCSPException`

### verify

    public boolean verify(java.security.PublicKey key,
                          java.lang.String sigProvider)
                   throws OCSPException,
                          java.security.NoSuchProviderException

  verify the signature against the tbsResponseData object we contain.

  Throws:
    `OCSPException`
    `java.security.NoSuchProviderException`

### getEncoded

    public byte[] getEncoded()
                      throws java.io.IOException

  return the ASN.1 encoded representation of this object.

  Throws:
    `java.io.IOException`

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

Bouncy Castle Cryptography Library 1.45