Class: COSE::Algorithm::SignatureAlgorithm
- Inherits:
-
Base
- Object
- Base
- COSE::Algorithm::SignatureAlgorithm
show all
- Defined in:
- lib/cose/algorithm/signature_algorithm.rb
Instance Attribute Summary
Attributes inherited from Base
#id, #name
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#compatible_key?(key) ⇒ Boolean
14
15
16
17
18
|
# File 'lib/cose/algorithm/signature_algorithm.rb', line 14
def compatible_key?(key)
valid_key?(key) && to_pkey(key)
rescue COSE::Error
false
end
|
#verify(key, signature, verification_data) ⇒ Object
9
10
11
12
|
# File 'lib/cose/algorithm/signature_algorithm.rb', line 9
def verify(key, signature, verification_data)
compatible_key?(key) || raise(COSE::Error, "Incompatible key for signature verification")
valid_signature?(key, signature, verification_data) || raise(COSE::Error, "Signature verification failed")
end
|