java.lang.Object
com.google.protobuf.AbstractMessageLite<Key,Key.Builder>
com.google.protobuf.GeneratedMessageLite<Key,Key.Builder>
com.hedera.hashgraph.sdk.proto.Key
All Implemented Interfaces:
com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, KeyOrBuilder

@Generated public final class Key extends com.google.protobuf.GeneratedMessageLite<Key,Key.Builder> implements KeyOrBuilder
 *
 A Key is an entity representing one or more cryptographic public/private key
 pairs and, optionally, the structure for how multiple signatures may be
 composed to meet complex multiple-signature authorization requirements.

 A Key can be a public key from either the Ed25519 or ECDSA(secp256k1)
 signature schemes. In the ECDSA(secp256k1) case we require the 33-byte
 compressed form of the public key. For simplicity, we call these
 cryptographic public keys `primitive` keys.<br/>
 If an entity has a primitive key associated to it, then the corresponding
 private key must sign any transaction to send tokens or perform other
 actions requiring authorization.

 A Key can also be the ID of a smart contract, which SHALL authorize that
 contract to execute any system contract with signing requirements that are
 met by the key.<br/>
 > Example
 >> If account `0.0.A` has a threshold key whose threshold is satisfied
 >> by a contract ID key for contract `0.0.C`, then when `0.0.C` is called,
 >> it is authorized to use system contracts to manage any asset owned by
 >> `0.0.A`. If the contract ID key is "delegatable", then `0.0.C` can even
 >> perform these actions when running code accessed via `DELEGATECALL`.

 A Key can be a "threshold key", which is a list of N keys, any M of which
 may sign in order for the signature to be considered valid. The value of
 M for a given threshold key MUST be less than or equal to N. A threshold
 key is sometimes called a "M-of-N" key.

 A Key can be a "key list" where all keys in the list must sign unless
 specified otherwise in the documentation for a specific transaction
 type (e.g. FileDeleteTransactionBody).<br/>
 This implies that the use of a key list is dependent on context. For
 example, an Hedera file that is created with a list of keys, SHALL require
 that all of those keys must sign a transaction to create or modify the file,
 but only one key from that list MUST sign a transaction to delete the file.
 So it is a single list that sometimes acts as a N-of-N threshold key, and
 sometimes acts as a 1-of-N threshold key.<br/>
 To reduce confusion this may cause, a key list SHALL always be considered
 N-of-N, unless specified otherwise in official documentation.<br/>
 A key list MAY have repeated primitive public keys, but the signature
 requirement for all keys in a repeated set SHALL be satisfied by a single
 valid signature. There is no mechanism to require a single key to sign a
 single transaction more than once.

 Any list or threshold key MAY have nested key lists or threshold keys.
 This allows, for example, the keys within a threshold signature to
 themselves be threshold, list, contract, or primitive keys. This nesting
 structure enables complex asymmetric multi-party signature requirements to
 be met.

 To ensure adequate performance and transaction security, key nesting is
 limited to at most fifteen(15) levels.
 
Protobuf type proto.Key
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    * A Key is an entity representing one or more cryptographic public/private key pairs and, optionally, the structure for how multiple signatures may be composed to meet complex multiple-signature authorization requirements.
    static enum 
     

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite

    com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite,Type>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
     
    * A smart contract instance that is authorized implicitly.
    static Key
     
    * A smart contract that, if the recipient of the active message frame, SHALL be imputed authorization.<br/> Setting this key type is a more permissive version of setting a contractID key.
    com.google.protobuf.ByteString
    Deprecated.
    proto.Key.ECDSA_384 is deprecated.
    com.google.protobuf.ByteString
    * A set of compressed ECDSA(secp256k1) public key bytes.<br/> This is an EVM compatibility format.
    com.google.protobuf.ByteString
    * An array of Ed25519 public key bytes.
     
    * A list of keys.
    com.google.protobuf.ByteString
    Deprecated.
    proto.Key.RSA_3072 is deprecated.
    * A threshold, M, combined with a list of N keys, any M of which are sufficient to form a valid signature.
    boolean
    * A smart contract instance that is authorized implicitly.
    boolean
    * A smart contract that, if the recipient of the active message frame, SHALL be imputed authorization.<br/> Setting this key type is a more permissive version of setting a contractID key.
    boolean
    Deprecated.
    proto.Key.ECDSA_384 is deprecated.
    boolean
    * A set of compressed ECDSA(secp256k1) public key bytes.<br/> This is an EVM compatibility format.
    boolean
    * An array of Ed25519 public key bytes.
    boolean
    * A list of keys.
    boolean
    Deprecated.
    proto.Key.RSA_3072 is deprecated.
    boolean
    * A threshold, M, combined with a list of N keys, any M of which are sufficient to form a valid signature.
     
    newBuilder(Key prototype)
     
    static Key
     
    static Key
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Key
    parseFrom(byte[] data)
     
    static Key
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Key
    parseFrom(com.google.protobuf.ByteString data)
     
    static Key
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Key
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static Key
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Key
     
    static Key
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static Key
     
    static Key
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<Key>
     

    Methods inherited from class com.google.protobuf.GeneratedMessageLite

    createBuilder, createBuilder, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

    • CONTRACTID_FIELD_NUMBER

      public static final int CONTRACTID_FIELD_NUMBER
      See Also:
    • ED25519_FIELD_NUMBER

      public static final int ED25519_FIELD_NUMBER
      See Also:
    • RSA_3072_FIELD_NUMBER

      public static final int RSA_3072_FIELD_NUMBER
      See Also:
    • ECDSA_384_FIELD_NUMBER

      public static final int ECDSA_384_FIELD_NUMBER
      See Also:
    • THRESHOLDKEY_FIELD_NUMBER

      public static final int THRESHOLDKEY_FIELD_NUMBER
      See Also:
    • KEYLIST_FIELD_NUMBER

      public static final int KEYLIST_FIELD_NUMBER
      See Also:
    • ECDSA_SECP256K1_FIELD_NUMBER

      public static final int ECDSA_SECP256K1_FIELD_NUMBER
      See Also:
    • DELEGATABLE_CONTRACT_ID_FIELD_NUMBER

      public static final int DELEGATABLE_CONTRACT_ID_FIELD_NUMBER
      See Also:
  • Method Details

    • getKeyCase

      public Key.KeyCase getKeyCase()
      Specified by:
      getKeyCase in interface KeyOrBuilder
    • hasContractID

      public boolean hasContractID()
       *
       A smart contract instance that is authorized implicitly.
       <p>
       This key type SHALL require that the code in the active message frame
       belong to the contract with the given id.
       
      .proto.ContractID contractID = 1;
      Specified by:
      hasContractID in interface KeyOrBuilder
      Returns:
      Whether the contractID field is set.
    • getContractID

      public ContractID getContractID()
       *
       A smart contract instance that is authorized implicitly.
       <p>
       This key type SHALL require that the code in the active message frame
       belong to the contract with the given id.
       
      .proto.ContractID contractID = 1;
      Specified by:
      getContractID in interface KeyOrBuilder
      Returns:
      The contractID.
    • hasEd25519

      public boolean hasEd25519()
       *
       An array of Ed25519 public key bytes.
       
      bytes ed25519 = 2;
      Specified by:
      hasEd25519 in interface KeyOrBuilder
      Returns:
      Whether the ed25519 field is set.
    • getEd25519

      public com.google.protobuf.ByteString getEd25519()
       *
       An array of Ed25519 public key bytes.
       
      bytes ed25519 = 2;
      Specified by:
      getEd25519 in interface KeyOrBuilder
      Returns:
      The ed25519.
    • hasRSA3072

      @Deprecated public boolean hasRSA3072()
      Deprecated.
      proto.Key.RSA_3072 is deprecated. See basic_types.proto;l=1068
       *
       This option is not currently supported.<br/>
       An array of RSA-3072 public key bytes.
       
      bytes RSA_3072 = 3 [deprecated = true];
      Specified by:
      hasRSA3072 in interface KeyOrBuilder
      Returns:
      Whether the rSA3072 field is set.
    • getRSA3072

      @Deprecated public com.google.protobuf.ByteString getRSA3072()
      Deprecated.
      proto.Key.RSA_3072 is deprecated. See basic_types.proto;l=1068
       *
       This option is not currently supported.<br/>
       An array of RSA-3072 public key bytes.
       
      bytes RSA_3072 = 3 [deprecated = true];
      Specified by:
      getRSA3072 in interface KeyOrBuilder
      Returns:
      The rSA3072.
    • hasECDSA384

      @Deprecated public boolean hasECDSA384()
      Deprecated.
      proto.Key.ECDSA_384 is deprecated. See basic_types.proto;l=1074
       *
       This option is not currently supported.<br/>
       An array of ECDSA, using the p-384 curve, public key bytes.
       
      bytes ECDSA_384 = 4 [deprecated = true];
      Specified by:
      hasECDSA384 in interface KeyOrBuilder
      Returns:
      Whether the eCDSA384 field is set.
    • getECDSA384

      @Deprecated public com.google.protobuf.ByteString getECDSA384()
      Deprecated.
      proto.Key.ECDSA_384 is deprecated. See basic_types.proto;l=1074
       *
       This option is not currently supported.<br/>
       An array of ECDSA, using the p-384 curve, public key bytes.
       
      bytes ECDSA_384 = 4 [deprecated = true];
      Specified by:
      getECDSA384 in interface KeyOrBuilder
      Returns:
      The eCDSA384.
    • hasThresholdKey

      public boolean hasThresholdKey()
       *
       A threshold, M, combined with a list of N keys, any M of which are
       sufficient to form a valid signature.
       
      .proto.ThresholdKey thresholdKey = 5;
      Specified by:
      hasThresholdKey in interface KeyOrBuilder
      Returns:
      Whether the thresholdKey field is set.
    • getThresholdKey

      public ThresholdKey getThresholdKey()
       *
       A threshold, M, combined with a list of N keys, any M of which are
       sufficient to form a valid signature.
       
      .proto.ThresholdKey thresholdKey = 5;
      Specified by:
      getThresholdKey in interface KeyOrBuilder
      Returns:
      The thresholdKey.
    • hasKeyList

      public boolean hasKeyList()
       *
       A list of keys. This may be treated like a "N-of-N" threshold key,
       as a component of another key, or in some other manner as documented.
       
      .proto.KeyList keyList = 6;
      Specified by:
      hasKeyList in interface KeyOrBuilder
      Returns:
      Whether the keyList field is set.
    • getKeyList

      public KeyList getKeyList()
       *
       A list of keys. This may be treated like a "N-of-N" threshold key,
       as a component of another key, or in some other manner as documented.
       
      .proto.KeyList keyList = 6;
      Specified by:
      getKeyList in interface KeyOrBuilder
      Returns:
      The keyList.
    • hasECDSASecp256K1

      public boolean hasECDSASecp256K1()
       *
       A set of compressed ECDSA(secp256k1) public key bytes.<br/>
       This is an EVM compatibility format.
       
      bytes ECDSA_secp256k1 = 7;
      Specified by:
      hasECDSASecp256K1 in interface KeyOrBuilder
      Returns:
      Whether the eCDSASecp256k1 field is set.
    • getECDSASecp256K1

      public com.google.protobuf.ByteString getECDSASecp256K1()
       *
       A set of compressed ECDSA(secp256k1) public key bytes.<br/>
       This is an EVM compatibility format.
       
      bytes ECDSA_secp256k1 = 7;
      Specified by:
      getECDSASecp256K1 in interface KeyOrBuilder
      Returns:
      The eCDSASecp256k1.
    • hasDelegatableContractId

      public boolean hasDelegatableContractId()
       *
       A smart contract that, if the recipient of the active message frame,
       SHALL be imputed authorization.<br/>
       Setting this key type is a more permissive version of setting a
       contractID key.
       <p>
       This key form SHALL NOT strictly require that the code being executed
       in the frame belong to the given contract. The code in frame MAY be
       running another contract via a `delegatecall`.
       
      .proto.ContractID delegatable_contract_id = 8;
      Specified by:
      hasDelegatableContractId in interface KeyOrBuilder
      Returns:
      Whether the delegatableContractId field is set.
    • getDelegatableContractId

      public ContractID getDelegatableContractId()
       *
       A smart contract that, if the recipient of the active message frame,
       SHALL be imputed authorization.<br/>
       Setting this key type is a more permissive version of setting a
       contractID key.
       <p>
       This key form SHALL NOT strictly require that the code being executed
       in the frame belong to the given contract. The code in frame MAY be
       running another contract via a `delegatecall`.
       
      .proto.ContractID delegatable_contract_id = 8;
      Specified by:
      getDelegatableContractId in interface KeyOrBuilder
      Returns:
      The delegatableContractId.
    • parseFrom

      public static Key parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Key parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Key parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Key parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Key parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Key parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static Key parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Key parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Key parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static Key parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Key parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static Key parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilder

      public static Key.Builder newBuilder()
    • newBuilder

      public static Key.Builder newBuilder(Key prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<Key,Key.Builder>
    • getDefaultInstance

      public static Key getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Key> parser()