pub struct RootCertStore {
pub roots: Vec<TrustAnchor<'static>>,
}展开描述
A container 用于 root certificates able 到 provide 一个 root-of-trust 用于 connection authentication.
字段§
§roots: Vec<TrustAnchor<'static>>此 list of roots.
实现§
Source§impl RootCertStore
impl RootCertStore
Sourcepub fn empty() -> Self
pub fn empty() -> Self
创建一个新的空 RootCertStore。
Sourcepub fn add_parsable_certificates<'a>(
&mut self,
der_certs: impl IntoIterator<Item = CertificateDer<'a>>,
) -> (usize, usize)
pub fn add_parsable_certificates<'a>( &mut self, der_certs: impl IntoIterator<Item = CertificateDer<'a>>, ) -> (usize, usize)
解析提供的 DER-encoded certificates 并 add all that can be parsed in 一个 best-effort fashion.
This is because large collections of root certificates often include ancient 或 syntactically invalid 证书
返回已添加证书的数量与被忽略的数量。
Sourcepub fn add(&mut self, der: CertificateDer<'_>) -> Result<(), Error>
pub fn add(&mut self, der: CertificateDer<'_>) -> Result<(), Error>
Add 一个 single DER-encoded certificate 到 the store.
This 适合于 一个 small set of root certificates that are expected 到 parse
successfully. For large collections of roots (用于 example 从 一个 system store) it
is expected that some of them might not be valid according 到 the rules rustls
implements. As long as 一个 relatively limited number of certificates are affected,
this should not be 一个 cause 用于 concern. Use RootCertStore::add_parsable_certificates
in order 到 add as many valid roots as possible 并 到 understand how many certificates
have been diagnosed as malformed.
Sourcepub fn subjects(&self) -> Vec<DistinguishedName>
pub fn subjects(&self) -> Vec<DistinguishedName>
返回 DER 编码的 DistinguishedName of each trust anchor subject in the root
cert store.
Each DistinguishedName , 一个 DER-encoded X.500 distinguished name, per
RFC 5280 A.1, including the outer SEQUENCE。
Trait 实现§
Source§impl Clone for RootCertStore
impl Clone for RootCertStore
Source§fn clone(&self) -> RootCertStore
fn clone(&self) -> RootCertStore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. 更多信息Source§impl Debug for RootCertStore
impl Debug for RootCertStore
Source§impl Extend<TrustAnchor<'static>> for RootCertStore
impl Extend<TrustAnchor<'static>> for RootCertStore
Source§fn extend<T: IntoIterator<Item = TrustAnchor<'static>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = TrustAnchor<'static>>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)