diff options
-rw-r--r-- | sq/src/commands/key.rs | 7 | ||||
-rw-r--r-- | sq/src/sq-usage.rs | 6 | ||||
-rw-r--r-- | sq/src/sq.rs | 2 | ||||
-rw-r--r-- | sq/src/sq_cli.rs | 6 |
4 files changed, 17 insertions, 4 deletions
diff --git a/sq/src/commands/key.rs b/sq/src/commands/key.rs index 69904ebc..3d2e792f 100644 --- a/sq/src/commands/key.rs +++ b/sq/src/commands/key.rs @@ -16,6 +16,7 @@ use crate::openpgp::serialize::Serialize; use crate::openpgp::types::KeyFlags; use crate::openpgp::types::SignatureType; +use crate::Config; use crate::create_or_stdout; use crate::SECONDS_IN_YEAR; use crate::parse_duration; @@ -392,7 +393,8 @@ pub fn adopt(m: &ArgMatches, p: &dyn Policy) -> Result<()> { Ok(()) } -pub fn attest_certifications(m: &ArgMatches, _p: &dyn Policy) -> Result<()> { +pub fn attest_certifications(config: Config, m: &ArgMatches, _p: &dyn Policy) + -> Result<()> { // XXX: This function has to do some steps manually, because // Sequoia does not expose this functionality because it has not // been standardized yet. @@ -487,7 +489,8 @@ pub fn attest_certifications(m: &ArgMatches, _p: &dyn Policy) -> Result<()> { let key = key.insert_packets(attestation_signatures)?; let mut message = crate::create_or_stdout_pgp( - None, false, false, sequoia_openpgp::armor::Kind::SecretKey)?; + m.value_of("output"), config.force, m.is_present("binary"), + sequoia_openpgp::armor::Kind::SecretKey)?; key.as_tsk().serialize(&mut message)?; message.finalize()?; Ok(()) diff --git a/sq/src/sq-usage.rs b/sq/src/sq-usage.rs index b75c23ac..6ef8bf64 100644 --- a/sq/src/sq-usage.rs +++ b/sq/src/sq-usage.rs @@ -277,14 +277,18 @@ //! Attests third-party certifications allowing for their distribution //! //! USAGE: -//! sq key attest-certifications [FLAGS] <KEY> +//! sq key attest-certifications [FLAGS] [OPTIONS] <KEY> //! //! FLAGS: //! --all Attests to all certifications +//! -B, --binary Emits binary data //! -h, --help Prints help information //! --none Removes all prior attestations //! -V, --version Prints version information //! +//! OPTIONS: +//! -o, --output <FILE> Writes to FILE or stdout if omitted +//! //! ARGS: //! <KEY> Changes attestations on KEY //! ``` diff --git a/sq/src/sq.rs b/sq/src/sq.rs index 931fc24c..78fdc1d2 100644 --- a/sq/src/sq.rs +++ b/sq/src/sq.rs @@ -555,7 +555,7 @@ fn main() -> Result<()> { ("generate", Some(m)) => commands::key::generate(m, force)?, ("adopt", Some(m)) => commands::key::adopt(m, policy)?, ("attest-certifications", Some(m)) => - commands::key::attest_certifications(m, policy)?, + commands::key::attest_certifications(config, m, policy)?, _ => unreachable!(), }, diff --git a/sq/src/sq_cli.rs b/sq/src/sq_cli.rs index 9de8c77a..c4e965df 100644 --- a/sq/src/sq_cli.rs +++ b/sq/src/sq_cli.rs @@ -408,6 +408,12 @@ pub fn configure(app: App<'static, 'static>) -> App<'static, 'static> { .value_name("KEY") .required(true) .help("Changes attestations on KEY")) + .arg(Arg::with_name("output") + .short("o").long("output").value_name("FILE") + .help("Writes to FILE or stdout if omitted")) + .arg(Arg::with_name("binary") + .short("B").long("binary") + .help("Emits binary data")) ) ) |