public final class OCSPResponse
extends java.lang.Object
OCSPResponse ::= SEQUENCE {
responseStatus OCSPResponseStatus,
responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
OCSPResponseStatus ::= ENUMERATED {
successful (0), --Response has valid confirmations
malformedRequest (1), --Illegal confirmation request
internalError (2), --Internal error in issuer
tryLater (3), --Try again later
--(4) is not used
sigRequired (5), --Must sign the request
unauthorized (6) --Request unauthorized
}
ResponseBytes ::= SEQUENCE {
responseType OBJECT IDENTIFIER,
response OCTET STRING }
BasicOCSPResponse ::= SEQUENCE {
tbsResponseData ResponseData,
signatureAlgorithm AlgorithmIdentifier,
signature BIT STRING,
certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
The value for signature SHALL be computed on the hash of the DER
encoding ResponseData.
ResponseData ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
responderID ResponderID,
producedAt GeneralizedTime,
responses SEQUENCE OF SingleResponse,
responseExtensions [1] EXPLICIT Extensions OPTIONAL }
ResponderID ::= CHOICE {
byName [1] Name,
byKey [2] KeyHash }
KeyHash ::= OCTET STRING -- SHA-1 hash of responder's public key
(excluding the tag and length fields)
SingleResponse ::= SEQUENCE {
certID CertID,
certStatus CertStatus,
thisUpdate GeneralizedTime,
nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
singleExtensions [1] EXPLICIT Extensions OPTIONAL }
CertStatus ::= CHOICE {
good [0] IMPLICIT NULL,
revoked [1] IMPLICIT RevokedInfo,
unknown [2] IMPLICIT UnknownInfo }
RevokedInfo ::= SEQUENCE {
revocationTime GeneralizedTime,
revocationReason [0] EXPLICIT CRLReason OPTIONAL }
UnknownInfo ::= NULL -- this can be replaced with an enumeration
| Modifier and Type | Class and Description |
|---|---|
static class |
OCSPResponse.ResponseStatus |
static class |
OCSPResponse.SingleResponse |
| Constructor and Description |
|---|
OCSPResponse(byte[] bytes) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<CertId> |
getCertIds()
Return a set of all CertIds in this
OCSPResponse |
ResponderId |
getResponderId()
Get the
ResponderId from this OCSPResponse |
OCSPResponse.ResponseStatus |
getResponseStatus()
Returns the OCSP ResponseStatus.
|
OCSPResponse.SingleResponse |
getSingleResponse(CertId certId)
Returns the SingleResponse of the specified CertId, or null if
there is no response for that CertId.
|
java.lang.String |
toString()
Provide a String representation of an OCSPResponse
|
public OCSPResponse(byte[] bytes)
throws java.io.IOException
java.io.IOExceptionpublic OCSPResponse.ResponseStatus getResponseStatus()
ResponseStatus for this OCSP responsepublic OCSPResponse.SingleResponse getSingleResponse(CertId certId)
certId - the CertId for a SingleResponse to be
searched for in the OCSP response.SingleResponse for the provided CertId,
or null if it is not found.public java.util.Set<CertId> getCertIds()
OCSPResponseCertId in this
response.public ResponderId getResponderId()
ResponderId from this OCSPResponseResponderId from this response or null
if no responder ID is in the body of the response e.g. a
response with a status other than SUCCESS.public java.lang.String toString()
toString in class java.lang.Object