End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Security::Policy#check_cert
check_cert(signer, issuer, time)
lib/rubygems/security/policy.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/security/policy.rb, line 85
def check_cert(signer, issuer, time)
raise Gem::Security::Exception, 'missing signing certificate' unless
signer
message = "certificate #{signer.subject}"
if not_before = signer.not_before and not_before > time
raise Gem::Security::Exception,
"#{message} not valid before #{not_before}"
end
if not_after = signer.not_after and not_after < time
raise Gem::Security::Exception, "#{message} not valid after #{not_after}"
end
if issuer and not signer.verify issuer.public_key
raise Gem::Security::Exception,
"#{message} was not issued by #{issuer.subject}"
end
true
end
Ensures that signer is valid for time and was signed by the issuer. If the issuer is nil no verification is performed.