aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/x509.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-20 20:44:55 -0400
committerJack Lloyd <[email protected]>2017-10-20 20:45:05 -0400
commit9123c7b7193f671c0fe8646b62f73357a5b190e4 (patch)
tree7fc08937f7f329426e2c36d7ebfefe6954eb4a53 /src/cli/x509.cpp
parentcba904d7a474ef4151654c762d110ffd19841b33 (diff)
Add ability to print fingerprint in cert_info cli
[ci skip]
Diffstat (limited to 'src/cli/x509.cpp')
-rw-r--r--src/cli/x509.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cli/x509.cpp b/src/cli/x509.cpp
index 954c2ea6f..eb09eb41d 100644
--- a/src/cli/x509.cpp
+++ b/src/cli/x509.cpp
@@ -74,7 +74,7 @@ BOTAN_REGISTER_COMMAND("sign_cert", Sign_Cert);
class Cert_Info final : public Command
{
public:
- Cert_Info() : Command("cert_info --ber file") {}
+ Cert_Info() : Command("cert_info --fingerprint --ber file") {}
void go() override
{
@@ -95,6 +95,9 @@ class Cert_Info final : public Command
// to_string failed - report the exception and continue
output() << "X509_Certificate::to_string failed: " << e.what() << "\n";
}
+
+ if(flag_set("fingerprint"))
+ output() << "Fingerprint: " << cert.fingerprint("SHA-256") << std::endl;
}
catch(Botan::Exception& e)
{