Class: Ed25519::VerifyKey
- Inherits:
-
Object
- Object
- Ed25519::VerifyKey
- Defined in:
- lib/red25519/keys.rb
Instance Method Summary collapse
-
#initialize(string) ⇒ VerifyKey
constructor
A new instance of VerifyKey.
- #inspect ⇒ Object
- #to_bytes ⇒ Object (also: #to_s)
- #to_hex ⇒ Object
- #verify(signature, message) ⇒ Object
Constructor Details
#initialize(string) ⇒ VerifyKey
Returns a new instance of VerifyKey.
46 47 48 49 50 51 52 53 54 |
# File 'lib/red25519/keys.rb', line 46 def initialize(string) case string.length when 32 @key = string when 64 @key = [string].pack("H*") else raise ArgumentError, "seed must be 32 or 64 bytes long" end end |
Instance Method Details
#inspect ⇒ Object
60 61 62 |
# File 'lib/red25519/keys.rb', line 60 def inspect "#<Ed25519::VerifyKey:#{to_hex}>" end |
#to_bytes ⇒ Object Also known as: to_s
64 65 66 |
# File 'lib/red25519/keys.rb', line 64 def to_bytes @key end |
#to_hex ⇒ Object
69 70 71 |
# File 'lib/red25519/keys.rb', line 69 def to_hex to_bytes.unpack("H*").first end |