Class: ECDSA::Signature
- Inherits:
-
Object
- Object
- ECDSA::Signature
- Defined in:
- lib/ecdsa/signature.rb
Overview
Instances of this class represents ECDSA signatures, which are simply a pair of integers named ‘r` and `s`.
Instance Attribute Summary collapse
- #r ⇒ Integer readonly
- #s ⇒ Integer readonly
Instance Method Summary collapse
-
#components ⇒ Array
Returns an array containing ‘r` first and `s` second.
-
#initialize(r, s) ⇒ Signature
constructor
A new instance of Signature.
Constructor Details
#initialize(r, s) ⇒ Signature
Returns a new instance of Signature.
13 14 15 16 17 |
# File 'lib/ecdsa/signature.rb', line 13 def initialize(r, s) @r, @s = r, s r.is_a?(Integer) or raise ArgumentError, 'r is not an integer.' s.is_a?(Integer) or raise ArgumentError, 's is not an integer.' end |
Instance Attribute Details
#r ⇒ Integer (readonly)
6 7 8 |
# File 'lib/ecdsa/signature.rb', line 6 def r @r end |
#s ⇒ Integer (readonly)
9 10 11 |
# File 'lib/ecdsa/signature.rb', line 9 def s @s end |
Instance Method Details
#components ⇒ Array
Returns an array containing ‘r` first and `s` second.
21 22 23 |
# File 'lib/ecdsa/signature.rb', line 21 def components [r, s] end |