diff options
author | Noah <33094578+coolreader18@users.noreply.github.com> | 2020-03-22 23:20:59 -0500 |
---|---|---|
committer | Noah <33094578+coolreader18@users.noreply.github.com> | 2020-03-22 23:20:59 -0500 |
commit | 8cfb59b9ea9046d26063837c914826a55ad9c3d7 (patch) | |
tree | b6ae5a81a4eb89182d7d7cc295de2bc898dbfac9 /openssl/src/x509/store.rs | |
parent | dbc5459d63eb55ff70531903bb6caa57366b1de3 (diff) | |
download | rust-openssl-8cfb59b9ea9046d26063837c914826a55ad9c3d7.zip |
Add a way to get the certificates stored in an X509Store
Diffstat (limited to 'openssl/src/x509/store.rs')
-rw-r--r-- | openssl/src/x509/store.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/openssl/src/x509/store.rs b/openssl/src/x509/store.rs index f533d9c7..2459a06b 100644 --- a/openssl/src/x509/store.rs +++ b/openssl/src/x509/store.rs @@ -45,7 +45,8 @@ use foreign_types::ForeignTypeRef; use std::mem; use error::ErrorStack; -use x509::X509; +use stack::StackRef; +use x509::{X509Object, X509}; use {cvt, cvt_p}; foreign_type_and_impl_send_sync! { @@ -104,3 +105,10 @@ foreign_type_and_impl_send_sync! { /// Reference to an `X509Store`. pub struct X509StoreRef; } + +impl X509StoreRef { + /// Get a reference to the cache of certificates in this store. + pub fn certs(&self) -> &StackRef<X509Object> { + unsafe { StackRef::from_ptr(ffi::X509_STORE_get0_objects(self.as_ptr())) } + } +} |