End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
OpenSSL::PKey::RSA.generate
RSA.generate(size, exponent = 65537) → RSA
ext/openssl/lib/openssl/pkey.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/ext/openssl/lib/openssl/pkey.rb, line 343
def generate(size, exp = 0x10001, &blk)
OpenSSL::PKey.generate_key("RSA", {
"rsa_keygen_bits" => size,
"rsa_keygen_pubexp" => exp,
}, &blk)
end
Generates an RSA keypair.
See also OpenSSL::PKey.generate_key.
size-
The desired key size in bits.
exponent-
An odd
Integer, normally 3, 17, or 65537.