Class: Linzer::Ed25519::Key
Overview
Ed25519 signing key implementation.
Ed25519 keys can be used for both signing (with private key) and verification (with public key). The algorithm identifier is ‘ed25519`.
Instance Attribute Summary
Attributes inherited from Key
Instance Method Summary collapse
-
#sign(data) ⇒ String
Signs data using the Ed25519 private key.
-
#verify(signature, data) ⇒ Boolean
Verifies a signature using the Ed25519 public key.
Methods inherited from Key
#initialize, #key_id, #private?, #public?
Constructor Details
This class inherits a constructor from Linzer::Key
Instance Method Details
#sign(data) ⇒ String
Signs data using the Ed25519 private key.
33 34 35 36 |
# File 'lib/linzer/ed25519.rb', line 33 def sign(data) validate_signing_key material.sign(nil, data) end |
#verify(signature, data) ⇒ Boolean
Verifies a signature using the Ed25519 public key.
44 45 46 47 |
# File 'lib/linzer/ed25519.rb', line 44 def verify(signature, data) validate_verify_key material.verify(nil, signature, data) end |