Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::PKey::RSA#public_decrypt

rsa.public_decrypt(string) => String
rsa.public_decrypt(string, padding) => String

Decrypt string, which has been encrypted with the private key, with the public key. padding defaults to PKCS1_PADDING.