diff options
author | elijah <elijah@riseup.net> | 2012-11-17 01:28:52 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-11-17 01:28:52 -0800 |
commit | 18ffd7efe05e55a3cf907309d5cd8b97aeec61c5 (patch) | |
tree | 5f97f30211e1ed7027c50077f36663c013ae2738 /lib/leap_cli/config/object.rb | |
parent | 76a3a736cfb50cb1c6d926d1e3afb0f504818157 (diff) |
added ability to fingerprint x509 certs
Diffstat (limited to 'lib/leap_cli/config/object.rb')
-rw-r--r-- | lib/leap_cli/config/object.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/leap_cli/config/object.rb b/lib/leap_cli/config/object.rb index 492de34..70834a5 100644 --- a/lib/leap_cli/config/object.rb +++ b/lib/leap_cli/config/object.rb @@ -218,6 +218,9 @@ module LeapCli @path = path @options = options end + def to_s + @path + end end # @@ -258,6 +261,13 @@ module LeapCli @manager.secrets[name.to_s] ||= Util::Secret.generate(length) end + # + # return a fingerprint for a x509 certificate + # + def fingerprint(filename) + "SHA256: " + X509.fingerprint("SHA256", Path.named_path(filename)) + end + private # |