Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
OpenSSL::PKey::RSA#public_key
rsa.public_key → rsanew
ext/openssl/lib/openssl/pkey.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/ext/openssl/lib/openssl/pkey.rb, line 327
def public_key
OpenSSL::PKey.read(public_to_der)
end
Returns a new RSA instance that carries just the public key components.
This method is provided for backwards compatibility. In most cases, there is no need to call this method.
For the purpose of serializing the public key, to PEM or DER encoding of X.509 SubjectPublicKeyInfo format, check PKey#public_to_pem and PKey#public_to_der.
See also
#public_encrypt
#set_crt_params
#public_decrypt
#set_factors
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0