Skip to main content

OcspBasicResp

Struct OcspBasicResp 

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

The signed inner OCSP response (OCSP_BASICRESP*).

Extracted from an OcspResponse via OcspResponse::basic. Provides signature verification and per-certificate status lookup.

Implementations§

Source§

impl OcspBasicResp

Source

pub fn verify(&self, store: &X509Store, flags: u64) -> Result<bool, ErrorStack>

Verify the response signature against store.

flags is passed directly to OCSP_basic_verify (use 0 for defaults, which verifies the signature and checks the signing certificate chain).

Returns Ok(true) if the signature is valid.

§Errors
Source

pub fn count(&self) -> usize

Number of SingleResponse entries in this basic response.

Source

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

Look up the status for a specific certificate by its OcspCertId.

Returns Ok(Some(status)) if the responder included a SingleResponse for that certificate, Ok(None) if not found, or Err on a fatal OpenSSL error.

The cert_id is passed by shared reference; its pointer is only used for the duration of this call (OCSP_resp_find_status does not store it).

§Errors
Source

pub fn check_validity( &self, cert_id: &OcspCertId, sec: i64, maxsec: i64, ) -> Result<bool, ErrorStack>

Validate the thisUpdate / nextUpdate window of a SingleResponse.

sec is the acceptable clock-skew in seconds (typically 300). maxsec limits how far in the future nextUpdate may be (-1 = no limit).

§Errors

Trait Implementations§

Source§

impl Drop for OcspBasicResp

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for OcspBasicResp

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.