Skip to content

End of Life Ruby 3.1 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.

Deprecated in version 3.0. Consider using PKey::PKey#sign_raw and PKey::PKey#verify_raw, and PKey::PKey#verify_recover instead.