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 TypeMethodDescription* 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.clearKey()* 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.ByteStringDeprecated.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.ByteStringDeprecated.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.booleanDeprecated.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.booleanDeprecated.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.mergeContractID(ContractID value) * 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.mergeKeyList(KeyList value) * A list of keys.mergeThresholdKey(ThresholdKey value) * A threshold, M, combined with a list of N keys, any M of which are sufficient to form a valid signature.setContractID(ContractID value) * A smart contract instance that is authorized implicitly.setContractID(ContractID.Builder builderForValue) * 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.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.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.setKeyList(KeyList value) * 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.setThresholdKey(ThresholdKey value) * A threshold, M, combined with a list of N keys, any M of which are sufficient to form a valid signature.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.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Method Details
-
getKeyCase
- Specified by:
getKeyCasein interfaceKeyOrBuilder
-
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:
hasContractIDin interfaceKeyOrBuilder- Returns:
- Whether the contractID field is set.
-
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:
getContractIDin interfaceKeyOrBuilder- Returns:
- The contractID.
-
setContractID
* 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
* 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
* 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
* 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:
hasEd25519in interfaceKeyOrBuilder- 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:
getEd25519in interfaceKeyOrBuilder- Returns:
- The ed25519.
-
setEd25519
* An array of Ed25519 public key bytes.
bytes ed25519 = 2;- Parameters:
value- The ed25519 to set.- Returns:
- This builder for chaining.
-
clearEd25519
* An array of Ed25519 public key bytes.
bytes ed25519 = 2;- Returns:
- This builder for chaining.
-
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:
hasRSA3072in interfaceKeyOrBuilder- Returns:
- Whether the rSA3072 field is set.
-
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:
getRSA3072in interfaceKeyOrBuilder- Returns:
- The rSA3072.
-
setRSA3072
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.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.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:
hasECDSA384in interfaceKeyOrBuilder- Returns:
- Whether the eCDSA384 field is set.
-
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:
getECDSA384in interfaceKeyOrBuilder- Returns:
- The eCDSA384.
-
setECDSA384
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.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:
hasThresholdKeyin interfaceKeyOrBuilder- Returns:
- Whether the thresholdKey field is set.
-
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:
getThresholdKeyin interfaceKeyOrBuilder- Returns:
- The thresholdKey.
-
setThresholdKey
* 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
* 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
* 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
* 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:
hasKeyListin interfaceKeyOrBuilder- Returns:
- Whether the keyList field is set.
-
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:
getKeyListin interfaceKeyOrBuilder- Returns:
- The keyList.
-
setKeyList
* 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
* 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
* 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
* 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:
hasECDSASecp256K1in interfaceKeyOrBuilder- 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:
getECDSASecp256K1in interfaceKeyOrBuilder- Returns:
- The eCDSASecp256k1.
-
setECDSASecp256K1
* 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
* 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:
hasDelegatableContractIdin interfaceKeyOrBuilder- Returns:
- Whether the delegatableContractId field is set.
-
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:
getDelegatableContractIdin interfaceKeyOrBuilder- Returns:
- The delegatableContractId.
-
setDelegatableContractId
* 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
* 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
* 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
* 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;
-