summaryrefslogtreecommitdiff
path: root/openssl/src/x509/store.rs
diff options
context:
space:
mode:
authorAnsley Peduru <ansleypeduru96@gmail.com>2017-12-31 22:39:28 -0500
committerAnsley Peduru <ansleypeduru96@gmail.com>2017-12-31 22:39:28 -0500
commit1a40795886e649dc429b7487323f2873783ca092 (patch)
tree970e9124f46ec6820393c8fe3c4af895050afb37 /openssl/src/x509/store.rs
parentd3fff74ae8ab092a77050ba210b942e86c3bd9ff (diff)
downloadrust-openssl-1a40795886e649dc429b7487323f2873783ca092.zip
Add documentation for x509 module
Diffstat (limited to 'openssl/src/x509/store.rs')
-rw-r--r--openssl/src/x509/store.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/openssl/src/x509/store.rs b/openssl/src/x509/store.rs
index 198679b5..e1e6de7d 100644
--- a/openssl/src/x509/store.rs
+++ b/openssl/src/x509/store.rs
@@ -1,3 +1,26 @@
+//! Describe a context in which to verify an `X509` certificate.
+//!
+//! The `X509` certificate store holds trusted CA certificates used to verify
+//! peer certificates.
+//!
+//! # Example
+//!
+//! ```rust
+//! extern crate openssl;
+//!
+//! use openssl::x509::X509;
+//! use openssl::x509::store::{X509StoreBuilder, X509Store};
+//!
+//! fn main() {
+//! let cert = include_bytes!("cert.pem");
+//! let cert = X509::from_pem(cert).ok().expect("Failed to load PEM");
+//!
+//! let mut builder = X509StoreBuilder::new().unwrap();
+//! let _ = builder.add_cert(cert);
+//!
+//! let store: X509Store = builder.build();
+//! }
+//! ```
use ffi;
use foreign_types::ForeignTypeRef;
use std::mem;
@@ -10,7 +33,9 @@ foreign_type! {
type CType = ffi::X509_STORE;
fn drop = ffi::X509_STORE_free;
+ /// A builder type used to construct an `X509Store`.
pub struct X509StoreBuilder;
+ /// Reference to an `X509StoreBuilder`.
pub struct X509StoreBuilderRef;
}
@@ -58,6 +83,8 @@ foreign_type! {
type CType = ffi::X509_STORE;
fn drop = ffi::X509_STORE_free;
+ /// A certificate store to hold trusted `X509` certificates.
pub struct X509Store;
+ /// Reference to an `X509Store`.
pub struct X509StoreRef;
}