trz_gateway_common/security_configuration/trusted_store/
mod.rs

1use std::sync::Arc;
2
3use openssl::x509::store::X509Store;
4
5use crate::is_global::IsGlobal;
6use crate::is_global::IsGlobalError;
7
8pub mod cache;
9pub mod empty;
10pub mod load;
11pub mod native;
12pub mod pem;
13pub mod root_cert_store;
14pub mod tls_client;
15
16/// Trait for configuration that holds a [X509Store].
17pub trait TrustedStoreConfig: IsGlobal {
18    type Error: IsGlobalError;
19    fn root_certificates(&self) -> Result<Arc<X509Store>, Self::Error>;
20}
21
22impl<T: TrustedStoreConfig> TrustedStoreConfig for Arc<T> {
23    type Error = T::Error;
24
25    fn root_certificates(&self) -> Result<Arc<X509Store>, Self::Error> {
26        self.as_ref().root_certificates()
27    }
28}