org.bouncycastle.ocsp

Class BasicOCSPRespGenerator


public class BasicOCSPRespGenerator
extends java.lang.Object

Generator for basic OCSP response objects.

Constructor Summary

BasicOCSPRespGenerator(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, Date thisUpdate, Date nextUpdate, X509Extensions singleExtensions)
Add a response for a particular Certificate ID.
void
addResponse(CertificateID certID, CertificateStatus certStatus, 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(String signingAlgorithm, PrivateKey key, X509Certificate[] chain, Date thisUpdate, String provider)
BasicOCSPResp
generate(String signingAlgorithm, PrivateKey key, X509Certificate[] chain, Date producedAt, String provider, SecureRandom random)
Iterator
getSignatureAlgNames()
Return an iterator of the signature names supported by the generator.
void
setResponseExtensions(X509Extensions responseExtensions)
Set the extensions for the response.

Constructor Details

BasicOCSPRespGenerator

public BasicOCSPRespGenerator(PublicKey key)
            throws OCSPException
construct with the responderID to be the SHA-1 keyHash of the passed in public key.


BasicOCSPRespGenerator

public BasicOCSPRespGenerator(RespID responderID)
basic constructor

Method Details

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,
                        Date thisUpdate,
                        Date nextUpdate,
                        X509Extensions singleExtensions)
Add a response for a particular Certificate ID.

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


addResponse

public void addResponse(CertificateID certID,
                        CertificateStatus certStatus,
                        Date nextUpdate,
                        X509Extensions singleExtensions)
Add a response for a particular Certificate ID.

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


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


generate

public BasicOCSPResp generate(String signingAlgorithm,
                              PrivateKey key,
                              X509Certificate[] chain,
                              Date thisUpdate,
                              String provider)
            throws OCSPException,
                   NoSuchProviderException,
                   IllegalArgumentException


generate

public BasicOCSPResp generate(String signingAlgorithm,
                              PrivateKey key,
                              X509Certificate[] chain,
                              Date producedAt,
                              String provider,
                              SecureRandom random)
            throws OCSPException,
                   NoSuchProviderException,
                   IllegalArgumentException


getSignatureAlgNames

public Iterator getSignatureAlgNames()
Return an iterator of the signature names supported by the generator.

Returns:
an iterator containing recognised names.


setResponseExtensions

public void setResponseExtensions(X509Extensions responseExtensions)
Set the extensions for the response.

Parameters:
responseExtensions - the extension object to carry.