Class: COSE::Algorithm::ECDSA

Inherits:
SignatureAlgorithm show all
Defined in:
lib/cose/algorithm/ecdsa.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#id, #name

Instance Method Summary collapse

Methods inherited from SignatureAlgorithm

#compatible_key?, #verify

Constructor Details

#initialize(*args, hash_function:, curve_name:) ⇒ ECDSA

Returns a new instance of ECDSA.



15
16
17
18
19
20
# File 'lib/cose/algorithm/ecdsa.rb', line 15

def initialize(*args, hash_function:, curve_name:)
  super(*args)

  @hash_function = hash_function
  @curve = COSE::Key::Curve.by_name(curve_name) || raise("Couldn't find curve with name='#{curve_name}'")
end

Instance Attribute Details

#curveObject (readonly)

Returns the value of attribute curve.



13
14
15
# File 'lib/cose/algorithm/ecdsa.rb', line 13

def curve
  @curve
end

#hash_functionObject (readonly)

Returns the value of attribute hash_function.



13
14
15
# File 'lib/cose/algorithm/ecdsa.rb', line 13

def hash_function
  @hash_function
end