Ruby 4.1 リファレンスマニュアル

instance method OpenSSL::PKey::PKey#oid

oid -> StringRuby 3.0 から[permalink][rdoc][edit]

self に関連付けられた OID のショートネームを返します。

require "openssl"
rsa_key = OpenSSL::PKey::RSA.generate(2048)
p rsa_key.oid # => "rsaEncryption"