diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-08-12 13:39:14 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-08-23 19:15:13 +0200 |
commit | 05cf492f3417fd61f6b1e7dc4913a16fd5f201ea (patch) | |
tree | eca0c2e0481e10b54884a766e7e864020089fe84 /tool/src/commands/mod.rs | |
parent | 102dea398e920e91b34e5602033c2e7e53c50bb1 (diff) |
openpgp: Use marker types to denote a Key's type.
- In addition to providing some added protection, this allows us to
implement 'From<Key<_, _>> for Packet'.
Diffstat (limited to 'tool/src/commands/mod.rs')
-rw-r--r-- | tool/src/commands/mod.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs index c4175cd9..4593d95d 100644 --- a/tool/src/commands/mod.rs +++ b/tool/src/commands/mod.rs @@ -11,7 +11,7 @@ use sequoia_core::Context; use crate::openpgp::constants::DataFormat; use crate::openpgp::crypto; use crate::openpgp::{TPK, KeyID, Result}; -use crate::openpgp::packet::key::SecretKeyMaterial; +use crate::openpgp::packet::prelude::*; use crate::openpgp::parse::{ Parse, PacketParserResult, @@ -42,7 +42,10 @@ fn tm2str(t: &time::Tm) -> String { } /// Returns suitable signing keys from a given list of TPKs. -fn get_signing_keys(tpks: &[openpgp::TPK]) -> Result<Vec<crypto::KeyPair>> { +fn get_signing_keys(tpks: &[openpgp::TPK]) + -> Result<Vec<crypto::KeyPair< + openpgp::packet::key::UnspecifiedRole>>> +{ let mut keys = Vec::new(); 'next_tpk: for tsk in tpks { for key in tsk.keys_valid() @@ -115,7 +118,7 @@ pub fn encrypt(store: &mut store::Store, if ! signers.is_empty() { sink = Signer::with_intended_recipients( sink, - signers.iter_mut().map(|s| -> &mut dyn crypto::Signer { s }) + signers.iter_mut().map(|s| -> &mut dyn crypto::Signer<_> { s }) .collect(), &recipients, None)?; |