Skip to main content

OcspResponse

Struct OcspResponse 

Source
pub struct OcspResponse { /* private fields */ }
Expand description

An OCSP response (OCSP_RESPONSE*).

Decode from DER with OcspResponse::from_der. Check the top-level OcspResponse::status, then extract the signed inner response with OcspResponse::basic for per-certificate status lookup.

Implementations§

Source§

impl OcspResponse

Source

pub fn from_der(der: &[u8]) -> Result<Self, ErrorStack>

Decode an OCSP response from DER bytes.

§Errors
Source

pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>

Encode the OCSP response to DER bytes.

§Errors
Source

pub fn status(&self) -> OcspResponseStatus

Overall OCSP response status (top-level packet status, not cert status).

A Successful value means the server processed the request; it does not mean any individual certificate is good. Use Self::basic and then OcspBasicResp::find_status for per-certificate results.

Source

pub fn basic(&self) -> Result<OcspBasicResp, ErrorStack>

Extract the signed inner response (OCSP_BASICRESP*).

Only valid when Self::status is OcspResponseStatus::Successful.

§Errors

Returns Err if the response has no basic response body (e.g. the top-level status is not Successful).

Source

pub fn verified_status( &self, store: &X509Store, cert_id: &OcspCertId, ) -> Result<Option<OcspSingleStatus>, ErrorStack>

Convenience: verify the basic response signature and look up a cert status in one call.

Equivalent to resp.basic()?.verify(store, 0)?; resp.basic()?.find_status(id).

§Errors

Trait Implementations§

Source§

impl Drop for OcspResponse

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for OcspResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.