Package org.xrpl.xrpl4j.keypairs
Class Ed25519KeyPairService
java.lang.Object
org.xrpl.xrpl4j.keypairs.AbstractKeyPairService
org.xrpl.xrpl4j.keypairs.Ed25519KeyPairService
- All Implemented Interfaces:
KeyPairService
Implementation of
KeyPairService
which uses the ED25519 algorithm to derive keys and sign/verify
signatures.-
Field Summary
Fields inherited from class org.xrpl.xrpl4j.keypairs.AbstractKeyPairService
addressCodec, signer
-
Method Summary
Modifier and TypeMethodDescriptionderiveKeyPair
(String seed) Derive a public/private keypair from a Base58Check encoded 16 byte seed.generateSeed
(UnsignedByteArray entropy) Generate a 16 byte seed, which can be used to derive a private key, from a non-encoded value.static Ed25519KeyPairService
sign
(UnsignedByteArray message, String privateKey) Sign a message using the given private key.boolean
verify
(UnsignedByteArray message, String signature, String publicKey) Verify that the signature is valid, based on the message that was signed and the public key.Methods inherited from class org.xrpl.xrpl4j.keypairs.AbstractKeyPairService
deriveAddress, deriveAddress, generateSeed, sign, verify
-
Method Details
-
getInstance
-
generateSeed
Description copied from interface:KeyPairService
Generate a 16 byte seed, which can be used to derive a private key, from a non-encoded value.- Parameters:
entropy
- AnUnsignedByteArray
containing the bytes of entropy to encode into a seed.- Returns:
- A
String
containing the Base58Check encoded seed value.
-
deriveKeyPair
Description copied from interface:KeyPairService
Derive a public/private keypair from a Base58Check encoded 16 byte seed. -
sign
Description copied from interface:KeyPairService
Sign a message using the given private key.- Parameters:
message
- AnUnsignedByteArray
with an arbitrary message.privateKey
- The hexadecimal encoded private key used to sign the transaction.- Returns:
- The signed message, in hexadecimal form.
-
verify
Description copied from interface:KeyPairService
Verify that the signature is valid, based on the message that was signed and the public key.- Parameters:
message
- The arbitrary message that was signed with a private key.signature
- The hexadecimal encodedString
containing the signature to verify.publicKey
- The hexadecimal encoded public key derived from the private key that was used to sign the message.- Returns:
- true if the signature is valid, false if not.
-