pub struct Backend { /* private fields */ }Expand description
A handle to a backend.
The key store may have multiple backends. These include a backend
for soft keys (keys stored on disk), and a gpg-agent backend.
Use Keystore::backends to get a list of the backends that are
enabled.
Implementations§
Source§impl Backend
impl Backend
Sourcepub fn devices(&mut self) -> Result<Vec<Device>>
pub fn devices(&mut self) -> Result<Vec<Device>>
Lists all devices.
Lists the devices managed by a backend.
Sourcepub async fn devices_async(&mut self) -> Result<Vec<Device>>
pub async fn devices_async(&mut self) -> Result<Vec<Device>>
Lists all devices.
Lists the devices managed by a backend.
Sourcepub fn import(&mut self, cert: &Cert) -> Result<Vec<(ImportStatus, Key)>>
pub fn import(&mut self, cert: &Cert) -> Result<Vec<(ImportStatus, Key)>>
Imports secret key material.
cert is a TSK. Any keys without secret key material are silent ignored.
If a key already exists, it is overwritten.
An ImportStatus is returned for each secret key. If the
TSK doesn’t include any secret keys, then an empty list is
returned.
Some backends require additional information to import a
key. These backends should
Error::ExternalImportRequired, and indicate how a user
might import a key to this backend.
Sourcepub async fn import_async(
&mut self,
cert: &Cert,
) -> Result<Vec<(ImportStatus, Key)>>
pub async fn import_async( &mut self, cert: &Cert, ) -> Result<Vec<(ImportStatus, Key)>>
Imports secret key material.
cert is a TSK. Any keys without secret key material are silent ignored.
If a key already exists, it is overwritten.
An ImportStatus is returned for each secret key. If the
TSK doesn’t include any secret keys, then an empty list is
returned.
Some backends require additional information to import a
key. These backends should
Error::ExternalImportRequired, and indicate how a user
might import a key to this backend.