java.lang.Object
com.hedera.hashgraph.sdk.Key
Direct Known Subclasses:
ContractId, EvmAddress, KeyList, PrivateKey, PublicKey

public abstract class Key extends Object
A common base for the signing authority or key that entities in Hedera may have. See Hedera Documentation
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final org.bouncycastle.asn1.x9.X9ECParameters
     
    (package private) static final org.bouncycastle.crypto.params.ECDomainParameters
     
    (package private) static final org.bouncycastle.asn1.ASN1ObjectIdentifier
     
    (package private) static final org.bouncycastle.asn1.ASN1ObjectIdentifier
     
    (package private) static final org.bouncycastle.asn1.ASN1ObjectIdentifier
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Key()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Key
    fromBytes(byte[] bytes)
    Create Key from proto.Key byte array
    (package private) static Key
    Create a specific key type from the protobuf.
    byte[]
    Create the byte array.
    (package private) abstract Key
    Serialize this key as a protobuf object

    Methods inherited from class java.lang.Object

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

    • ID_ED25519

      static final org.bouncycastle.asn1.ASN1ObjectIdentifier ID_ED25519
    • ID_ECDSA_SECP256K1

      static final org.bouncycastle.asn1.ASN1ObjectIdentifier ID_ECDSA_SECP256K1
    • ID_EC_PUBLIC_KEY

      static final org.bouncycastle.asn1.ASN1ObjectIdentifier ID_EC_PUBLIC_KEY
    • ECDSA_SECP256K1_CURVE

      static final org.bouncycastle.asn1.x9.X9ECParameters ECDSA_SECP256K1_CURVE
    • ECDSA_SECP256K1_DOMAIN

      static final org.bouncycastle.crypto.params.ECDomainParameters ECDSA_SECP256K1_DOMAIN
  • Constructor Details

    • Key

      public Key()
  • Method Details

    • fromProtobufKey

      static Key fromProtobufKey(Key key)
      Create a specific key type from the protobuf.
      Parameters:
      key - the protobuf key of unknown type
      Returns:
      the differentiated key
    • toProtobufKey

      abstract Key toProtobufKey()
      Serialize this key as a protobuf object
    • toBytes

      public byte[] toBytes()
      Create the byte array.
      Returns:
      the byte array representation
    • fromBytes

      public static Key fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Create Key from proto.Key byte array
      Parameters:
      bytes -
      Returns:
      Key representation
      Throws:
      com.google.protobuf.InvalidProtocolBufferException