Function sequoia_net::pks::unlock_decryptor
source · pub fn unlock_decryptor(
store_uri: impl AsRef<str>,
key: Key<PublicParts, UnspecifiedRole>,
p: &Password
) -> Result<Box<dyn Decryptor + Send + Sync>>
Expand description
Unlock a remote key for decryption.
Look up a private key corresponding to the public key passed as a
parameter and return a Decryptor
trait object that will utilize
that private key for decryption.
Errors
This function fails if the key cannot be found on the remote store or if the password is not correct.
Examples
use sequoia_net::pks;
match pks::unlock_decryptor("http://localhost:3000/", key, &p) {
Ok(decryptor) => { /* use decryptor for decryption */ },
Err(e) => { eprintln!("Could not unlock decryptor: {:?}", e); }
}