Class Account

java.lang.Object
io.hotmoka.crypto.internal.EntropyImpl
io.hotmoka.crypto.internal.AbstractAccountImpl<R>
All Implemented Interfaces:
io.hotmoka.crypto.api.Account<StorageReference>, io.hotmoka.crypto.api.Entropy, Comparable<io.hotmoka.crypto.api.Entropy>

public class Account extends AbstractAccount<StorageReference>
The information to control an account of a Hotmoka node. One needs the entropy from which the key pair can be reconstructed and the storage reference of the account in the store of the node.
  • Field Summary

    Fields inherited from class io.hotmoka.crypto.internal.AbstractAccountImpl

    reference
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the information to control an account in a Hotmoka node.
    Account(StorageReference reference, String dir)
    Creates the information to control an account in a Hotmoka node.
    Account(io.hotmoka.crypto.api.Entropy entropy, byte[] reference)
    Creates the information to control an account in a Hotmoka node, from its entropy and from the byte representation of its storage reference.
    Account(io.hotmoka.crypto.api.Entropy entropy, StorageReference reference)
    Creates the information to control an account.
    Account(String reference)
    Creates the information to control an account in a Hotmoka node.
    Account(String reference, String dir)
    Creates the information to control an account in a Hotmoka node.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(io.hotmoka.crypto.api.Entropy other)
     
    byte[]
     

    Methods inherited from class io.hotmoka.crypto.internal.AbstractAccountImpl

    bip39Words, bip39Words, delete, dump, dump, equals, getReference, hashCode, toString

    Methods inherited from class io.hotmoka.crypto.internal.EntropyImpl

    delete, dump, dump, getEntropy, keys, length

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.hotmoka.crypto.api.Entropy

    delete, dump, dump, getEntropy, keys, length
  • Constructor Details

    • Account

      public Account(io.hotmoka.crypto.api.Entropy entropy, StorageReference reference)
      Creates the information to control an account.
      Parameters:
      entropy - the entropy, from which the key pair can be derived
      reference - the reference to the account. This is limited to have 0 as progressive, in order to reduce the information needed to represent an account as BIP39 words
    • Account

      public Account(StorageReference reference) throws IOException
      Creates the information to control an account in a Hotmoka node. The entropy of the account is recovered from its PEM file.
      Parameters:
      reference - the reference to the account. This is limited to have 0 as progressive, in order to reduce the information needed to represent an account as BIP39 words
      Throws:
      IOException - if the PEM file cannot be read
    • Account

      public Account(StorageReference reference, String dir) throws IOException
      Creates the information to control an account in a Hotmoka node. The entropy of the account is recovered from its PEM file.
      Parameters:
      reference - the reference to the account. This is limited to have 0 as progressive, in order to reduce the information needed to represent an account as BIP39 words
      dir - the directory where the PEM file must be looked for
      Throws:
      IOException - if the PEM file cannot be read
    • Account

      public Account(String reference) throws IOException
      Creates the information to control an account in a Hotmoka node. The entropy of the account is recovered from its PEM file.
      Parameters:
      reference - the reference to the account, as a string. This is limited to have 0 as progressive, in order to reduce the information needed to represent an account as BIP39 words
      Throws:
      IOException - if the PEM file cannot be read
    • Account

      public Account(String reference, String dir) throws IOException
      Creates the information to control an account in a Hotmoka node. The entropy of the account is recovered from its PEM file.
      Parameters:
      reference - the reference to the account, as a string. This is limited to have 0 as progressive, in order to reduce the information needed to represent an account as BIP39 words
      dir - the directory where the PEM file must be looked for
      Throws:
      IOException - if the PEM file cannot be read
    • Account

      public Account(io.hotmoka.crypto.api.Entropy entropy, byte[] reference)
      Creates the information to control an account in a Hotmoka node, from its entropy and from the byte representation of its storage reference.
      Parameters:
      entropy - the entropy
      reference - the byte representation of the reference
  • Method Details

    • compareTo

      public int compareTo(io.hotmoka.crypto.api.Entropy other)
      Specified by:
      compareTo in interface Comparable<io.hotmoka.crypto.api.Entropy>
      Overrides:
      compareTo in class io.hotmoka.crypto.internal.EntropyImpl
    • getReferenceAsBytes

      public byte[] getReferenceAsBytes()