summaryrefslogtreecommitdiffstats
path: root/tool/src/commands
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-04-20 17:15:08 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-04-20 18:44:00 +0200
commitbc4e1564ea816a66d1191fc310ac6d2b02d1a92f (patch)
tree4ee0e4ee0706fa9cedab061fef8cffbc549b0d62 /tool/src/commands
parent15723e28cc6e18b0ca7a51212bbcd72fb0e40c72 (diff)
openpgp: Add armor::Writer::with_headers.
- Add a new constructor that takes headers. This allows us to make the header argument polymorphic.
Diffstat (limited to 'tool/src/commands')
-rw-r--r--tool/src/commands/key.rs4
-rw-r--r--tool/src/commands/sign.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/tool/src/commands/key.rs b/tool/src/commands/key.rs
index 688633a8..9e83b49f 100644
--- a/tool/src/commands/key.rs
+++ b/tool/src/commands/key.rs
@@ -158,7 +158,7 @@ pub fn generate(m: &ArgMatches, force: bool) -> Result<()> {
.collect();
let w = create_or_stdout(Some(&key_path), force)?;
- let mut w = Writer::new(w, Kind::SecretKey, &headers)?;
+ let mut w = Writer::with_headers(w, Kind::SecretKey, headers)?;
cert.as_tsk().serialize(&mut w)?;
w.finalize()?;
}
@@ -171,7 +171,7 @@ pub fn generate(m: &ArgMatches, force: bool) -> Result<()> {
headers.insert(0, ("Comment", "Revocation certificate for"));
let w = create_or_stdout(Some(&rev_path), force)?;
- let mut w = Writer::new(w, Kind::Signature, &headers)?;
+ let mut w = Writer::with_headers(w, Kind::Signature, headers)?;
Packet::Signature(rev).serialize(&mut w)?;
w.finalize()?;
}
diff --git a/tool/src/commands/sign.rs b/tool/src/commands/sign.rs
index 9a8e6819..a91ea54b 100644
--- a/tool/src/commands/sign.rs
+++ b/tool/src/commands/sign.rs
@@ -86,7 +86,7 @@ fn sign_data(policy: &dyn Policy,
} else {
armor::Kind::Message
},
- &[])?;
+ Vec::new())?;
}
let mut keypairs = super::get_signing_keys(&secrets, policy, time)?;