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
-
#private? ⇒ Boolean
True if this key contains private key material.
-
#public? ⇒ Boolean
True if this key contains public key material.
-
#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
Constructor Details
This class inherits a constructor from Linzer::Key
Instance Method Details
#private? ⇒ Boolean
Returns true if this key contains private key material.
55 56 57 |
# File 'lib/linzer/ed25519.rb', line 55 def private? has_pem_private? end |
#public? ⇒ Boolean
Returns true if this key contains public key material.
50 51 52 |
# File 'lib/linzer/ed25519.rb', line 50 def public? has_pem_public? end |
#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 |