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-android Show documentation
Show all versions of tink-android Show documentation
Tink is a small cryptographic library that provides a safe, simple, agile and fast way to accomplish some common cryptographic tasks.
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: proto/tink.proto
// Protobuf Java Version: 4.28.2
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.GeneratedMessageLite<
KeyData, KeyData.Builder> implements
// @@protoc_insertion_point(message_implements:google.crypto.tink.KeyData)
KeyDataOrBuilder {
private KeyData() {
typeUrl_ = "";
value_ = com.google.protobuf.ByteString.EMPTY;
}
/**
* Protobuf enum {@code google.crypto.tink.KeyData.KeyMaterialType}
*/
public enum KeyMaterialType
implements com.google.protobuf.Internal.EnumLite {
/**
* 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;
@java.lang.Override
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 number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static KeyMaterialType valueOf(int value) {
return forNumber(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() {
@java.lang.Override
public KeyMaterialType findValueByNumber(int number) {
return KeyMaterialType.forNumber(number);
}
};
public static com.google.protobuf.Internal.EnumVerifier
internalGetVerifier() {
return KeyMaterialTypeVerifier.INSTANCE;
}
private static final class KeyMaterialTypeVerifier implements
com.google.protobuf.Internal.EnumVerifier {
static final com.google.protobuf.Internal.EnumVerifier INSTANCE = new KeyMaterialTypeVerifier();
@java.lang.Override
public boolean isInRange(int number) {
return KeyMaterialType.forNumber(number) != null;
}
};
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 java.lang.String typeUrl_;
/**
*
* Required.
*
*
* string type_url = 1;
* @return The typeUrl.
*/
@java.lang.Override
public java.lang.String getTypeUrl() {
return typeUrl_;
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return The bytes for typeUrl.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTypeUrlBytes() {
return com.google.protobuf.ByteString.copyFromUtf8(typeUrl_);
}
/**
*
* Required.
*
*
* string type_url = 1;
* @param value The typeUrl to set.
*/
private void setTypeUrl(
java.lang.String value) {
java.lang.Class> valueClass = value.getClass();
typeUrl_ = value;
}
/**
*
* Required.
*
*
* string type_url = 1;
*/
private void clearTypeUrl() {
typeUrl_ = getDefaultInstance().getTypeUrl();
}
/**
*
* Required.
*
*
* string type_url = 1;
* @param value The bytes for typeUrl to set.
*/
private void setTypeUrlBytes(
com.google.protobuf.ByteString value) {
checkByteStringIsUtf8(value);
typeUrl_ = value.toStringUtf8();
}
public static final int VALUE_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString value_;
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2;
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
return value_;
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2;
* @param value The value to set.
*/
private void setValue(com.google.protobuf.ByteString value) {
java.lang.Class> valueClass = value.getClass();
value_ = value;
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2;
*/
private void clearValue() {
value_ = getDefaultInstance().getValue();
}
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() {
com.google.crypto.tink.proto.KeyData.KeyMaterialType result = com.google.crypto.tink.proto.KeyData.KeyMaterialType.forNumber(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 enum numeric value on the wire for keyMaterialType to set.
*/
private void setKeyMaterialTypeValue(int value) {
keyMaterialType_ = value;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @param value The keyMaterialType to set.
*/
private void setKeyMaterialType(com.google.crypto.tink.proto.KeyData.KeyMaterialType value) {
keyMaterialType_ = value.getNumber();
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
*/
private void clearKeyMaterialType() {
keyMaterialType_ = 0;
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, 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 com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, 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 com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, data);
}
public static com.google.crypto.tink.proto.KeyData 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.google.crypto.tink.proto.KeyData parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, 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.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input);
}
public static com.google.crypto.tink.proto.KeyData parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
}
public static com.google.crypto.tink.proto.KeyData parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, 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.GeneratedMessageLite.parseFrom(
DEFAULT_INSTANCE, input, extensionRegistry);
}
public static Builder newBuilder() {
return (Builder) DEFAULT_INSTANCE.createBuilder();
}
public static Builder newBuilder(com.google.crypto.tink.proto.KeyData prototype) {
return DEFAULT_INSTANCE.createBuilder(prototype);
}
/**
*
* 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.GeneratedMessageLite.Builder<
com.google.crypto.tink.proto.KeyData, Builder> implements
// @@protoc_insertion_point(builder_implements:google.crypto.tink.KeyData)
com.google.crypto.tink.proto.KeyDataOrBuilder {
// Construct using com.google.crypto.tink.proto.KeyData.newBuilder()
private Builder() {
super(DEFAULT_INSTANCE);
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return The typeUrl.
*/
@java.lang.Override
public java.lang.String getTypeUrl() {
return instance.getTypeUrl();
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return The bytes for typeUrl.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTypeUrlBytes() {
return instance.getTypeUrlBytes();
}
/**
*
* Required.
*
*
* string type_url = 1;
* @param value The typeUrl to set.
* @return This builder for chaining.
*/
public Builder setTypeUrl(
java.lang.String value) {
copyOnWrite();
instance.setTypeUrl(value);
return this;
}
/**
*
* Required.
*
*
* string type_url = 1;
* @return This builder for chaining.
*/
public Builder clearTypeUrl() {
copyOnWrite();
instance.clearTypeUrl();
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) {
copyOnWrite();
instance.setTypeUrlBytes(value);
return this;
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2;
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
return instance.getValue();
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2;
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.setValue(value);
return this;
}
/**
*
* Required.
* Contains specific serialized *Key proto
*
*
* bytes value = 2;
* @return This builder for chaining.
*/
public Builder clearValue() {
copyOnWrite();
instance.clearValue();
return this;
}
/**
*
* 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 instance.getKeyMaterialTypeValue();
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @param value The keyMaterialType to set.
* @return This builder for chaining.
*/
public Builder setKeyMaterialTypeValue(int value) {
copyOnWrite();
instance.setKeyMaterialTypeValue(value);
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() {
return instance.getKeyMaterialType();
}
/**
*
* 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 setKeyMaterialType(com.google.crypto.tink.proto.KeyData.KeyMaterialType value) {
copyOnWrite();
instance.setKeyMaterialType(value);
return this;
}
/**
*
* Required.
*
*
* .google.crypto.tink.KeyData.KeyMaterialType key_material_type = 3;
* @return This builder for chaining.
*/
public Builder clearKeyMaterialType() {
copyOnWrite();
instance.clearKeyMaterialType();
return this;
}
// @@protoc_insertion_point(builder_scope:google.crypto.tink.KeyData)
}
@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.google.crypto.tink.proto.KeyData();
}
case NEW_BUILDER: {
return new Builder();
}
case BUILD_MESSAGE_INFO: {
java.lang.Object[] objects = new java.lang.Object[] {
"typeUrl_",
"value_",
"keyMaterialType_",
};
java.lang.String info =
"\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\u0208\u0002\n" +
"\u0003\f";
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.google.crypto.tink.proto.KeyData.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:google.crypto.tink.KeyData)
private static final com.google.crypto.tink.proto.KeyData DEFAULT_INSTANCE;
static {
KeyData defaultInstance = new KeyData();
// New instances are implicitly immutable so no need to make
// immutable.
DEFAULT_INSTANCE = defaultInstance;
com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
KeyData.class, defaultInstance);
}
public static com.google.crypto.tink.proto.KeyData getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static volatile com.google.protobuf.Parser PARSER;
public static com.google.protobuf.Parser parser() {
return DEFAULT_INSTANCE.getParserForType();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy