summaryrefslogtreecommitdiffstats
path: root/tool/src/commands/decrypt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tool/src/commands/decrypt.rs')
-rw-r--r--tool/src/commands/decrypt.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs
index b6d27aa2..52778cdb 100644
--- a/tool/src/commands/decrypt.rs
+++ b/tool/src/commands/decrypt.rs
@@ -46,7 +46,9 @@ impl<'a> Helper<'a> {
let mut identities: HashMap<KeyID, Fingerprint> = HashMap::new();
let mut hints: HashMap<KeyID, String> = HashMap::new();
for tsk in secrets {
- let hint = match tsk.primary_userid(policy, None).ok() {
+ let hint = match tsk.with_policy(policy, None)
+ .and_then(|valid_cert| valid_cert.primary_userid()).ok()
+ {
Some(uid) => format!("{} ({})", uid.userid(),
KeyID::from(tsk.fingerprint())),
None => format!("{}", KeyID::from(tsk.fingerprint())),