org.bouncycastle.ocsp

## Class OCSPReqGenerator

- java.lang.Object
- - org.bouncycastle.ocsp.OCSPReqGenerator

    public class OCSPReqGenerator
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`OCSPReqGenerator()`

### Method Summary

Methods
`void` `addRequest(CertificateID certId)` Add a request for the given CertificateID.
`void` `addRequest(CertificateID certId, X509Extensions singleRequestExtensions)` Add a request with extensions
`OCSPReq` `generate()` Generate an unsigned request
`OCSPReq` `generate(java.lang.String signingAlgorithm, java.security.PrivateKey key, java.security.cert.X509Certificate[] chain, java.lang.String provider)`
`OCSPReq` `generate(java.lang.String signingAlgorithm, java.security.PrivateKey key, java.security.cert.X509Certificate[] chain, java.lang.String provider, java.security.SecureRandom random)`
`java.util.Iterator` `getSignatureAlgNames()` Return an iterator of the signature names supported by the generator.
`void` `setRequestExtensions(X509Extensions requestExtensions)`
`void` `setRequestorName(GeneralName requestorName)`
`void` `setRequestorName(javax.security.auth.x500.X500Principal requestorName)` Set the requestor name to the passed in X500Principal

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### OCSPReqGenerator

    public OCSPReqGenerator()

### Method Detail

#### addRequest

    public void addRequest(CertificateID certId)

Add a request for the given CertificateID.

Parameters:
  `certId` - certificate ID of interest

#### addRequest

    public void addRequest(CertificateID certId,
                  X509Extensions singleRequestExtensions)

Add a request with extensions

Parameters:
  `certId` - certificate ID of interest
  `singleRequestExtensions` - the extensions to attach to the request

#### setRequestorName

    public void setRequestorName(javax.security.auth.x500.X500Principal requestorName)

Set the requestor name to the passed in X500Principal

Parameters:
  `requestorName` - a X500Principal representing the requestor name.

#### setRequestorName

    public void setRequestorName(GeneralName requestorName)

#### setRequestExtensions

    public void setRequestExtensions(X509Extensions requestExtensions)

#### generate

    public OCSPReq generate()
                     throws OCSPException

Generate an unsigned request

Returns:
  the OCSPReq
Throws:
  `OCSPException`

#### generate

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

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

#### generate

    public OCSPReq generate(java.lang.String signingAlgorithm,
                   java.security.PrivateKey key,
                   java.security.cert.X509Certificate[] chain,
                   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.