pub trait SecurityFetcher {
// Required method
fn read_private_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Security Fetcher Interface
This trait defines the interface for implementing a custom security fetcher, responsible for obtaining the private key from the specifications of the device. By implementing this trait, you can define a specific process for retrieving the private key securely, such as utilizing a Trusted Platform Module (TPM) or other dedicated security hardware.
§Asynchronous Fetching
The method read_private_key is asynchronous, indicated by the async_trait attribute.
It asynchronously returns a Vec of bytes (u8), representing the private key. Implementers of this trait can
perform asynchronous operations, such as reading the key from a file, fetching it from a remote service, or using
any other asynchronous mechanism.
§Errors
The read_private_key method may return an std::io::Error if any I/O operation fails during the fetching process.
Required Methods§
Sourcefn read_private_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn read_private_key<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a Vec of bytes representing the private key from the implementation.
§Errors
During the fetching process, an std::io::Error can occur if any I/O operation fails.