diff options
Diffstat (limited to 'openpgp/examples')
-rw-r--r-- | openpgp/examples/decrypt-with.rs | 3 | ||||
-rw-r--r-- | openpgp/examples/generate-encrypt-decrypt.rs | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/openpgp/examples/decrypt-with.rs b/openpgp/examples/decrypt-with.rs index 84f333db..bd8a2b13 100644 --- a/openpgp/examples/decrypt-with.rs +++ b/openpgp/examples/decrypt-with.rs @@ -8,6 +8,7 @@ use std::io; extern crate failure; extern crate sequoia_openpgp as openpgp; +use openpgp::packet::key::SecretKey; use openpgp::parse::stream::{ Decryptor, DecryptionHelper, Secret, VerificationHelper, VerificationResult, }; @@ -55,7 +56,7 @@ impl Helper { .unwrap_or(false) { // Only handle unencrypted secret keys. - if let Some(openpgp::SecretKey::Unencrypted { ref mpis }) = + if let Some(SecretKey::Unencrypted { ref mpis }) = key.secret() { keys.insert(key.fingerprint().to_keyid(), diff --git a/openpgp/examples/generate-encrypt-decrypt.rs b/openpgp/examples/generate-encrypt-decrypt.rs index 64b6cfab..3fb00103 100644 --- a/openpgp/examples/generate-encrypt-decrypt.rs +++ b/openpgp/examples/generate-encrypt-decrypt.rs @@ -5,6 +5,7 @@ use std::io::{self, Write}; extern crate sequoia_openpgp as openpgp; use openpgp::serialize::stream::*; use openpgp::parse::stream::*; +use openpgp::packet::key::SecretKey; const MESSAGE: &'static str = "дружба"; @@ -110,7 +111,7 @@ impl<'a> DecryptionHelper for Helper<'a> { // The secret key is not encrypted. let secret = - if let Some(openpgp::SecretKey::Unencrypted { + if let Some(SecretKey::Unencrypted { ref mpis, }) = key.secret() { mpis.clone() |