Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Gem::Security.write_private_key

write_private_key(key, path, permissions = 0o600, passphrase = nil, cipher = KEY_CIPHER)

Writes the private key to path with the given permissions. If passed passphrase and cipher, the key is encrypted.