pub struct SingleResponse {
pub cert_id: CertId,
pub cert_status: CertStatus,
pub this_update: OcspGeneralizedTime,
pub next_update: Option<OcspGeneralizedTime>,
pub single_extensions: Option<Extensions>,
}
Expand description
SingleResponse structure as defined in RFC 6960 Section 4.2.1.
SingleResponse ::= SEQUENCE {
certID CertID,
certStatus CertStatus,
thisUpdate GeneralizedTime,
nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
singleExtensions [1] EXPLICIT Extensions OPTIONAL }
Fields§
§cert_id: CertId
§cert_status: CertStatus
§this_update: OcspGeneralizedTime
§next_update: Option<OcspGeneralizedTime>
§single_extensions: Option<Extensions>
Implementations§
Source§impl SingleResponse
impl SingleResponse
Sourcepub fn new(
cert_id: CertId,
cert_status: CertStatus,
this_update: OcspGeneralizedTime,
) -> Self
Available on crate feature builder
only.
pub fn new( cert_id: CertId, cert_status: CertStatus, this_update: OcspGeneralizedTime, ) -> Self
builder
only.Returns a SingleResponse
given the CertID
, CertStatus
, and This Update
. Next Update
is set to None
.
Sourcepub fn with_this_update(self, this_update: OcspGeneralizedTime) -> Self
Available on crate feature builder
only.
pub fn with_this_update(self, this_update: OcspGeneralizedTime) -> Self
builder
only.Sets thisUpdate
in the singleResponse
as defined in RFC 6960 Section 4.2.1.
Sourcepub fn with_next_update(self, next_update: OcspGeneralizedTime) -> Self
Available on crate feature builder
only.
pub fn with_next_update(self, next_update: OcspGeneralizedTime) -> Self
builder
only.Sets nextUpdate
in the singleResponse
as defined in RFC 6960 Section 4.2.1.
Sourcepub fn with_extension(self, ext: impl AsExtension) -> Result<Self, Error>
Available on crate feature builder
only.
pub fn with_extension(self, ext: impl AsExtension) -> Result<Self, Error>
builder
only.Adds a single response extension as specified in RFC 6960 Section 4.4. Errors when the extension encoding fails.
Sourcepub fn from_crl<D>(
issuer: &Certificate,
crl: &CertificateList,
serial_number: SerialNumber,
) -> Result<Self, Error>where
D: Digest + AssociatedOid,
Available on crate feature builder
only.
pub fn from_crl<D>(
issuer: &Certificate,
crl: &CertificateList,
serial_number: SerialNumber,
) -> Result<Self, Error>where
D: Digest + AssociatedOid,
builder
only.Returns a SingleResponse
by searching through the CRL to see if serial
is revoked. If
not, the CertStatus
is set to good. The CertID
is built from the issuer and serial
number. This method does not ensure the CRL is issued by the issuer and only asserts the
serial is not revoked in the provided CRL.
thisUpdate
and nextUpdate
will be pulled from the CRL.
NOTE: this method complies with RFC 2560 Section 2.2 and not RFC 6960 Section 2.2.
RFC 6960 limits the good
status to only issued certificates. RFC 2560 only asserts
the serial was not revoked and makes no assertion the serial was ever issued.
Trait Implementations§
Source§impl Clone for SingleResponse
impl Clone for SingleResponse
Source§fn clone(&self) -> SingleResponse
fn clone(&self) -> SingleResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SingleResponse
impl Debug for SingleResponse
Source§impl<'__der_lifetime> DecodeValue<'__der_lifetime> for SingleResponse
impl<'__der_lifetime> DecodeValue<'__der_lifetime> for SingleResponse
Source§impl<'__der_lifetime> EncodeValue for SingleResponse
impl<'__der_lifetime> EncodeValue for SingleResponse
Source§impl PartialEq for SingleResponse
impl PartialEq for SingleResponse
impl Eq for SingleResponse
impl<'__der_lifetime> Sequence<'__der_lifetime> for SingleResponse
impl StructuralPartialEq for SingleResponse
Auto Trait Implementations§
impl Freeze for SingleResponse
impl RefUnwindSafe for SingleResponse
impl Send for SingleResponse
impl Sync for SingleResponse
impl Unpin for SingleResponse
impl UnwindSafe for SingleResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.