Class: Linzer::RSA::Key
Overview
RSA PKCS#1 v1.5 signing key implementation.
Uses the rsa-v1_5-sha256 algorithm identifier.
Instance Attribute Summary
Attributes inherited from Key
Instance Method Summary collapse
-
#sign(data) ⇒ String
Signs data using RSA PKCS#1 v1.5.
- #validate ⇒ Object private
-
#verify(signature, data) ⇒ Boolean
Verifies an RSA PKCS#1 v1.5 signature.
Methods inherited from Key
#initialize, #key_id, #private?, #public?
Constructor Details
This class inherits a constructor from Linzer::Key
Instance Method Details
#sign(data) ⇒ String
Signs data using RSA PKCS#1 v1.5.
39 40 41 42 |
# File 'lib/linzer/rsa.rb', line 39 def sign(data) validate_signing_key material.sign(@params[:digest], data) end |
#validate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 32 |
# File 'lib/linzer/rsa.rb', line 29 def validate super validate_digest end |
#verify(signature, data) ⇒ Boolean
Verifies an RSA PKCS#1 v1.5 signature.
50 51 52 53 |
# File 'lib/linzer/rsa.rb', line 50 def verify(signature, data) validate_verify_key material.verify(@params[:digest], signature, data) end |