Interface KeyPairService

    • Method Detail

      • generateSeed

        String generateSeed()
        Generate a random 16 byte seed to be used to derive a private key.
        Returns:
        A String containing a randomly generated Base58Check encoded seed value.
      • generateSeed

        String generateSeed​(UnsignedByteArray entropy)
        Generate a 16 byte seed, which can be used to derive a private key, from a non-encoded value.
        Parameters:
        entropy - An UnsignedByteArray containing the bytes of entropy to encode into a seed.
        Returns:
        A String containing the Base58Check encoded seed value.
      • deriveKeyPair

        KeyPair deriveKeyPair​(String seed)
        Derive a public/private keypair from a Base58Check encoded 16 byte seed.
        Parameters:
        seed - A Base58Check encoded String containing the seed.
        Returns:
        The KeyPair derived from the seed.
      • sign

        String sign​(UnsignedByteArray message,
                    String privateKey)
        Sign a message using the given private key.
        Parameters:
        message - An UnsignedByteArray with an arbitrary message.
        privateKey - The hexadecimal encoded private key used to sign the transaction.
        Returns:
        The signed message, in hexadecimal form.
      • sign

        String sign​(String message,
                    String privateKey)
        Sign a message using the given private key.
        Parameters:
        message - A hexadecimal encoded String containing an arbitrary message.
        privateKey - The hexadecimal encoded private key used to sign the transaction.
        Returns:
        The signed message, in hexadecimal form.
      • verify

        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.
        Parameters:
        message - The arbitrary message that was signed with a private key.
        signature - The hexadecimal encoded String 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.
      • verify

        boolean verify​(String message,
                       String signature,
                       String publicKey)
        Verify that the signature is valid, based on the message that was signed and the public key.
        Parameters:
        message - The hexadecimal encoded arbitrary message that was signed with a private key.
        signature - The hexadecimal encoded String 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.
      • deriveAddress

        Address deriveAddress​(String publicKey)
        Derive an XRPL address from a public key.
        Parameters:
        publicKey - The hexadecimal encoded public key of the account.
        Returns:
        A Base58Check encoded XRPL address in Classic Address form.
      • deriveAddress

        Address deriveAddress​(UnsignedByteArray publicKey)
        Derive an XRPL address from a public key.
        Parameters:
        publicKey - The public key of the account.
        Returns:
        A Base58Check encoded XRPL address in Classic Address form.