Bouncy Castle Cryptography Library 1.45

## org.bouncycastle.ocsp
Class BasicOCSPRespGenerator

    java.lang.Object
      org.bouncycastle.ocsp.BasicOCSPRespGenerator

    public class BasicOCSPRespGenerator

extends java.lang.Object

Generator for basic OCSP response objects.

Constructor Summary
`BasicOCSPRespGenerator(java.security.PublicKey key)` construct with the responderID to be the SHA-1 keyHash of the passed in public key.
`BasicOCSPRespGenerator(RespID responderID)` basic constructor

Method Summary
`void` `addResponse(CertificateID certID, CertificateStatus certStatus)` Add a response for a particular Certificate ID.
`void` `addResponse(CertificateID certID, CertificateStatus certStatus, java.util.Date thisUpdate, java.util.Date nextUpdate, X509Extensions singleExtensions)` Add a response for a particular Certificate ID.
`void` `addResponse(CertificateID certID, CertificateStatus certStatus, java.util.Date nextUpdate, X509Extensions singleExtensions)` Add a response for a particular Certificate ID.
`void` `addResponse(CertificateID certID, CertificateStatus certStatus, X509Extensions singleExtensions)` Add a response for a particular Certificate ID.
`BasicOCSPResp` `generate(java.lang.String signingAlgorithm, java.security.PrivateKey key, java.security.cert.X509Certificate[] chain, java.util.Date thisUpdate, java.lang.String provider)`
`BasicOCSPResp` `generate(java.lang.String signingAlgorithm, java.security.PrivateKey key, java.security.cert.X509Certificate[] chain, java.util.Date producedAt, java.lang.String provider, java.security.SecureRandom random)`
`java.util.Iterator` `getSignatureAlgNames()` Return an iterator of the signature names supported by the generator.
`void` `setResponseExtensions(X509Extensions responseExtensions)` Set the extensions for the response.

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

Constructor Detail

### BasicOCSPRespGenerator

    public BasicOCSPRespGenerator(RespID responderID)

  basic constructor

### BasicOCSPRespGenerator

    public BasicOCSPRespGenerator(java.security.PublicKey key)
                           throws OCSPException

  construct with the responderID to be the SHA-1 keyHash of the passed in public key.

  Throws:
    `OCSPException`

Method Detail

### addResponse

    public void addResponse(CertificateID certID,
                            CertificateStatus certStatus)

  Add a response for a particular Certificate ID.

  Parameters:
    `certID` - certificate ID details
    `certStatus` - status of the certificate - null if okay

### addResponse

    public void addResponse(CertificateID certID,
                            CertificateStatus certStatus,
                            X509Extensions singleExtensions)

  Add a response for a particular Certificate ID.

  Parameters:
    `certID` - certificate ID details
    `certStatus` - status of the certificate - null if okay
    `singleExtensions` - optional extensions

### addResponse

    public void addResponse(CertificateID certID,
                            CertificateStatus certStatus,
                            java.util.Date nextUpdate,
                            X509Extensions singleExtensions)

  Add a response for a particular Certificate ID.

  Parameters:
    `certID` - certificate ID details
    `nextUpdate` - date when next update should be requested
    `certStatus` - status of the certificate - null if okay
    `singleExtensions` - optional extensions

### addResponse

    public void addResponse(CertificateID certID,
                            CertificateStatus certStatus,
                            java.util.Date thisUpdate,
                            java.util.Date nextUpdate,
                            X509Extensions singleExtensions)

  Add a response for a particular Certificate ID.

  Parameters:
    `certID` - certificate ID details
    `thisUpdate` - date this response was valid on
    `nextUpdate` - date when next update should be requested
    `certStatus` - status of the certificate - null if okay
    `singleExtensions` - optional extensions

### setResponseExtensions

    public void setResponseExtensions(X509Extensions responseExtensions)

  Set the extensions for the response.

  Parameters:
    `responseExtensions` - the extension object to carry.

### generate

    public BasicOCSPResp generate(java.lang.String signingAlgorithm,
                                  java.security.PrivateKey key,
                                  java.security.cert.X509Certificate[] chain,
                                  java.util.Date thisUpdate,
                                  java.lang.String provider)
                           throws OCSPException,
                                  java.security.NoSuchProviderException,
                                  java.lang.IllegalArgumentException

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

### generate

    public BasicOCSPResp generate(java.lang.String signingAlgorithm,
                                  java.security.PrivateKey key,
                                  java.security.cert.X509Certificate[] chain,
                                  java.util.Date producedAt,
                                  java.lang.String provider,
                                  java.security.SecureRandom random)
                           throws OCSPException,
                                  java.security.NoSuchProviderException,
                                  java.lang.IllegalArgumentException

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

### getSignatureAlgNames

    public java.util.Iterator getSignatureAlgNames()

  Return an iterator of the signature names supported by the generator.

  Returns:
    an iterator containing recognised names.

Bouncy Castle Cryptography Library 1.45