diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-05-31 18:22:07 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-06-01 12:55:08 +0200 |
commit | aaaca386bc6e41508ef955c6b27df776be73c24e (patch) | |
tree | 100e036b85487546deaa3b7ef21ad9e336ff17fe /openpgp/src/parse | |
parent | 65045ec849d2d755ddde4de624dac050ca1304bb (diff) |
openpgp: Simplify tests.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r-- | openpgp/src/parse/stream.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs index 6a379687..06dc0ff2 100644 --- a/openpgp/src/parse/stream.rs +++ b/openpgp/src/parse/stream.rs @@ -1796,8 +1796,6 @@ mod test { use constants::DataFormat; use tpk::{TPKBuilder, CipherSuite}; use serialize::stream::{LiteralWriter, Signer, Message}; - use packet::key::SecretKey; - use crypto::KeyPair; use std::io::Write; let (tpk, _) = TPKBuilder::new() @@ -1809,11 +1807,7 @@ mod test { let mut buf = vec![]; { let key = tpk.keys_all().signing_capable().nth(0).unwrap().2; - let sec = match key.secret() { - Some(SecretKey::Unencrypted { ref mpis }) => mpis, - _ => unreachable!(), - }; - let mut keypair = KeyPair::new(key.clone(), sec.clone()).unwrap(); + let mut keypair = key.clone().into_keypair().unwrap(); let m = Message::new(&mut buf); let signer = Signer::new(m, vec![&mut keypair], None).unwrap(); |