Writes pemmable, which must respond to to_pem to
path with the given permissions. If passed
cipher and passphrase those arguments will be passed to
to_pem.
# File lib/rubygems/security.rb, line 578
def self.write pemmable, path, permissions = 0600, passphrase = nil, cipher = KEY_CIPHER
path = File.expand_path path
File.open path, 'wb', permissions do |io|
if passphrase and cipher
io.write pemmable.to_pem cipher, passphrase
else
io.write pemmable.to_pem
end
end
path
end