summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-08-26 16:19:47 +0200
committerJustus Winter <justus@sequoia-pgp.org>2019-08-26 16:19:47 +0200
commit3d7acf62b65ddb9919cbba6bd4f26fa7e94fce45 (patch)
tree1ee2953b16a48e5a25aa3410fab00991df664604 /tool
parent86e2cb5263a23fe78a49163f0e798efc349ca89e (diff)
tool: Annotate TPKs retrieved from keyservers.
- See #305.
Diffstat (limited to 'tool')
-rw-r--r--tool/src/sq.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/tool/src/sq.rs b/tool/src/sq.rs
index 02350b38..c893fb4f 100644
--- a/tool/src/sq.rs
+++ b/tool/src/sq.rs
@@ -320,18 +320,13 @@ fn real_main() -> Result<(), failure::Error> {
let id = id.unwrap();
let mut output = create_or_stdout(m.value_of("output"), force)?;
- let mut output = if ! m.is_present("binary") {
- Box::new(armor::Writer::new(&mut output,
- armor::Kind::PublicKey,
- &[])?)
+ let tpk = core.run(ks.get(&id))
+ .context("Failed to retrieve key")?;
+ if ! m.is_present("binary") {
+ tpk.armored().serialize(&mut output)
} else {
- output
- };
-
- core.run(ks.get(&id))
- .context("Failed to retrieve key")?
- .serialize(&mut output)
- .context("Failed to serialize key")?;
+ tpk.serialize(&mut output)
+ }.context("Failed to serialize key")?;
},
("send", Some(m)) => {
let mut input = open_or_stdin(m.value_of("input"))?;