Package org.moera.lib.crypto
Record Class MnemonicKey
java.lang.Object
java.lang.Record
org.moera.lib.crypto.MnemonicKey
Represents a cryptographic key derived from a mnemonic phrase.
This class is designed to store a secret, a mnemonic phrase, and the associated public key.
The mnemonic phrase is used as a human-readable representation of a cryptographic seed, which can be securely stored or transferred. The public key is derived from this key material and can be used in cryptographic operations.
Fields:
- secret
: The secret key material associated with the mnemonic.
- mnemonic
: The mnemonic phrase used as a human-friendly representation of the secret.
- publicKey
: The elliptic curve public key generated from the secret.
-
Constructor Summary
ConstructorsConstructorDescriptionMnemonicKey
(String secret, String mnemonic, ECPublicKey publicKey) Creates an instance of aMnemonicKey
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.mnemonic()
Returns the value of themnemonic
record component.Returns the value of thepublicKey
record component.secret()
Returns the value of thesecret
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MnemonicKey
Creates an instance of aMnemonicKey
record class.- Parameters:
secret
- the value for thesecret
record componentmnemonic
- the value for themnemonic
record componentpublicKey
- the value for thepublicKey
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
secret
Returns the value of thesecret
record component.- Returns:
- the value of the
secret
record component
-
mnemonic
Returns the value of themnemonic
record component.- Returns:
- the value of the
mnemonic
record component
-
publicKey
Returns the value of thepublicKey
record component.- Returns:
- the value of the
publicKey
record component
-