Class: Net::HTTP::MessageSignatures::RSAPSSSHA512
- Inherits:
-
SignatureAlgorithm
- Object
- SignatureAlgorithm
- Net::HTTP::MessageSignatures::RSAPSSSHA512
- Defined in:
- lib/net/http/message_signatures/rsa_pss_sha512.rb
Overview
Implementation of the signature algorithm, RSASSA-PSS using SHA-512.
Instance Attribute Summary collapse
-
#key ⇒ OpenSSL::PKey::RSA
writeonly
Key material.
Instance Method Summary collapse
-
#initialize(key: nil) ⇒ RSAPSSSHA512
constructor
A new instance of RSAPSSSHA512.
- #sign(message) ⇒ Object
- #verify(message, signature) ⇒ Object
Constructor Details
#initialize(key: nil) ⇒ RSAPSSSHA512
Returns a new instance of RSAPSSSHA512.
19 20 21 22 |
# File 'lib/net/http/message_signatures/rsa_pss_sha512.rb', line 19 def initialize(key: nil) super() @key = key end |
Instance Attribute Details
#key=(value) ⇒ OpenSSL::PKey::RSA
Returns key material.
16 17 18 |
# File 'lib/net/http/message_signatures/rsa_pss_sha512.rb', line 16 def key=(value) @key = value end |
Instance Method Details
#sign(message) ⇒ Object
24 25 26 27 |
# File 'lib/net/http/message_signatures/rsa_pss_sha512.rb', line 24 def sign() ensure_key! key.sign_pss('SHA512', , salt_length: 64, mgf1_hash: 'SHA512') end |
#verify(message, signature) ⇒ Object
29 30 31 32 |
# File 'lib/net/http/message_signatures/rsa_pss_sha512.rb', line 29 def verify(, signature) ensure_key! key.verify_pss('SHA512', signature, , salt_length: 64, mgf1_hash: 'SHA512') end |