Class: Linzer::RSA::Key
- Inherits:
-
Key
- Object
- Key
- Linzer::RSA::Key
- Defined in:
- lib/linzer/rsa.rb
Overview
RSA PKCS#1 v1.5 signing key implementation.
Uses the rsa-v1_5-sha256 algorithm identifier.
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.
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 |