Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

OpenSSL::PKey::PKey#decrypt

pkey.decrypt(data [, options]) → string

Performs a public key decryption operation using pkey.

See encrypt for a description of the parameters and an example.

Added in version 3.0. See also the man page EVP_PKEY_decrypt(3).

See also #compare? #derive .new #encrypt also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1