pub struct X509StoreCtx { /* private fields */ }Expand description
A chain-verification context (X509_STORE_CTX*).
Create with X509StoreCtx::new, initialise with X509StoreCtx::init,
then call X509StoreCtx::verify.
Implementations§
Source§impl X509StoreCtx
impl X509StoreCtx
Sourcepub fn new() -> Result<Self, ErrorStack>
pub fn new() -> Result<Self, ErrorStack>
Allocate a new, uninitialised verification context.
§Errors
Sourcepub fn verify(&mut self) -> Result<bool, ErrorStack>
pub fn verify(&mut self) -> Result<bool, ErrorStack>
Verify the certificate chain.
Returns Ok(true) if the chain is valid, Ok(false) if not (call
Self::error to retrieve the error code), or Err on a fatal error.
§Errors
Sourcepub fn error(&self) -> i32
pub fn error(&self) -> i32
OpenSSL verification error code after a failed Self::verify.
Returns 0 (X509_V_OK) if no error occurred. See <openssl/x509_vfy.h>
for the full list of X509_V_ERR_* constants.
Sourcepub fn chain(&self) -> Vec<X509>
pub fn chain(&self) -> Vec<X509>
Collect the verified chain into a Vec<X509>.
Only meaningful after a successful Self::verify. Returns an empty
Vec if the chain is not available.
Trait Implementations§
Source§impl Drop for X509StoreCtx
impl Drop for X509StoreCtx
impl Send for X509StoreCtx
Auto Trait Implementations§
impl Freeze for X509StoreCtx
impl RefUnwindSafe for X509StoreCtx
impl !Sync for X509StoreCtx
impl Unpin for X509StoreCtx
impl UnsafeUnpin for X509StoreCtx
impl UnwindSafe for X509StoreCtx
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
Mutably borrows from an owned value. Read more