Class Key.Builder

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

public static final class Key.Builder extends com.google.protobuf.GeneratedMessageLite.Builder<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
  • Field Summary

    Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    instance
  • Method Summary

    Modifier and Type
    Method
    Description
    * A smart contract instance that is authorized implicitly.
    * 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.
    Deprecated.
    proto.Key.ECDSA_384 is deprecated.
    * A set of compressed ECDSA(secp256k1) public key bytes.<br/> This is an EVM compatibility format.
    * An array of Ed25519 public key bytes.
     
    * A list of keys.
    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.
    * A smart contract instance that is authorized implicitly.
    * 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.
    * A smart contract instance that is authorized implicitly.
    * 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.
    * A list of keys.
    * A threshold, M, combined with a list of N keys, any M of which are sufficient to form a valid signature.
    * A smart contract instance that is authorized implicitly.
    * A smart contract instance that is authorized implicitly.
    * 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.
    * 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.
    setECDSA384(com.google.protobuf.ByteString value)
    Deprecated.
    proto.Key.ECDSA_384 is deprecated.
    setECDSASecp256K1(com.google.protobuf.ByteString value)
    * A set of compressed ECDSA(secp256k1) public key bytes.<br/> This is an EVM compatibility format.
    setEd25519(com.google.protobuf.ByteString value)
    * An array of Ed25519 public key bytes.
    * A list of keys.
    setKeyList(KeyList.Builder builderForValue)
    * A list of keys.
    setRSA3072(com.google.protobuf.ByteString value)
    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.
    * A threshold, M, combined with a list of N keys, any M of which are sufficient to form a valid signature.

    Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder

    build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Method Details

    • getKeyCase

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

      public Key.Builder clearKey()
    • 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.
    • setContractID

      public Key.Builder setContractID(ContractID value)
       *
       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;
    • setContractID

      public Key.Builder setContractID(ContractID.Builder builderForValue)
       *
       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;
    • mergeContractID

      public Key.Builder mergeContractID(ContractID value)
       *
       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;
    • clearContractID

      public Key.Builder clearContractID()
       *
       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;
    • 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.
    • setEd25519

      public Key.Builder setEd25519(com.google.protobuf.ByteString value)
       *
       An array of Ed25519 public key bytes.
       
      bytes ed25519 = 2;
      Parameters:
      value - The ed25519 to set.
      Returns:
      This builder for chaining.
    • clearEd25519

      public Key.Builder clearEd25519()
       *
       An array of Ed25519 public key bytes.
       
      bytes ed25519 = 2;
      Returns:
      This builder for chaining.
    • 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.
    • setRSA3072

      @Deprecated public Key.Builder setRSA3072(com.google.protobuf.ByteString value)
      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];
      Parameters:
      value - The rSA3072 to set.
      Returns:
      This builder for chaining.
    • clearRSA3072

      @Deprecated public Key.Builder clearRSA3072()
      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];
      Returns:
      This builder for chaining.
    • 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.
    • setECDSA384

      @Deprecated public Key.Builder setECDSA384(com.google.protobuf.ByteString value)
      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];
      Parameters:
      value - The eCDSA384 to set.
      Returns:
      This builder for chaining.
    • clearECDSA384

      @Deprecated public Key.Builder clearECDSA384()
      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];
      Returns:
      This builder for chaining.
    • 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.
    • setThresholdKey

      public Key.Builder setThresholdKey(ThresholdKey value)
       *
       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;
    • setThresholdKey

      public Key.Builder setThresholdKey(ThresholdKey.Builder builderForValue)
       *
       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;
    • mergeThresholdKey

      public Key.Builder mergeThresholdKey(ThresholdKey value)
       *
       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;
    • clearThresholdKey

      public Key.Builder clearThresholdKey()
       *
       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;
    • 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.
    • setKeyList

      public Key.Builder setKeyList(KeyList value)
       *
       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;
    • setKeyList

      public Key.Builder setKeyList(KeyList.Builder builderForValue)
       *
       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;
    • mergeKeyList

      public Key.Builder mergeKeyList(KeyList value)
       *
       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;
    • clearKeyList

      public Key.Builder clearKeyList()
       *
       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;
    • 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.
    • setECDSASecp256K1

      public Key.Builder setECDSASecp256K1(com.google.protobuf.ByteString value)
       *
       A set of compressed ECDSA(secp256k1) public key bytes.<br/>
       This is an EVM compatibility format.
       
      bytes ECDSA_secp256k1 = 7;
      Parameters:
      value - The eCDSASecp256k1 to set.
      Returns:
      This builder for chaining.
    • clearECDSASecp256K1

      public Key.Builder clearECDSASecp256K1()
       *
       A set of compressed ECDSA(secp256k1) public key bytes.<br/>
       This is an EVM compatibility format.
       
      bytes ECDSA_secp256k1 = 7;
      Returns:
      This builder for chaining.
    • 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.
    • setDelegatableContractId

      public Key.Builder setDelegatableContractId(ContractID value)
       *
       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;
    • setDelegatableContractId

      public Key.Builder setDelegatableContractId(ContractID.Builder builderForValue)
       *
       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;
    • mergeDelegatableContractId

      public Key.Builder mergeDelegatableContractId(ContractID value)
       *
       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;
    • clearDelegatableContractId

      public Key.Builder clearDelegatableContractId()
       *
       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;