Class: Nostr::KeyPair
- Inherits:
-
Object
- Object
- Nostr::KeyPair
- Defined in:
- lib/nostr/key_pair.rb
Overview
A pair of public and private keys
Instance Attribute Summary collapse
-
#private_key ⇒ String
readonly
32-bytes hex-encoded private key.
-
#public_key ⇒ String
readonly
32-bytes hex-encoded public key.
Instance Method Summary collapse
-
#initialize(private_key:, public_key:) ⇒ KeyPair
constructor
Instantiates a key pair.
Constructor Details
#initialize(private_key:, public_key:) ⇒ KeyPair
Instantiates a key pair
41 42 43 44 |
# File 'lib/nostr/key_pair.rb', line 41 def initialize(private_key:, public_key:) @private_key = private_key @public_key = public_key end |
Instance Attribute Details
#private_key ⇒ String (readonly)
32-bytes hex-encoded private key
15 16 17 |
# File 'lib/nostr/key_pair.rb', line 15 def private_key @private_key end |
#public_key ⇒ String (readonly)
32-bytes hex-encoded public key
26 27 28 |
# File 'lib/nostr/key_pair.rb', line 26 def public_key @public_key end |