All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.crypto.tink.proto.KeyTemplate Maven / Gradle / Ivy

Go to download

Tink is a small cryptographic library that provides a safe, simple, agile and fast way to accomplish some common cryptographic tasks.

There is a newer version: 1.16.0
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: proto/tink.proto

package com.google.crypto.tink.proto;

/**
 * Protobuf type {@code google.crypto.tink.KeyTemplate}
 */
public final class KeyTemplate extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.crypto.tink.KeyTemplate)
    KeyTemplateOrBuilder {
private static final long serialVersionUID = 0L;
  // Use KeyTemplate.newBuilder() to construct.
  private KeyTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    super(builder);
  }
  private KeyTemplate() {
    typeUrl_ = "";
    value_ = com.google.protobuf.ByteString.EMPTY;
    outputPrefixType_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new KeyTemplate();
  }

  @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_KeyTemplate_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyTemplate_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.crypto.tink.proto.KeyTemplate.class, com.google.crypto.tink.proto.KeyTemplate.Builder.class);
  }

  public static final int TYPE_URL_FIELD_NUMBER = 1;
  private volatile java.lang.Object typeUrl_;
  /**
   * 
   * Required. The type_url of the key type in format
   * type.googleapis.com/packagename.messagename -- see above for details.
   * This is typically the protobuf type URL of the *Key proto. In particular,
   * this is different of the protobuf type URL of the *KeyFormat proto.
   * 
* * 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. The type_url of the key type in format
   * type.googleapis.com/packagename.messagename -- see above for details.
   * This is typically the protobuf type URL of the *Key proto. In particular,
   * this is different of the protobuf type URL of the *KeyFormat proto.
   * 
* * 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. The serialized *KeyFormat proto.
   * 
* * bytes value = 2; * @return The value. */ @java.lang.Override public com.google.protobuf.ByteString getValue() { return value_; } public static final int OUTPUT_PREFIX_TYPE_FIELD_NUMBER = 3; private int outputPrefixType_; /** *
   * Required. The type of prefix used when computing some primitives to
   * identify the ciphertext/signature, etc.
   * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @return The enum numeric value on the wire for outputPrefixType. */ @java.lang.Override public int getOutputPrefixTypeValue() { return outputPrefixType_; } /** *
   * Required. The type of prefix used when computing some primitives to
   * identify the ciphertext/signature, etc.
   * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @return The outputPrefixType. */ @java.lang.Override public com.google.crypto.tink.proto.OutputPrefixType getOutputPrefixType() { @SuppressWarnings("deprecation") com.google.crypto.tink.proto.OutputPrefixType result = com.google.crypto.tink.proto.OutputPrefixType.valueOf(outputPrefixType_); return result == null ? com.google.crypto.tink.proto.OutputPrefixType.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 (outputPrefixType_ != com.google.crypto.tink.proto.OutputPrefixType.UNKNOWN_PREFIX.getNumber()) { output.writeEnum(3, outputPrefixType_); } 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 (outputPrefixType_ != com.google.crypto.tink.proto.OutputPrefixType.UNKNOWN_PREFIX.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, outputPrefixType_); } 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.KeyTemplate)) { return super.equals(obj); } com.google.crypto.tink.proto.KeyTemplate other = (com.google.crypto.tink.proto.KeyTemplate) obj; if (!getTypeUrl() .equals(other.getTypeUrl())) return false; if (!getValue() .equals(other.getValue())) return false; if (outputPrefixType_ != other.outputPrefixType_) 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) + OUTPUT_PREFIX_TYPE_FIELD_NUMBER; hash = (53 * hash) + outputPrefixType_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.crypto.tink.proto.KeyTemplate parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.crypto.tink.proto.KeyTemplate 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.KeyTemplate parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.crypto.tink.proto.KeyTemplate 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.KeyTemplate parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.crypto.tink.proto.KeyTemplate 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.KeyTemplate parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.crypto.tink.proto.KeyTemplate 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.KeyTemplate parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.crypto.tink.proto.KeyTemplate 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.KeyTemplate 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.KeyTemplate 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.KeyTemplate 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; } /** * Protobuf type {@code google.crypto.tink.KeyTemplate} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.crypto.tink.KeyTemplate) com.google.crypto.tink.proto.KeyTemplateOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyTemplate_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.crypto.tink.proto.Tink.internal_static_google_crypto_tink_KeyTemplate_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.crypto.tink.proto.KeyTemplate.class, com.google.crypto.tink.proto.KeyTemplate.Builder.class); } // Construct using com.google.crypto.tink.proto.KeyTemplate.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; outputPrefixType_ = 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_KeyTemplate_descriptor; } @java.lang.Override public com.google.crypto.tink.proto.KeyTemplate getDefaultInstanceForType() { return com.google.crypto.tink.proto.KeyTemplate.getDefaultInstance(); } @java.lang.Override public com.google.crypto.tink.proto.KeyTemplate build() { com.google.crypto.tink.proto.KeyTemplate result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.crypto.tink.proto.KeyTemplate buildPartial() { com.google.crypto.tink.proto.KeyTemplate result = new com.google.crypto.tink.proto.KeyTemplate(this); result.typeUrl_ = typeUrl_; result.value_ = value_; result.outputPrefixType_ = outputPrefixType_; 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.KeyTemplate) { return mergeFrom((com.google.crypto.tink.proto.KeyTemplate)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.crypto.tink.proto.KeyTemplate other) { if (other == com.google.crypto.tink.proto.KeyTemplate.getDefaultInstance()) return this; if (!other.getTypeUrl().isEmpty()) { typeUrl_ = other.typeUrl_; onChanged(); } if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { setValue(other.getValue()); } if (other.outputPrefixType_ != 0) { setOutputPrefixTypeValue(other.getOutputPrefixTypeValue()); } 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: { outputPrefixType_ = 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. The type_url of the key type in format
     * type.googleapis.com/packagename.messagename -- see above for details.
     * This is typically the protobuf type URL of the *Key proto. In particular,
     * this is different of the protobuf type URL of the *KeyFormat proto.
     * 
* * 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. The type_url of the key type in format
     * type.googleapis.com/packagename.messagename -- see above for details.
     * This is typically the protobuf type URL of the *Key proto. In particular,
     * this is different of the protobuf type URL of the *KeyFormat proto.
     * 
* * 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. The type_url of the key type in format
     * type.googleapis.com/packagename.messagename -- see above for details.
     * This is typically the protobuf type URL of the *Key proto. In particular,
     * this is different of the protobuf type URL of the *KeyFormat proto.
     * 
* * 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. The type_url of the key type in format
     * type.googleapis.com/packagename.messagename -- see above for details.
     * This is typically the protobuf type URL of the *Key proto. In particular,
     * this is different of the protobuf type URL of the *KeyFormat proto.
     * 
* * string type_url = 1; * @return This builder for chaining. */ public Builder clearTypeUrl() { typeUrl_ = getDefaultInstance().getTypeUrl(); onChanged(); return this; } /** *
     * Required. The type_url of the key type in format
     * type.googleapis.com/packagename.messagename -- see above for details.
     * This is typically the protobuf type URL of the *Key proto. In particular,
     * this is different of the protobuf type URL of the *KeyFormat proto.
     * 
* * 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. The serialized *KeyFormat proto.
     * 
* * bytes value = 2; * @return The value. */ @java.lang.Override public com.google.protobuf.ByteString getValue() { return value_; } /** *
     * Required. The serialized *KeyFormat proto.
     * 
* * bytes value = 2; * @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. The serialized *KeyFormat proto.
     * 
* * bytes value = 2; * @return This builder for chaining. */ public Builder clearValue() { value_ = getDefaultInstance().getValue(); onChanged(); return this; } private int outputPrefixType_ = 0; /** *
     * Required. The type of prefix used when computing some primitives to
     * identify the ciphertext/signature, etc.
     * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @return The enum numeric value on the wire for outputPrefixType. */ @java.lang.Override public int getOutputPrefixTypeValue() { return outputPrefixType_; } /** *
     * Required. The type of prefix used when computing some primitives to
     * identify the ciphertext/signature, etc.
     * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @param value The enum numeric value on the wire for outputPrefixType to set. * @return This builder for chaining. */ public Builder setOutputPrefixTypeValue(int value) { outputPrefixType_ = value; onChanged(); return this; } /** *
     * Required. The type of prefix used when computing some primitives to
     * identify the ciphertext/signature, etc.
     * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @return The outputPrefixType. */ @java.lang.Override public com.google.crypto.tink.proto.OutputPrefixType getOutputPrefixType() { @SuppressWarnings("deprecation") com.google.crypto.tink.proto.OutputPrefixType result = com.google.crypto.tink.proto.OutputPrefixType.valueOf(outputPrefixType_); return result == null ? com.google.crypto.tink.proto.OutputPrefixType.UNRECOGNIZED : result; } /** *
     * Required. The type of prefix used when computing some primitives to
     * identify the ciphertext/signature, etc.
     * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @param value The outputPrefixType to set. * @return This builder for chaining. */ public Builder setOutputPrefixType(com.google.crypto.tink.proto.OutputPrefixType value) { if (value == null) { throw new NullPointerException(); } outputPrefixType_ = value.getNumber(); onChanged(); return this; } /** *
     * Required. The type of prefix used when computing some primitives to
     * identify the ciphertext/signature, etc.
     * 
* * .google.crypto.tink.OutputPrefixType output_prefix_type = 3; * @return This builder for chaining. */ public Builder clearOutputPrefixType() { outputPrefixType_ = 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.KeyTemplate) } // @@protoc_insertion_point(class_scope:google.crypto.tink.KeyTemplate) private static final com.google.crypto.tink.proto.KeyTemplate DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.crypto.tink.proto.KeyTemplate(); } public static com.google.crypto.tink.proto.KeyTemplate getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public KeyTemplate 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.KeyTemplate getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy