rustls_cert_read/lib.rs
1//! The traits for abstract private keys and certs reading.
2
3/// Read a single private key.
4pub trait ReadKey {
5 /// An error that can occur while reading.
6 type Error;
7
8 /// Perform the reading.
9 fn read_key(
10 &self,
11 ) -> impl std::future::Future<
12 Output = Result<rustls_pki_types::PrivateKeyDer<'static>, Self::Error>,
13 > + Send;
14}
15
16/// Read a list of certificates.
17///
18/// Inteaded for reading a single full certificate chain.
19pub trait ReadCerts {
20 /// An error that can occur while reading.
21 type Error;
22
23 /// Perform the reading.
24 fn read_certs(
25 &self,
26 ) -> impl std::future::Future<
27 Output = Result<Vec<rustls_pki_types::CertificateDer<'static>>, Self::Error>,
28 > + Send;
29}