Class LiveHash

java.lang.Object
com.hedera.hashgraph.sdk.LiveHash

public class LiveHash extends Object
A hash (presumably of some kind of credential or certificate), along with a list of keys (each of which is either a primitive or a threshold key). Each of them must reach its threshold when signing the transaction, to attach this livehash to this account. At least one of them must reach its threshold to delete this livehash from this account. See Hedera Documentation
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final AccountId
    The account to which the livehash is attached
    final Duration
    The duration for which the livehash will remain valid
    final com.google.protobuf.ByteString
    The SHA-384 hash of a credential or certificate
    final KeyList
    A list of keys (primitive or threshold), all of which must sign to attach the livehash to an account, and any one of which can later delete it.
  • Method Summary

    Modifier and Type
    Method
    Description
    static LiveHash
    fromBytes(byte[] bytes)
    Create a live hash from a byte array.
    protected static LiveHash
    Create a live hash from a protobuf.
    com.google.protobuf.ByteString
    Extract the byte array.
    protected LiveHash
    Convert the live hash into a protobuf.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • accountId

      public final AccountId accountId
      The account to which the livehash is attached
    • hash

      public final com.google.protobuf.ByteString hash
      The SHA-384 hash of a credential or certificate
    • keys

      public final KeyList keys
      A list of keys (primitive or threshold), all of which must sign to attach the livehash to an account, and any one of which can later delete it.
    • duration

      public final Duration duration
      The duration for which the livehash will remain valid
  • Method Details

    • fromProtobuf

      protected static LiveHash fromProtobuf(LiveHash liveHash)
      Create a live hash from a protobuf.
      Parameters:
      liveHash - the protobuf
      Returns:
      the new live hash
    • fromBytes

      public static LiveHash fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Create a live hash from a byte array.
      Parameters:
      bytes - the byte array
      Returns:
      the new live hash
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      protected LiveHash toProtobuf()
      Convert the live hash into a protobuf.
      Returns:
      the protobuf
    • toBytes

      public com.google.protobuf.ByteString toBytes()
      Extract the byte array.
      Returns:
      the byte array representation
    • toString

      public String toString()
      Overrides:
      toString in class Object