diff options
Diffstat (limited to 'openpgp/src/crypto/asymmetric.rs')
-rw-r--r-- | openpgp/src/crypto/asymmetric.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openpgp/src/crypto/asymmetric.rs b/openpgp/src/crypto/asymmetric.rs index 9232bd14..144bcc4c 100644 --- a/openpgp/src/crypto/asymmetric.rs +++ b/openpgp/src/crypto/asymmetric.rs @@ -27,6 +27,17 @@ pub trait Signer<R> -> Result<mpis::Signature>; } +impl<R: key::KeyRole> Signer<R> for Box<dyn Signer<R>> { + fn public(&self) -> &Key<key::PublicParts, R> { + self.as_ref().public() + } + + fn sign(&mut self, hash_algo: HashAlgorithm, digest: &[u8]) + -> Result<mpis::Signature> { + self.as_mut().sign(hash_algo, digest) + } +} + /// Decrypts a message. /// /// This is a low-level mechanism to decrypt an arbitrary OpenPGP |