summaryrefslogtreecommitdiffstats
path: root/openpgp/examples/sign.rs
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-08-12 13:39:14 +0200
committerNeal H. Walfield <neal@pep.foundation>2019-08-23 19:15:13 +0200
commit05cf492f3417fd61f6b1e7dc4913a16fd5f201ea (patch)
treeeca0c2e0481e10b54884a766e7e864020089fe84 /openpgp/examples/sign.rs
parent102dea398e920e91b34e5602033c2e7e53c50bb1 (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 'openpgp/examples/sign.rs')
-rw-r--r--openpgp/examples/sign.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/openpgp/examples/sign.rs b/openpgp/examples/sign.rs
index cfd9c136..bdb29c4c 100644
--- a/openpgp/examples/sign.rs
+++ b/openpgp/examples/sign.rs
@@ -38,7 +38,7 @@ fn main() {
.expect("decryption failed");
}
n += 1;
- key.into_keypair().unwrap()
+ key.mark_parts_secret().into_keypair().unwrap()
});
}
@@ -59,7 +59,9 @@ fn main() {
// Now, create a signer that emits a signature.
let signer = Signer::new(
message,
- keys.iter_mut().map(|s| -> &mut dyn crypto::Signer { s }).collect(),
+ keys.iter_mut()
+ .map(|s| -> &mut dyn crypto::Signer<_> { s })
+ .collect(),
None)
.expect("Failed to create signer");