Skip to content

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

instance method

OpenSSL::PKey::PKey#verify

pkey.verify(digest, signature, data [, options]) → true or false

Verifies the signature for the data using a message digest algorithm digest and a public key pkey.

Returns true if the signature is successfully verified, false otherwise. The caller must check the return value.

See sign for the signing operation and an example.

See also the man page EVP_DigestVerify(3).

digest

See sign.

signature

A String containing the signature to be verified.

data

See sign.

options

See sign. options parameter was added in version 3.0.

See also #to_text #verify_raw #sign_raw #verify_recover also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0