diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-11-25 12:48:32 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-11-25 13:19:10 +0100 |
commit | 28d0231ce5373747cae1dbc97f988866540872ef (patch) | |
tree | 605edbbf63638acb358c7c3d09ccfe12507c4325 /openpgp/examples/sign-detached.rs | |
parent | 9c6174635ac40a32b273bf78493c1d6db3cc2d34 (diff) |
openpgp: Specialize key iterator to return Key<SecretParts, _>.
- Once KeyIter::secret or KeyIter::unencrypted_secret is called,
change the iterator type to iterate over &Key<SecretParts, _>.
- Fixes #384.
Diffstat (limited to 'openpgp/examples/sign-detached.rs')
-rw-r--r-- | openpgp/examples/sign-detached.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/examples/sign-detached.rs b/openpgp/examples/sign-detached.rs index 54c9ceef..8d5f9cfa 100644 --- a/openpgp/examples/sign-detached.rs +++ b/openpgp/examples/sign-detached.rs @@ -24,7 +24,7 @@ fn main() { .expect("Failed to read key"); let mut n = 0; - for (_, _, key) in tsk.keys_valid().signing_capable().secret(true) { + for (_, _, key) in tsk.keys_valid().signing_capable().secret() { keys.push({ let mut key = key.clone(); if key.secret().expect("filtered").is_encrypted() { @@ -37,7 +37,7 @@ fn main() { .expect("decryption failed"); } n += 1; - key.mark_parts_secret().unwrap().into_keypair().unwrap() + key.into_keypair().unwrap() }); } |