com.google.crypto.tink.proto.KeyData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tink Show documentation
Show all versions of tink Show documentation
Tink is a small cryptographic library that provides a safe, simple, agile and fast way to accomplish some common cryptographic tasks.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: proto/tink.proto
package com.google.crypto.tink.proto;
/**
*
* The actual *Key-proto is wrapped in a KeyData message, which in addition
* to this serialized proto contains also type_url identifying the
* definition of *Key-proto (as in KeyFormat-message), and some extra metadata
* about the type key material.
*
*
* Protobuf type {@code google.crypto.tink.KeyData}
*/
public final class KeyData extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.crypto.tink.KeyData)
KeyDataOrBuilder {
private static final long serialVersionUID = 0L;
// Use KeyData.newBuilder() to construct.
private KeyData(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private KeyData() {
typeUrl_ = "";
value_ = com.google.protobuf.ByteString.EMPTY;
keyMaterialType_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new KeyData();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyData_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.crypto.tink.proto.KeyData.class, com.google.crypto.tink.proto.KeyData.Builder.class);
}
/**
* Protobuf enum {@code google.crypto.tink.KeyData.KeyMaterialType}
*/
public enum KeyMaterialType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* UNKNOWN_KEYMATERIAL = 0;
*/
UNKNOWN_KEYMATERIAL(0),
/**
* SYMMETRIC = 1;
*/
SYMMETRIC(1),
/**
* ASYMMETRIC_PRIVATE = 2;
*/
ASYMMETRIC_PRIVATE(2),
/**
* ASYMMETRIC_PUBLIC = 3;
*/
ASYMMETRIC_PUBLIC(3),
/**
*
* points to a remote key, i.e., in a KMS.
*
*
* REMOTE = 4;
*/
REMOTE(4),
UNRECOGNIZED(-1),
;
/**
* UNKNOWN_KEYMATERIAL = 0;
*/
public static final int UNKNOWN_KEYMATERIAL_VALUE = 0;
/**
* SYMMETRIC = 1;
*/
public static final int SYMMETRIC_VALUE = 1;
/**
* ASYMMETRIC_PRIVATE = 2;
*/
public static final int ASYMMETRIC_PRIVATE_VALUE = 2;
/**
* ASYMMETRIC_PUBLIC = 3;
*/
public static final int ASYMMETRIC_PUBLIC_VALUE = 3;
/**
*
* points to a remote key, i.e., in a KMS.
*
*
* REMOTE = 4;
*/
public static final int REMOTE_VALUE = 4;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static KeyMaterialType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static KeyMaterialType forNumber(int value) {
switch (value) {
case 0: return UNKNOWN_KEYMATERIAL;
case 1: return SYMMETRIC;
case 2: return ASYMMETRIC_PRIVATE;
case 3: return ASYMMETRIC_PUBLIC;
case 4: return REMOTE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
KeyMaterialType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public KeyMaterialType findValueByNumber(int number) {
return KeyMaterialType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.crypto.tink.proto.KeyData.getDescriptor().getEnumTypes().get(0);
}
private static final KeyMaterialType[] VALUES = values();
public static KeyMaterialType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private KeyMaterialType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.crypto.tink.KeyData.KeyMaterialType)
}
public static final int TYPE_URL_FIELD_NUMBER = 1;
private volatile java.lang.Object typeUrl_;
/**
*
* Required.
*
*
* string type_url = 1;
* @return The typeUrl.
*/
@java.lang.Override
public java.lang.String getTypeUrl() {
java.lang.Object ref = typeUrl_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
typeUrl_ = s;
return s;
}
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return The bytes for typeUrl.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTypeUrlBytes() {
java.lang.Object ref = typeUrl_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
typeUrl_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VALUE_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString value_;
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2 [ctype = STRING_PIECE];
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
return value_;
}
public static final int KEY_MATERIAL_TYPE_FIELD_NUMBER = 3;
private int keyMaterialType_;
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @return The enum numeric value on the wire for keyMaterialType.
*/
@java.lang.Override public int getKeyMaterialTypeValue() {
return keyMaterialType_;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @return The keyMaterialType.
*/
@java.lang.Override public com.google.crypto.tink.proto.KeyData.KeyMaterialType getKeyMaterialType() {
@SuppressWarnings("deprecation")
com.google.crypto.tink.proto.KeyData.KeyMaterialType result = com.google.crypto.tink.proto.KeyData.KeyMaterialType.valueOf(keyMaterialType_);
return result == null ? com.google.crypto.tink.proto.KeyData.KeyMaterialType.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(typeUrl_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, typeUrl_);
}
if (!value_.isEmpty()) {
output.writeBytes(2, value_);
}
if (keyMaterialType_ != com.google.crypto.tink.proto.KeyData.KeyMaterialType.UNKNOWN_KEYMATERIAL.getNumber()) {
output.writeEnum(3, keyMaterialType_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(typeUrl_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, typeUrl_);
}
if (!value_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, value_);
}
if (keyMaterialType_ != com.google.crypto.tink.proto.KeyData.KeyMaterialType.UNKNOWN_KEYMATERIAL.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, keyMaterialType_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.crypto.tink.proto.KeyData)) {
return super.equals(obj);
}
com.google.crypto.tink.proto.KeyData other = (com.google.crypto.tink.proto.KeyData) obj;
if (!getTypeUrl()
.equals(other.getTypeUrl())) return false;
if (!getValue()
.equals(other.getValue())) return false;
if (keyMaterialType_ != other.keyMaterialType_) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + TYPE_URL_FIELD_NUMBER;
hash = (53 * hash) + getTypeUrl().hashCode();
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValue().hashCode();
hash = (37 * hash) + KEY_MATERIAL_TYPE_FIELD_NUMBER;
hash = (53 * hash) + keyMaterialType_;
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.KeyData parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.crypto.tink.proto.KeyData prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* The actual *Key-proto is wrapped in a KeyData message, which in addition
* to this serialized proto contains also type_url identifying the
* definition of *Key-proto (as in KeyFormat-message), and some extra metadata
* about the type key material.
*
*
* Protobuf type {@code google.crypto.tink.KeyData}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.crypto.tink.KeyData)
com.google.crypto.tink.proto.KeyDataOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyData_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyData_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.crypto.tink.proto.KeyData.class, com.google.crypto.tink.proto.KeyData.Builder.class);
}
// Construct using com.google.crypto.tink.proto.KeyData.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
typeUrl_ = "";
value_ = com.google.protobuf.ByteString.EMPTY;
keyMaterialType_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyData_descriptor;
}
@java.lang.Override
public com.google.crypto.tink.proto.KeyData getDefaultInstanceForType() {
return com.google.crypto.tink.proto.KeyData.getDefaultInstance();
}
@java.lang.Override
public com.google.crypto.tink.proto.KeyData build() {
com.google.crypto.tink.proto.KeyData result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.crypto.tink.proto.KeyData buildPartial() {
com.google.crypto.tink.proto.KeyData result = new com.google.crypto.tink.proto.KeyData(this);
result.typeUrl_ = typeUrl_;
result.value_ = value_;
result.keyMaterialType_ = keyMaterialType_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.crypto.tink.proto.KeyData) {
return mergeFrom((com.google.crypto.tink.proto.KeyData)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.crypto.tink.proto.KeyData other) {
if (other == com.google.crypto.tink.proto.KeyData.getDefaultInstance()) return this;
if (!other.getTypeUrl().isEmpty()) {
typeUrl_ = other.typeUrl_;
onChanged();
}
if (other.getValue() != com.google.protobuf.ByteString.EMPTY) {
setValue(other.getValue());
}
if (other.keyMaterialType_ != 0) {
setKeyMaterialTypeValue(other.getKeyMaterialTypeValue());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
typeUrl_ = input.readStringRequireUtf8();
break;
} // case 10
case 18: {
value_ = input.readBytes();
break;
} // case 18
case 24: {
keyMaterialType_ = input.readEnum();
break;
} // case 24
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private java.lang.Object typeUrl_ = "";
/**
*
* Required.
*
*
* string type_url = 1;
* @return The typeUrl.
*/
public java.lang.String getTypeUrl() {
java.lang.Object ref = typeUrl_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
typeUrl_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return The bytes for typeUrl.
*/
public com.google.protobuf.ByteString
getTypeUrlBytes() {
java.lang.Object ref = typeUrl_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
typeUrl_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Required.
*
*
* string type_url = 1;
* @param value The typeUrl to set.
* @return This builder for chaining.
*/
public Builder setTypeUrl(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
typeUrl_ = value;
onChanged();
return this;
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return This builder for chaining.
*/
public Builder clearTypeUrl() {
typeUrl_ = getDefaultInstance().getTypeUrl();
onChanged();
return this;
}
/**
*
* Required.
*
*
* string type_url = 1;
* @param value The bytes for typeUrl to set.
* @return This builder for chaining.
*/
public Builder setTypeUrlBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
typeUrl_ = value;
onChanged();
return this;
}
private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2 [ctype = STRING_PIECE];
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
return value_;
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2 [ctype = STRING_PIECE];
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
value_ = value;
onChanged();
return this;
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2 [ctype = STRING_PIECE];
* @return This builder for chaining.
*/
public Builder clearValue() {
value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
private int keyMaterialType_ = 0;
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @return The enum numeric value on the wire for keyMaterialType.
*/
@java.lang.Override public int getKeyMaterialTypeValue() {
return keyMaterialType_;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @param value The enum numeric value on the wire for keyMaterialType to set.
* @return This builder for chaining.
*/
public Builder setKeyMaterialTypeValue(int value) {
keyMaterialType_ = value;
onChanged();
return this;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @return The keyMaterialType.
*/
@java.lang.Override
public com.google.crypto.tink.proto.KeyData.KeyMaterialType getKeyMaterialType() {
@SuppressWarnings("deprecation")
com.google.crypto.tink.proto.KeyData.KeyMaterialType result = com.google.crypto.tink.proto.KeyData.KeyMaterialType.valueOf(keyMaterialType_);
return result == null ? com.google.crypto.tink.proto.KeyData.KeyMaterialType.UNRECOGNIZED : result;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @param value The keyMaterialType to set.
* @return This builder for chaining.
*/
public Builder setKeyMaterialType(com.google.crypto.tink.proto.KeyData.KeyMaterialType value) {
if (value == null) {
throw new NullPointerException();
}
keyMaterialType_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @return This builder for chaining.
*/
public Builder clearKeyMaterialType() {
keyMaterialType_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.crypto.tink.KeyData)
}
// @@protoc_insertion_point(class_scope:google.crypto.tink.KeyData)
private static final com.google.crypto.tink.proto.KeyData DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.crypto.tink.proto.KeyData();
}
public static com.google.crypto.tink.proto.KeyData getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public KeyData parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.crypto.tink.proto.KeyData getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy