diff options
author | Ryan Davis <ryand@zenspider.com> | 2018-03-17 02:08:12 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2018-03-17 02:08:12 -0800 |
commit | 1cfd994ba53b09b6ac329913c88f14a0ba8a8b08 (patch) | |
tree | d395500d3265b78b8c5d388d2740206f58d15302 /lib | |
parent | 90591e48728f08304c061001764358095bcece37 (diff) | |
download | hoe-1cfd994ba53b09b6ac329913c88f14a0ba8a8b08.tar.gz |
+ Added task check_key to see if your signing cert is expired or not.
[git-p4: depot-paths = "//src/hoe/dev/": change = 11599]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hoe/signing.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/hoe/signing.rb b/lib/hoe/signing.rb index d4fe9e2..013a1ad 100644 --- a/lib/hoe/signing.rb +++ b/lib/hoe/signing.rb @@ -49,6 +49,11 @@ module Hoe::Signing task :generate_key do generate_key_task end + + desc "Check pubilc key for signing your gems." + task :check_key do + check_key_task + end end def set_up_signing # :nodoc: @@ -70,6 +75,22 @@ module Hoe::Signing end end + def check_key_task # :nodoc: + with_config do |config, _path| + break unless config["signing_cert_file"] + pub_key = File.expand_path config["signing_cert_file"].to_s + + c = OpenSSL::X509::Certificate.new File.read pub_key + t = c.not_after + + if t < Time.now then + warn "Gem signing certificate has expired" + else + warn "Gem signing certificate has NOT expired. Carry on." + end + end + end + def generate_key_task # :nodoc: email = Array(spec.email) abort "No email in your gemspec" if email.nil? or email.empty? |