Skip to content
instance method

OpenSSL::PKey::RSA#public_decrypt

(::String data, ?::Integer padding) -> ::String
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 which is known to be insecure but is kept for backwards compatibility.

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