sign_pss
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
sign_pss(p1, p2, p3 = {})
public
Signs data using the Probabilistic Signature Scheme (RSA-PSS) and returns the calculated signature.
RSAError will be raised if an error occurs.
See #verify_pss for the verification operation.
Parameters
digest |
A String containing the message digest algorithm name. |
data |
A String. The data to be signed. |
salt_length |
The length in octets of the salt. Two special values are reserved: :digest means the digest length, and :max means the maximum possible length for the combination of the private key and the selected message digest algorithm. |
mgf1_hash |
The hash algorithm used in MGF1 (the currently supported mask generation function (MGF)). |
Example
data = "Sign me!" pkey = OpenSSL::PKey::RSA.new(2048) signature = pkey.sign_pss("SHA256", data, salt_length: :max, mgf1_hash: "SHA256") pub_key = pkey.public_key puts pub_key.verify_pss("SHA256", signature, data, salt_length: :auto, mgf1_hash: "SHA256") # => true