lib/cose/algorithm/ecdsa.rb in cose-0.11.0 vs lib/cose/algorithm/ecdsa.rb in cose-1.0.0
- old
+ new
@@ -17,9 +17,15 @@
@hash_function = hash_function
end
private
+ def valid_key?(key)
+ cose_key = to_cose_key(key)
+
+ cose_key.is_a?(COSE::Key::EC2) && (!cose_key.alg || cose_key.alg == id)
+ end
+
def signature_algorithm_class
OpenSSL::SignatureAlgorithm::ECDSA
end
def to_pkey(key)