From 8354d849b19170a9a2c2b97179d9aaedb6fca6cf Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 3 Dec 2019 17:50:12 +0100 Subject: openpgp: Rename KeyFlag's accessors. - Fixes #359. --- tool/src/commands/decrypt.rs | 4 ++-- tool/src/commands/inspect.rs | 10 +++++----- tool/src/commands/key.rs | 4 ++-- tool/src/sq.rs | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'tool/src') diff --git a/tool/src/commands/decrypt.rs b/tool/src/commands/decrypt.rs index 775ab386..f872a84f 100644 --- a/tool/src/commands/decrypt.rs +++ b/tool/src/commands/decrypt.rs @@ -45,8 +45,8 @@ impl<'a> Helper<'a> { R: key::KeyRole, { if let Some(sig) = sig { - sig.key_flags().can_encrypt_at_rest() - || sig.key_flags().can_encrypt_for_transport() + sig.key_flags().for_storage_encryption() + || sig.key_flags().for_transport_encryption() } else { false } diff --git a/tool/src/commands/inspect.rs b/tool/src/commands/inspect.rs index 87b2bc2d..42d30530 100644 --- a/tool/src/commands/inspect.rs +++ b/tool/src/commands/inspect.rs @@ -232,19 +232,19 @@ fn inspect_revocation(output: &mut dyn io::Write, fn inspect_key_flags(flags: openpgp::types::KeyFlags) -> Option { let mut capabilities = Vec::new(); - if flags.can_certify() { + if flags.for_certification() { capabilities.push("certification") } - if flags.can_sign() { + if flags.for_signing() { capabilities.push("signing") } - if flags.can_authenticate() { + if flags.for_authentication() { capabilities.push("authentication") } - if flags.can_encrypt_for_transport() { + if flags.for_transport_encryption() { capabilities.push("transport encryption") } - if flags.can_encrypt_at_rest() { + if flags.for_storage_encryption() { capabilities.push("data-at-rest encryption") } diff --git a/tool/src/commands/key.rs b/tool/src/commands/key.rs index 8617cc9f..2c081f65 100644 --- a/tool/src/commands/key.rs +++ b/tool/src/commands/key.rs @@ -150,12 +150,12 @@ pub fn generate(m: &ArgMatches, force: bool) -> failure::Fallible<()> { } (Some("rest"), false) => { builder = builder.add_subkey(KeyFlags::default() - .set_encrypt_at_rest(true), + .set_storage_encryption(true), None); } (Some("transport"), false) => { builder = builder.add_subkey(KeyFlags::default() - .set_encrypt_for_transport(true), + .set_transport_encryption(true), None); } (None, true) => { /* no encryption subkey */ } diff --git a/tool/src/sq.rs b/tool/src/sq.rs index c928a325..055cf642 100644 --- a/tool/src/sq.rs +++ b/tool/src/sq.rs @@ -210,12 +210,12 @@ fn real_main() -> Result<(), failure::Error> { .unwrap_or(Ok(vec![]))?; let mode = match m.value_of("mode").expect("has default") { "rest" => KeyFlags::default() - .set_encrypt_at_rest(true), + .set_storage_encryption(true), "transport" => KeyFlags::default() - .set_encrypt_for_transport(true), + .set_transport_encryption(true), "all" => KeyFlags::default() - .set_encrypt_at_rest(true) - .set_encrypt_for_transport(true), + .set_storage_encryption(true) + .set_transport_encryption(true), _ => unreachable!("uses possible_values"), }; commands::encrypt(&mut mapping, &mut input, &mut output, -- cgit v1.2.3