From 723a7718ad0d89e138bbb0f7f7f8500d773c827f Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Wed, 2 Jan 2019 14:43:28 +0100 Subject: openpgp: Move Signer trait to crypto. --- openpgp/src/crypto/asymmetric.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 openpgp/src/crypto/asymmetric.rs (limited to 'openpgp/src/crypto/asymmetric.rs') diff --git a/openpgp/src/crypto/asymmetric.rs b/openpgp/src/crypto/asymmetric.rs new file mode 100644 index 00000000..9a497f9a --- /dev/null +++ b/openpgp/src/crypto/asymmetric.rs @@ -0,0 +1,17 @@ +//! Asymmetric crypto operations. + +use packet::Key; +use crypto::mpis; +use constants::HashAlgorithm; + +use Result; + +/// Creates a signature. +pub trait Signer { + /// Returns a reference to the public key. + fn public(&self) -> &Key; + + /// Creates a signature over the `digest` produced by `hash_algo`. + fn sign(&mut self, hash_algo: HashAlgorithm, digest: &[u8]) + -> Result; +} -- cgit v1.2.3