summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/stream.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-12-05 16:13:54 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-12-05 16:21:52 +0100
commit41fd3f08adff856ec558f8b06214e0f392893a26 (patch)
treee7894d4e77074109692503fab3b3b46d343f70b6 /openpgp/src/serialize/stream.rs
parent71a3a540bda400f52a841c04b8d33a51959fa8f0 (diff)
openpgp: Make crypto::{Signer,Decryptor} non-polymorphic.
- These are low-level cryptographic traits that are not concerned with the role of a key. - Fixes #382.
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-rw-r--r--openpgp/src/serialize/stream.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs
index 0ee18a18..35b08b1a 100644
--- a/openpgp/src/serialize/stream.rs
+++ b/openpgp/src/serialize/stream.rs
@@ -203,7 +203,7 @@ pub struct Signer<'a> {
// take our inner reader. If that happens, we only update the
// digests.
inner: Option<writer::BoxStack<'a, Cookie>>,
- signers: Vec<Box<dyn crypto::Signer<key::UnspecifiedRole> + 'a>>,
+ signers: Vec<Box<dyn crypto::Signer + 'a>>,
intended_recipients: Vec<Fingerprint>,
detached: bool,
hash: crypto::hash::Context,
@@ -231,7 +231,7 @@ impl<'a> Signer<'a> {
/// # let keypair = tsk.keys_valid().for_signing().nth(0).unwrap().2
/// # .clone().mark_parts_secret().unwrap().into_keypair().unwrap();
/// # f(tsk, keypair).unwrap();
- /// # fn f(cert: Cert, mut signing_keypair: KeyPair<key::UnspecifiedRole>)
+ /// # fn f(cert: Cert, mut signing_keypair: KeyPair)
/// # -> Result<()> {
///
/// let mut o = vec![];
@@ -272,7 +272,7 @@ impl<'a> Signer<'a> {
/// # }
/// ```
pub fn new<S>(inner: writer::Stack<'a, Cookie>, signer: S) -> Self
- where S: crypto::Signer<key::UnspecifiedRole> + 'a
+ where S: crypto::Signer + 'a
{
let inner = writer::BoxStack::from(inner);
let level = inner.cookie_ref().level + 1;
@@ -298,7 +298,7 @@ impl<'a> Signer<'a> {
/// Adds an additional signer.
pub fn add_signer<S>(mut self, signer: S) -> Self
- where S: crypto::Signer<key::UnspecifiedRole> + 'a
+ where S: crypto::Signer + 'a
{
self.signers.push(Box::new(signer));
self
@@ -334,7 +334,7 @@ impl<'a> Signer<'a> {
/// # let keypair = tsk.keys_valid().for_signing().nth(0).unwrap().2
/// # .clone().mark_parts_secret().unwrap().into_keypair().unwrap();
/// # f(tsk, keypair).unwrap();
- /// # fn f(cert: Cert, mut signing_keypair: KeyPair<key::UnspecifiedRole>)
+ /// # fn f(cert: Cert, mut signing_keypair: KeyPair)
/// # -> Result<()> {
///
/// let mut o = vec![];
@@ -1479,7 +1479,7 @@ mod test {
let mut signers = keys.iter().map(|(_, key)| {
key.clone().mark_parts_secret().unwrap().into_keypair()
.expect("expected unencrypted secret key")
- }).collect::<Vec<KeyPair<_>>>();
+ }).collect::<Vec<KeyPair>>();
let m = Message::new(&mut o);
let mut signer = Signer::new(m, signers.pop().unwrap());