com.google.crypto.tink.proto.EncryptedKeyset 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;
/**
*
* Represents a keyset that is encrypted with a master key.
*
*
* Protobuf type {@code google.crypto.tink.EncryptedKeyset}
*/
public final class EncryptedKeyset extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.crypto.tink.EncryptedKeyset)
EncryptedKeysetOrBuilder {
private static final long serialVersionUID = 0L;
// Use EncryptedKeyset.newBuilder() to construct.
private EncryptedKeyset(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private EncryptedKeyset() {
encryptedKeyset_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new EncryptedKeyset();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private EncryptedKeyset(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 18: {
encryptedKeyset_ = input.readBytes();
break;
}
case 26: {
com.google.crypto.tink.proto.KeysetInfo.Builder subBuilder = null;
if (keysetInfo_ != null) {
subBuilder = keysetInfo_.toBuilder();
}
keysetInfo_ = input.readMessage(com.google.crypto.tink.proto.KeysetInfo.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(keysetInfo_);
keysetInfo_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_EncryptedKeyset_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_EncryptedKeyset_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.crypto.tink.proto.EncryptedKeyset.class, com.google.crypto.tink.proto.EncryptedKeyset.Builder.class);
}
public static final int ENCRYPTED_KEYSET_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString encryptedKeyset_;
/**
*
* Required.
*
*
* bytes encrypted_keyset = 2;
*/
public com.google.protobuf.ByteString getEncryptedKeyset() {
return encryptedKeyset_;
}
public static final int KEYSET_INFO_FIELD_NUMBER = 3;
private com.google.crypto.tink.proto.KeysetInfo keysetInfo_;
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public boolean hasKeysetInfo() {
return keysetInfo_ != null;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public com.google.crypto.tink.proto.KeysetInfo getKeysetInfo() {
return keysetInfo_ == null ? com.google.crypto.tink.proto.KeysetInfo.getDefaultInstance() : keysetInfo_;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public com.google.crypto.tink.proto.KeysetInfoOrBuilder getKeysetInfoOrBuilder() {
return getKeysetInfo();
}
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 (!encryptedKeyset_.isEmpty()) {
output.writeBytes(2, encryptedKeyset_);
}
if (keysetInfo_ != null) {
output.writeMessage(3, getKeysetInfo());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!encryptedKeyset_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, encryptedKeyset_);
}
if (keysetInfo_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getKeysetInfo());
}
size += unknownFields.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.EncryptedKeyset)) {
return super.equals(obj);
}
com.google.crypto.tink.proto.EncryptedKeyset other = (com.google.crypto.tink.proto.EncryptedKeyset) obj;
if (!getEncryptedKeyset()
.equals(other.getEncryptedKeyset())) return false;
if (hasKeysetInfo() != other.hasKeysetInfo()) return false;
if (hasKeysetInfo()) {
if (!getKeysetInfo()
.equals(other.getKeysetInfo())) return false;
}
if (!unknownFields.equals(other.unknownFields)) 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) + ENCRYPTED_KEYSET_FIELD_NUMBER;
hash = (53 * hash) + getEncryptedKeyset().hashCode();
if (hasKeysetInfo()) {
hash = (37 * hash) + KEYSET_INFO_FIELD_NUMBER;
hash = (53 * hash) + getKeysetInfo().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.crypto.tink.proto.EncryptedKeyset parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.EncryptedKeyset 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.EncryptedKeyset parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.EncryptedKeyset 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.EncryptedKeyset parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.crypto.tink.proto.EncryptedKeyset 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.EncryptedKeyset parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.EncryptedKeyset 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.EncryptedKeyset parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.crypto.tink.proto.EncryptedKeyset 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.EncryptedKeyset 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.EncryptedKeyset 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.EncryptedKeyset 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;
}
/**
*
* Represents a keyset that is encrypted with a master key.
*
*
* Protobuf type {@code google.crypto.tink.EncryptedKeyset}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.crypto.tink.EncryptedKeyset)
com.google.crypto.tink.proto.EncryptedKeysetOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_EncryptedKeyset_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_EncryptedKeyset_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.crypto.tink.proto.EncryptedKeyset.class, com.google.crypto.tink.proto.EncryptedKeyset.Builder.class);
}
// Construct using com.google.crypto.tink.proto.EncryptedKeyset.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
encryptedKeyset_ = com.google.protobuf.ByteString.EMPTY;
if (keysetInfoBuilder_ == null) {
keysetInfo_ = null;
} else {
keysetInfo_ = null;
keysetInfoBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_EncryptedKeyset_descriptor;
}
@java.lang.Override
public com.google.crypto.tink.proto.EncryptedKeyset getDefaultInstanceForType() {
return com.google.crypto.tink.proto.EncryptedKeyset.getDefaultInstance();
}
@java.lang.Override
public com.google.crypto.tink.proto.EncryptedKeyset build() {
com.google.crypto.tink.proto.EncryptedKeyset result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.crypto.tink.proto.EncryptedKeyset buildPartial() {
com.google.crypto.tink.proto.EncryptedKeyset result = new com.google.crypto.tink.proto.EncryptedKeyset(this);
result.encryptedKeyset_ = encryptedKeyset_;
if (keysetInfoBuilder_ == null) {
result.keysetInfo_ = keysetInfo_;
} else {
result.keysetInfo_ = keysetInfoBuilder_.build();
}
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.EncryptedKeyset) {
return mergeFrom((com.google.crypto.tink.proto.EncryptedKeyset)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.crypto.tink.proto.EncryptedKeyset other) {
if (other == com.google.crypto.tink.proto.EncryptedKeyset.getDefaultInstance()) return this;
if (other.getEncryptedKeyset() != com.google.protobuf.ByteString.EMPTY) {
setEncryptedKeyset(other.getEncryptedKeyset());
}
if (other.hasKeysetInfo()) {
mergeKeysetInfo(other.getKeysetInfo());
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.google.crypto.tink.proto.EncryptedKeyset parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.crypto.tink.proto.EncryptedKeyset) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.google.protobuf.ByteString encryptedKeyset_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* Required.
*
*
* bytes encrypted_keyset = 2;
*/
public com.google.protobuf.ByteString getEncryptedKeyset() {
return encryptedKeyset_;
}
/**
*
* Required.
*
*
* bytes encrypted_keyset = 2;
*/
public Builder setEncryptedKeyset(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
encryptedKeyset_ = value;
onChanged();
return this;
}
/**
*
* Required.
*
*
* bytes encrypted_keyset = 2;
*/
public Builder clearEncryptedKeyset() {
encryptedKeyset_ = getDefaultInstance().getEncryptedKeyset();
onChanged();
return this;
}
private com.google.crypto.tink.proto.KeysetInfo keysetInfo_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.crypto.tink.proto.KeysetInfo, com.google.crypto.tink.proto.KeysetInfo.Builder, com.google.crypto.tink.proto.KeysetInfoOrBuilder> keysetInfoBuilder_;
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public boolean hasKeysetInfo() {
return keysetInfoBuilder_ != null || keysetInfo_ != null;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public com.google.crypto.tink.proto.KeysetInfo getKeysetInfo() {
if (keysetInfoBuilder_ == null) {
return keysetInfo_ == null ? com.google.crypto.tink.proto.KeysetInfo.getDefaultInstance() : keysetInfo_;
} else {
return keysetInfoBuilder_.getMessage();
}
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public Builder setKeysetInfo(com.google.crypto.tink.proto.KeysetInfo value) {
if (keysetInfoBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
keysetInfo_ = value;
onChanged();
} else {
keysetInfoBuilder_.setMessage(value);
}
return this;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public Builder setKeysetInfo(
com.google.crypto.tink.proto.KeysetInfo.Builder builderForValue) {
if (keysetInfoBuilder_ == null) {
keysetInfo_ = builderForValue.build();
onChanged();
} else {
keysetInfoBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public Builder mergeKeysetInfo(com.google.crypto.tink.proto.KeysetInfo value) {
if (keysetInfoBuilder_ == null) {
if (keysetInfo_ != null) {
keysetInfo_ =
com.google.crypto.tink.proto.KeysetInfo.newBuilder(keysetInfo_).mergeFrom(value).buildPartial();
} else {
keysetInfo_ = value;
}
onChanged();
} else {
keysetInfoBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public Builder clearKeysetInfo() {
if (keysetInfoBuilder_ == null) {
keysetInfo_ = null;
onChanged();
} else {
keysetInfo_ = null;
keysetInfoBuilder_ = null;
}
return this;
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public com.google.crypto.tink.proto.KeysetInfo.Builder getKeysetInfoBuilder() {
onChanged();
return getKeysetInfoFieldBuilder().getBuilder();
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
public com.google.crypto.tink.proto.KeysetInfoOrBuilder getKeysetInfoOrBuilder() {
if (keysetInfoBuilder_ != null) {
return keysetInfoBuilder_.getMessageOrBuilder();
} else {
return keysetInfo_ == null ?
com.google.crypto.tink.proto.KeysetInfo.getDefaultInstance() : keysetInfo_;
}
}
/**
*
* Optional.
*
*
* .google.crypto.tink.KeysetInfo keyset_info = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.crypto.tink.proto.KeysetInfo, com.google.crypto.tink.proto.KeysetInfo.Builder, com.google.crypto.tink.proto.KeysetInfoOrBuilder>
getKeysetInfoFieldBuilder() {
if (keysetInfoBuilder_ == null) {
keysetInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.crypto.tink.proto.KeysetInfo, com.google.crypto.tink.proto.KeysetInfo.Builder, com.google.crypto.tink.proto.KeysetInfoOrBuilder>(
getKeysetInfo(),
getParentForChildren(),
isClean());
keysetInfo_ = null;
}
return keysetInfoBuilder_;
}
@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.EncryptedKeyset)
}
// @@protoc_insertion_point(class_scope:google.crypto.tink.EncryptedKeyset)
private static final com.google.crypto.tink.proto.EncryptedKeyset DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.crypto.tink.proto.EncryptedKeyset();
}
public static com.google.crypto.tink.proto.EncryptedKeyset getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public EncryptedKeyset parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new EncryptedKeyset(input, extensionRegistry);
}
};
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.EncryptedKeyset getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy