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 ClassesModifier and TypeClassDescriptionstatic 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 enumNested 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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageLite
unknownFieldsFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionprotected final ObjectdynamicMethod(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.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.static Key.Builderstatic Key.BuildernewBuilder(Key prototype) static KeyparseDelimitedFrom(InputStream input) static KeyparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static KeyparseFrom(byte[] data) static KeyparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static KeyparseFrom(com.google.protobuf.ByteString data) static KeyparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static KeyparseFrom(com.google.protobuf.CodedInputStream input) static KeyparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static KeyparseFrom(InputStream input) static KeyparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static KeyparseFrom(ByteBuffer data) static KeyparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Key> parser()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, writeToMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
- Specified by:
getKeyCasein interfaceKeyOrBuilder
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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
- 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
- Throws:
IOException
-
parseFrom
public static Key parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Key parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Key parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilder
-
newBuilder
-
dynamicMethod
protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1) - Specified by:
dynamicMethodin classcom.google.protobuf.GeneratedMessageLite<Key,Key.Builder>
-
getDefaultInstance
-
parser
-