add_trusted_cert(cert, opt = {})
public
Add certificate to trusted cert list.
Note: At the moment these are stored in OPT[:trust_dir], although that
directory may change in the future.
# File lib/rubygems/security.rb, line 764
def self.add_trusted_cert(cert, opt = {})
opt = OPT.merge(opt)
# get destination path
path = Gem::Security::Policy.trusted_cert_path(cert, opt)
# verify trust directory (can't write to nowhere, you know)
verify_trust_dir(opt[:trust_dir], opt[:perms][:trust_dir])
# write cert to output file
File.open(path, 'wb') do |file|
file.chmod(opt[:perms][:trusted_cert])
file.write(cert.to_pem)
end
# return nil
nil
end