diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-19 12:18:01 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-19 12:46:58 +0100 |
commit | ef396882bc35a97d778e985cd69ebd5181852d8c (patch) | |
tree | 6e7945e1394ff82e5a72badc933ddac710c108cc /openpgp/examples/decrypt-with.rs | |
parent | 32174f69cd4d94b4f621f3273781d487e97fa031 (diff) |
openpgp: Split VerificationResult.
- Split VerificationResult into Result<GoodChecksum,
VerificationError>.
- Fixes #416.
Diffstat (limited to 'openpgp/examples/decrypt-with.rs')
-rw-r--r-- | openpgp/examples/decrypt-with.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs index c4b9f56a..ca84a918 100644 --- a/openpgp/examples/decrypt-with.rs +++ b/openpgp/examples/decrypt-with.rs @@ -16,7 +16,7 @@ use crate::openpgp::parse::{ DecryptionHelper, Decryptor, VerificationHelper, - VerificationResult, + GoodChecksum, MessageStructure, MessageLayer, }, @@ -108,7 +108,6 @@ impl VerificationHelper for Helper { } fn check(&mut self, structure: MessageStructure) -> failure::Fallible<()> { - use self::VerificationResult::*; for layer in structure.iter() { match layer { MessageLayer::Compression { algo } => @@ -123,19 +122,11 @@ impl VerificationHelper for Helper { MessageLayer::SignatureGroup { ref results } => for result in results { match result { - GoodChecksum { cert, .. } => { - eprintln!("Good signature from {}", cert); - }, - NotAlive { sig, .. } => { - eprintln!("Good, but not alive signature from {:?}", - sig.get_issuers()); - }, - MissingKey { .. } => { - eprintln!("No key to check signature"); - }, - Error { error, .. } => { - eprintln!("Error: {}", error); + Ok(GoodChecksum { ka, .. }) => { + eprintln!("Good signature from {}", ka.cert()); }, + Err(e) => + eprintln!("Error: {:?}", e), } } } |