From edf3f23ef452ee8235ddca0b8a3358da8036dc00 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Thu, 2 Aug 2018 16:46:17 -0400 Subject: Add --no-fsname option to fingerprint command --- src/cli/pubkey.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/cli') diff --git a/src/cli/pubkey.cpp b/src/cli/pubkey.cpp index c28a9fa42..8704fe1ad 100644 --- a/src/cli/pubkey.cpp +++ b/src/cli/pubkey.cpp @@ -117,7 +117,7 @@ std::string algo_default_emsa(const std::string& key) class PK_Fingerprint final : public Command { public: - PK_Fingerprint() : Command("fingerprint --algo=SHA-256 *keys") {} + PK_Fingerprint() : Command("fingerprint --no-fsname --algo=SHA-256 *keys") {} std::string group() const override { @@ -132,12 +132,18 @@ class PK_Fingerprint final : public Command void go() override { const std::string hash_algo = get_arg("algo"); + const bool no_fsname = flag_set("no-fsname"); for(std::string key_file : get_arg_list("keys")) { std::unique_ptr key(Botan::X509::load_key(key_file)); - output() << key_file << ": " << key->fingerprint_public(hash_algo) << "\n"; + const std::string fprint = key->fingerprint_public(hash_algo); + + if(no_fsname) + output() << fprint << "\n"; + else + output() << key_file << ": " << fprint << "\n"; } } }; -- cgit v1.2.3