Class AccountKeyPublic

  • All Implemented Interfaces:
    IAccountKey

    public class AccountKeyPublic
    extends java.lang.Object
    implements IAccountKey
    AccountKeyPublic is used for accounts having one public key. If an account has an AccountKeyPublic object, the tx validation process is done like below: Get the public key derived from ecrecover(txhash, txsig) Check that the derived public key is the same as the corresponding account's public key
    • Constructor Summary

      Constructors 
      Constructor Description
      AccountKeyPublic​(java.lang.String publicKey)
      Creates an AccountKeyPublic instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static AccountKeyPublic decode​(byte[] rlpEncodedKey)
      Decodes a RLP-encoded AccountKeyPublic byte array
      static AccountKeyPublic decode​(java.lang.String rlpEncodedKey)
      Decodes a RLP-encoded AccountKeyPublic string
      static AccountKeyPublic fromPublicKey​(java.lang.String publicKey)
      Creates AccountKeyPublic instance from ECC Public Key.
      static AccountKeyPublic fromXYPoint​(java.lang.String x, java.lang.String y)
      Creates AccountKeyPublic instance from Elliptic curve x, y coordinates.
      java.lang.String getPublicKey()
      Getter function for publicKey
      java.lang.String getRLPEncoding()
      Encodes a AccountKeyPublic Object by RLP-encoding method.
      static java.lang.String getType()
      Returns an AccountKeyPublic's type attribute
      java.lang.String[] getXYPoint()
      Returns the x and y coordinates of publicKey.
      void setPublicKey​(java.lang.String publicKey)
      Setter function for publicKey
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AccountKeyPublic

        public AccountKeyPublic​(java.lang.String publicKey)
        Creates an AccountKeyPublic instance.
        Parameters:
        publicKey - ECC public key. (Uncompress or compress format)
    • Method Detail

      • fromXYPoint

        public static AccountKeyPublic fromXYPoint​(java.lang.String x,
                                                   java.lang.String y)
        Creates AccountKeyPublic instance from Elliptic curve x, y coordinates.
        Parameters:
        x - The point x
        y - The point y
        Returns:
        AccountKeyPublic
      • fromPublicKey

        public static AccountKeyPublic fromPublicKey​(java.lang.String publicKey)
        Creates AccountKeyPublic instance from ECC Public Key.
        Parameters:
        publicKey - The public key string. This public key can be in format of compressed or uncompressed.
        Returns:
        AccountKeyPublic
      • decode

        public static AccountKeyPublic decode​(java.lang.String rlpEncodedKey)
        Decodes a RLP-encoded AccountKeyPublic string
        Parameters:
        rlpEncodedKey - RLP-encoded AccountKeyPublic string.
        Returns:
        AccountKeyPublic
      • decode

        public static AccountKeyPublic decode​(byte[] rlpEncodedKey)
        Decodes a RLP-encoded AccountKeyPublic byte array
        Parameters:
        rlpEncodedKey - RLP-encoded AccountKeyPublic byte array
        Returns:
        AccountKeyPublic
      • getRLPEncoding

        public java.lang.String getRLPEncoding()
        Encodes a AccountKeyPublic Object by RLP-encoding method.
        Specified by:
        getRLPEncoding in interface IAccountKey
        Returns:
        RLP-encoded AccountKeyPublic String
      • getXYPoint

        public java.lang.String[] getXYPoint()
        Returns the x and y coordinates of publicKey.
        Returns:
        String array of X,Y coordinates.
      • getPublicKey

        public java.lang.String getPublicKey()
        Getter function for publicKey
        Returns:
        ECC PublicKey string
      • getType

        public static java.lang.String getType()
        Returns an AccountKeyPublic's type attribute
        Returns:
        AccountKeyPublic's type attribute
      • setPublicKey

        public void setPublicKey​(java.lang.String publicKey)
        Setter function for publicKey
        Parameters:
        publicKey - ECC public key(compressed or uncompressed format)