instance method
Gem::Security::Signer#sign
sign(data)
lib/rubygems/security/signer.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/security/signer.rb, line 140
def sign(data)
return unless @key
raise Gem::Security::Exception, "no certs provided" if @cert_chain.empty?
if @cert_chain.length == 1 && @cert_chain.last.not_after < Time.now
alert("Your certificate has expired, trying to re-sign it...")
re_sign_key(
expiration_length: (Gem::Security::ONE_DAY * options[:expiration_length_days])
)
end
full_name = extract_name @cert_chain.last
Gem::Security::SigningPolicy.verify @cert_chain, @key, {}, {}, full_name
@key.sign @digest_algorithm.new, data
end
Sign data with given digest algorithm