NostrKeys class

This class is responsible for generating key pairs and deriving public keys from private keys..

Constructors

NostrKeys.new({required NostrLogger logger})

Properties

hashCode int
The hash code for this object.
no setterinherited
logger NostrLogger
General utils to be used in a whole Nostr instance.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

derivePublicKey({required String privateKey}) String
Derives a public key from a privateKey directly, use this if you want a quick way to get a public key from a private key.
freeAllResources() Future<bool>
Clears all the cached key pairs.
generateKeyPair() NostrKeyPairs
You can use this method to generate a key pair for your end users.
generateKeyPairFromExistingPrivateKey(String privateKey) NostrKeyPairs
Generates a key pair from an existing privateKey, use this if you want to generate a key pair from an existing private key.
generatePrivateKey() String
You can use this method to generate a key pair for your end users. it returns the private key of the generated key pair.
isValidPrivateKey(String key) bool
Weither the key is a valid Nostr private key or not.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign({required String privateKey, required String message}) String
You can use this method to sign a message with a privateKey.
toString() String
A string representation of this object.
inherited
verify({required String publicKey, required String message, required String signature}) bool
You can use this method to verify a message with a publicKey and it's signature. it returns a bool that indicates if the message is verified or not.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getPrivateKeyFromMnemonic(String mnemonic) String
Derives a private key from a mnemonic directly, use this if you want a quick way to get a private key from a mnemonic.
isMnemonicValid(String text) bool
Wether the given text is a valid mnemonic or not.