com.hedera.hashgraph.sdk.proto.SignaturePair Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: basic_types.proto
// Protobuf Java Version: 3.25.3
package com.hedera.hashgraph.sdk.proto;
/**
*
**
* The client may use any number of bytes from zero to the whole length of the public key for
* pubKeyPrefix. If zero bytes are used, then it must be that only one primitive key is required
* to sign the linked transaction; it will surely resolve to <tt>INVALID_SIGNATURE</tt> otherwise.
*
* <b>IMPORTANT:</b> In the special case that a signature is being provided for a key used to
* authorize a precompiled contract, the <tt>pubKeyPrefix</tt> must contain the <b>entire public
* key</b>! That is, if the key is a Ed25519 key, the <tt>pubKeyPrefix</tt> should be 32 bytes
* long. If the key is a ECDSA(secp256k1) key, the <tt>pubKeyPrefix</tt> should be 33 bytes long,
* since we require the compressed form of the public key.
*
* Only Ed25519 and ECDSA(secp256k1) keys and hence signatures are currently supported.
*
*
* Protobuf type {@code proto.SignaturePair}
*/
public final class SignaturePair extends
com.google.protobuf.GeneratedMessageLite<
SignaturePair, SignaturePair.Builder> implements
// @@protoc_insertion_point(message_implements:proto.SignaturePair)
SignaturePairOrBuilder {
private SignaturePair() {
pubKeyPrefix_ = com.google.protobuf.ByteString.EMPTY;
}
private int signatureCase_ = 0;
private java.lang.Object signature_;
public enum SignatureCase {
CONTRACT(2),
ED25519(3),
RSA_3072(4),
ECDSA_384(5),
ECDSA_SECP256K1(6),
SIGNATURE_NOT_SET(0);
private final int value;
private SignatureCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static SignatureCase valueOf(int value) {
return forNumber(value);
}
public static SignatureCase forNumber(int value) {
switch (value) {
case 2: return CONTRACT;
case 3: return ED25519;
case 4: return RSA_3072;
case 5: return ECDSA_384;
case 6: return ECDSA_SECP256K1;
case 0: return SIGNATURE_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
@java.lang.Override
public SignatureCase
getSignatureCase() {
return SignatureCase.forNumber(
signatureCase_);
}
private void clearSignature() {
signatureCase_ = 0;
signature_ = null;
}
public static final int PUBKEYPREFIX_FIELD_NUMBER = 1;
private com.google.protobuf.ByteString pubKeyPrefix_;
/**
*
**
* First few bytes of the public key
*
*
* bytes pubKeyPrefix = 1;
* @return The pubKeyPrefix.
*/
@java.lang.Override
public com.google.protobuf.ByteString getPubKeyPrefix() {
return pubKeyPrefix_;
}
/**
*
**
* First few bytes of the public key
*
*
* bytes pubKeyPrefix = 1;
* @param value The pubKeyPrefix to set.
*/
private void setPubKeyPrefix(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
pubKeyPrefix_ = value;
}
/**
*
**
* First few bytes of the public key
*
*
* bytes pubKeyPrefix = 1;
*/
private void clearPubKeyPrefix() {
pubKeyPrefix_ = getDefaultInstance().getPubKeyPrefix();
}
public static final int CONTRACT_FIELD_NUMBER = 2;
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @return Whether the contract field is set.
*/
@java.lang.Override
public boolean hasContract() {
return signatureCase_ == 2;
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @return The contract.
*/
@java.lang.Override
public com.google.protobuf.ByteString getContract() {
if (signatureCase_ == 2) {
return (com.google.protobuf.ByteString) signature_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @param value The contract to set.
*/
private void setContract(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
signatureCase_ = 2;
signature_ = value;
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
*/
private void clearContract() {
if (signatureCase_ == 2) {
signatureCase_ = 0;
signature_ = null;
}
}
public static final int ED25519_FIELD_NUMBER = 3;
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @return Whether the ed25519 field is set.
*/
@java.lang.Override
public boolean hasEd25519() {
return signatureCase_ == 3;
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @return The ed25519.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEd25519() {
if (signatureCase_ == 3) {
return (com.google.protobuf.ByteString) signature_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @param value The ed25519 to set.
*/
private void setEd25519(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
signatureCase_ = 3;
signature_ = value;
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
*/
private void clearEd25519() {
if (signatureCase_ == 3) {
signatureCase_ = 0;
signature_ = null;
}
}
public static final int RSA_3072_FIELD_NUMBER = 4;
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @return Whether the rSA3072 field is set.
*/
@java.lang.Override
public boolean hasRSA3072() {
return signatureCase_ == 4;
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @return The rSA3072.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRSA3072() {
if (signatureCase_ == 4) {
return (com.google.protobuf.ByteString) signature_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @param value The rSA3072 to set.
*/
private void setRSA3072(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
signatureCase_ = 4;
signature_ = value;
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
*/
private void clearRSA3072() {
if (signatureCase_ == 4) {
signatureCase_ = 0;
signature_ = null;
}
}
public static final int ECDSA_384_FIELD_NUMBER = 5;
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @return Whether the eCDSA384 field is set.
*/
@java.lang.Override
public boolean hasECDSA384() {
return signatureCase_ == 5;
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @return The eCDSA384.
*/
@java.lang.Override
public com.google.protobuf.ByteString getECDSA384() {
if (signatureCase_ == 5) {
return (com.google.protobuf.ByteString) signature_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @param value The eCDSA384 to set.
*/
private void setECDSA384(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
signatureCase_ = 5;
signature_ = value;
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
*/
private void clearECDSA384() {
if (signatureCase_ == 5) {
signatureCase_ = 0;
signature_ = null;
}
}
public static final int ECDSA_SECP256K1_FIELD_NUMBER = 6;
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @return Whether the eCDSASecp256k1 field is set.
*/
@java.lang.Override
public boolean hasECDSASecp256K1() {
return signatureCase_ == 6;
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @return The eCDSASecp256k1.
*/
@java.lang.Override
public com.google.protobuf.ByteString getECDSASecp256K1() {
if (signatureCase_ == 6) {
return (com.google.protobuf.ByteString) signature_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @param value The eCDSASecp256k1 to set.
*/
private void setECDSASecp256K1(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
signatureCase_ = 6;
signature_ = value;
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
*/
private void clearECDSASecp256K1() {
if (signatureCase_ == 6) {
signatureCase_ = 0;
signature_ = null;
}
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static Builder newBuilder() {
return (Builder) DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(com.hedera.hashgraph.sdk.proto.SignaturePair prototype) {
return DEFAULT_INSTANCE.createBuilder(prototype);
}
/**
*
**
* The client may use any number of bytes from zero to the whole length of the public key for
* pubKeyPrefix. If zero bytes are used, then it must be that only one primitive key is required
* to sign the linked transaction; it will surely resolve to <tt>INVALID_SIGNATURE</tt> otherwise.
*
* <b>IMPORTANT:</b> In the special case that a signature is being provided for a key used to
* authorize a precompiled contract, the <tt>pubKeyPrefix</tt> must contain the <b>entire public
* key</b>! That is, if the key is a Ed25519 key, the <tt>pubKeyPrefix</tt> should be 32 bytes
* long. If the key is a ECDSA(secp256k1) key, the <tt>pubKeyPrefix</tt> should be 33 bytes long,
* since we require the compressed form of the public key.
*
* Only Ed25519 and ECDSA(secp256k1) keys and hence signatures are currently supported.
*
*
* Protobuf type {@code proto.SignaturePair}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageLite.Builder<
com.hedera.hashgraph.sdk.proto.SignaturePair, Builder> implements
// @@protoc_insertion_point(builder_implements:proto.SignaturePair)
com.hedera.hashgraph.sdk.proto.SignaturePairOrBuilder {
// Construct using com.hedera.hashgraph.sdk.proto.SignaturePair.newBuilder()
private Builder() {
super(DEFAULT_INSTANCE);
}
@java.lang.Override
public SignatureCase
getSignatureCase() {
return instance.getSignatureCase();
}
public Builder clearSignature() {
copyOnWrite();
instance.clearSignature();
return this;
}
/**
*
**
* First few bytes of the public key
*
*
* bytes pubKeyPrefix = 1;
* @return The pubKeyPrefix.
*/
@java.lang.Override
public com.google.protobuf.ByteString getPubKeyPrefix() {
return instance.getPubKeyPrefix();
}
/**
*
**
* First few bytes of the public key
*
*
* bytes pubKeyPrefix = 1;
* @param value The pubKeyPrefix to set.
* @return This builder for chaining.
*/
public Builder setPubKeyPrefix(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setPubKeyPrefix(value);
return this;
}
/**
*
**
* First few bytes of the public key
*
*
* bytes pubKeyPrefix = 1;
* @return This builder for chaining.
*/
public Builder clearPubKeyPrefix() {
copyOnWrite();
instance.clearPubKeyPrefix();
return this;
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @return Whether the contract field is set.
*/
@java.lang.Override
public boolean hasContract() {
return instance.hasContract();
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @return The contract.
*/
@java.lang.Override
public com.google.protobuf.ByteString getContract() {
return instance.getContract();
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @param value The contract to set.
* @return This builder for chaining.
*/
public Builder setContract(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setContract(value);
return this;
}
/**
*
**
* smart contract virtual signature (always length zero)
*
*
* bytes contract = 2;
* @return This builder for chaining.
*/
public Builder clearContract() {
copyOnWrite();
instance.clearContract();
return this;
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @return Whether the ed25519 field is set.
*/
@java.lang.Override
public boolean hasEd25519() {
return instance.hasEd25519();
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @return The ed25519.
*/
@java.lang.Override
public com.google.protobuf.ByteString getEd25519() {
return instance.getEd25519();
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @param value The ed25519 to set.
* @return This builder for chaining.
*/
public Builder setEd25519(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setEd25519(value);
return this;
}
/**
*
**
* ed25519 signature
*
*
* bytes ed25519 = 3;
* @return This builder for chaining.
*/
public Builder clearEd25519() {
copyOnWrite();
instance.clearEd25519();
return this;
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @return Whether the rSA3072 field is set.
*/
@java.lang.Override
public boolean hasRSA3072() {
return instance.hasRSA3072();
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @return The rSA3072.
*/
@java.lang.Override
public com.google.protobuf.ByteString getRSA3072() {
return instance.getRSA3072();
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @param value The rSA3072 to set.
* @return This builder for chaining.
*/
public Builder setRSA3072(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setRSA3072(value);
return this;
}
/**
*
**
* RSA-3072 signature
*
*
* bytes RSA_3072 = 4;
* @return This builder for chaining.
*/
public Builder clearRSA3072() {
copyOnWrite();
instance.clearRSA3072();
return this;
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @return Whether the eCDSA384 field is set.
*/
@java.lang.Override
public boolean hasECDSA384() {
return instance.hasECDSA384();
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @return The eCDSA384.
*/
@java.lang.Override
public com.google.protobuf.ByteString getECDSA384() {
return instance.getECDSA384();
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @param value The eCDSA384 to set.
* @return This builder for chaining.
*/
public Builder setECDSA384(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setECDSA384(value);
return this;
}
/**
*
**
* ECDSA p-384 signature
*
*
* bytes ECDSA_384 = 5;
* @return This builder for chaining.
*/
public Builder clearECDSA384() {
copyOnWrite();
instance.clearECDSA384();
return this;
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @return Whether the eCDSASecp256k1 field is set.
*/
@java.lang.Override
public boolean hasECDSASecp256K1() {
return instance.hasECDSASecp256K1();
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @return The eCDSASecp256k1.
*/
@java.lang.Override
public com.google.protobuf.ByteString getECDSASecp256K1() {
return instance.getECDSASecp256K1();
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @param value The eCDSASecp256k1 to set.
* @return This builder for chaining.
*/
public Builder setECDSASecp256K1(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setECDSASecp256K1(value);
return this;
}
/**
*
**
* ECDSA(secp256k1) signature
*
*
* bytes ECDSA_secp256k1 = 6;
* @return This builder for chaining.
*/
public Builder clearECDSASecp256K1() {
copyOnWrite();
instance.clearECDSASecp256K1();
return this;
}
// @@protoc_insertion_point(builder_scope:proto.SignaturePair)
}
@java.lang.Override
@java.lang.SuppressWarnings({"unchecked", "fallthrough"})
protected final java.lang.Object dynamicMethod(
com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
java.lang.Object arg0, java.lang.Object arg1) {
switch (method) {
case NEW_MUTABLE_INSTANCE: {
return new com.hedera.hashgraph.sdk.proto.SignaturePair();
}
case NEW_BUILDER: {
return new Builder();
}
case BUILD_MESSAGE_INFO: {
java.lang.Object[] objects = new java.lang.Object[] {
"signature_",
"signatureCase_",
"pubKeyPrefix_",
};
java.lang.String info =
"\u0000\u0006\u0001\u0000\u0001\u0006\u0006\u0000\u0000\u0000\u0001\n\u0002=\u0000" +
"\u0003=\u0000\u0004=\u0000\u0005=\u0000\u0006=\u0000";
return newMessageInfo(DEFAULT_INSTANCE, info, objects);
}
// fall through
case GET_DEFAULT_INSTANCE: {
return DEFAULT_INSTANCE;
}
case GET_PARSER: {
com.google.protobuf.Parser parser = PARSER;
if (parser == null) {
synchronized (com.hedera.hashgraph.sdk.proto.SignaturePair.class) {
parser = PARSER;
if (parser == null) {
parser =
new DefaultInstanceBasedParser(
DEFAULT_INSTANCE);
PARSER = parser;
}
}
}
return parser;
}
case GET_MEMOIZED_IS_INITIALIZED: {
return (byte) 1;
}
case SET_MEMOIZED_IS_INITIALIZED: {
return null;
}
}
throw new UnsupportedOperationException();
}
// @@protoc_insertion_point(class_scope:proto.SignaturePair)
private static final com.hedera.hashgraph.sdk.proto.SignaturePair DEFAULT_INSTANCE;
static {
SignaturePair defaultInstance = new SignaturePair();
// New instances are implicitly immutable so no need to make
// immutable.
DEFAULT_INSTANCE = defaultInstance;
com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
SignaturePair.class, defaultInstance);
}
public static com.hedera.hashgraph.sdk.proto.SignaturePair getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static volatile com.google.protobuf.Parser PARSER;
public static com.google.protobuf.Parser parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}