Class: OpenSSL::OCSP::SingleResponse
Relationships & Source Files | |
Inherits: | Object |
Defined in: | ext/openssl/ossl_ocsp.c |
Overview
An SingleResponse
represents an ::OpenSSL::OCSP SingleResponse structure, which contains the basic information of the status of the certificate.
Class Method Summary
-
.new(der_string) ⇒ SingleResponse
constructor
Creates a new
SingleResponse
fromder_string
.
Instance Method Summary
-
#cert_status ⇒ Integer
Returns the status of the certificate identified by the certid.
-
#certid ⇒ CertificateId
Returns the CertificateId for which this
SingleResponse
is. -
#check_validity(nsec = 0, maxsec = -1) ⇒ Boolean
Checks the validity of thisUpdate and nextUpdate fields of this
SingleResponse
. - #extensions ⇒ Array of X509::Extension
- #next_update ⇒ Time | nil
- #revocation_reason ⇒ Integer | nil
- #revocation_time ⇒ Time | nil
- #this_update ⇒ Time
-
#to_der ⇒ String
Encodes this
SingleResponse
into a DER-encoded string.
Constructor Details
.new(der_string) ⇒ SingleResponse
Creates a new SingleResponse
from der_string
.
Instance Method Details
#cert_status ⇒ Integer
Returns the status of the certificate identified by the certid. The return value may be one of these constant:
When the status is V_CERTSTATUS_REVOKED, the time at which the certificate was revoked can be retrieved by #revocation_time.
#certid ⇒ CertificateId
Returns the CertificateId for which this SingleResponse
is.
#check_validity(nsec = 0, maxsec = -1) ⇒ Boolean
Checks the validity of thisUpdate and nextUpdate fields of this SingleResponse
. This checks the current time is within the range thisUpdate to nextUpdate.
It is possible that the ::OpenSSL::OCSP request takes a few seconds or the time is not accurate. To avoid rejecting a valid response, this method allows the times to be within nsec
of the current time.
Some responders don't set the nextUpdate field. This may cause a very old response to be considered valid. The maxsec
parameter can be used to limit the age of responses.
#extensions ⇒ Array
of
X509::Extension
#next_update ⇒ Time
| nil
#revocation_reason ⇒ Integer | nil
#revocation_time ⇒ Time
| nil
#this_update ⇒ Time
#to_der ⇒ String
Encodes this SingleResponse
into a DER-encoded string.