/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/confidentialcomputing/v1alpha1/service.proto

package com.google.cloud.confidentialcomputing.v1alpha1;

/**
 *
 *
 * <pre>
 * TPM2 data containing everything necessary to validate any platform state
 * measured into the TPM.
 * </pre>
 *
 * Protobuf type {@code google.cloud.confidentialcomputing.v1alpha1.TpmAttestation}
 */
public final class TpmAttestation extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation)
    TpmAttestationOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use TpmAttestation.newBuilder() to construct.
  private TpmAttestation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private TpmAttestation() {
    quotes_ = java.util.Collections.emptyList();
    tcgEventLog_ = com.google.protobuf.ByteString.EMPTY;
    canonicalEventLog_ = com.google.protobuf.ByteString.EMPTY;
    akCert_ = com.google.protobuf.ByteString.EMPTY;
    certChain_ = java.util.Collections.emptyList();
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
        .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
        .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.class,
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Builder.class);
  }

  public interface QuoteOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
     * </pre>
     *
     * <code>int32 hash_algo = 1;</code>
     *
     * @return The hashAlgo.
     */
    int getHashAlgo();

    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    int getPcrValuesCount();
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    boolean containsPcrValues(int key);
    /** Use {@link #getPcrValuesMap()} instead. */
    @java.lang.Deprecated
    java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getPcrValues();
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getPcrValuesMap();
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    /* nullable */
    com.google.protobuf.ByteString getPcrValuesOrDefault(
        int key,
        /* nullable */
        com.google.protobuf.ByteString defaultValue);
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    com.google.protobuf.ByteString getPcrValuesOrThrow(int key);

    /**
     *
     *
     * <pre>
     * TPM2 quote, encoded as a TPMS_ATTEST
     * </pre>
     *
     * <code>bytes raw_quote = 3;</code>
     *
     * @return The rawQuote.
     */
    com.google.protobuf.ByteString getRawQuote();

    /**
     *
     *
     * <pre>
     * TPM2 signature, encoded as a TPMT_SIGNATURE
     * </pre>
     *
     * <code>bytes raw_signature = 4;</code>
     *
     * @return The rawSignature.
     */
    com.google.protobuf.ByteString getRawSignature();
  }
  /**
   *
   *
   * <pre>
   * Information about Platform Control Registers (PCRs) including a signature
   * over their values, which can be used for remote validation.
   * </pre>
   *
   * Protobuf type {@code google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote}
   */
  public static final class Quote extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote)
      QuoteOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use Quote.newBuilder() to construct.
    private Quote(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Quote() {
      rawQuote_ = com.google.protobuf.ByteString.EMPTY;
      rawSignature_ = com.google.protobuf.ByteString.EMPTY;
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
          .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_Quote_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    @java.lang.Override
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 2:
          return internalGetPcrValues();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
          .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_Quote_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.class,
              com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder.class);
    }

    public static final int HASH_ALGO_FIELD_NUMBER = 1;
    private int hashAlgo_ = 0;
    /**
     *
     *
     * <pre>
     * The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
     * </pre>
     *
     * <code>int32 hash_algo = 1;</code>
     *
     * @return The hashAlgo.
     */
    @java.lang.Override
    public int getHashAlgo() {
      return hashAlgo_;
    }

    public static final int PCR_VALUES_FIELD_NUMBER = 2;

    private static final class PcrValuesDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<java.lang.Integer, com.google.protobuf.ByteString>
          defaultEntry =
              com.google.protobuf.MapEntry
                  .<java.lang.Integer, com.google.protobuf.ByteString>newDefaultInstance(
                      com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
                          .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_Quote_PcrValuesEntry_descriptor,
                      com.google.protobuf.WireFormat.FieldType.INT32,
                      0,
                      com.google.protobuf.WireFormat.FieldType.BYTES,
                      com.google.protobuf.ByteString.EMPTY);
    }

    @SuppressWarnings("serial")
    private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
        pcrValues_;

    private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
        internalGetPcrValues() {
      if (pcrValues_ == null) {
        return com.google.protobuf.MapField.emptyMapField(PcrValuesDefaultEntryHolder.defaultEntry);
      }
      return pcrValues_;
    }

    public int getPcrValuesCount() {
      return internalGetPcrValues().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    @java.lang.Override
    public boolean containsPcrValues(int key) {

      return internalGetPcrValues().getMap().containsKey(key);
    }
    /** Use {@link #getPcrValuesMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getPcrValues() {
      return getPcrValuesMap();
    }
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getPcrValuesMap() {
      return internalGetPcrValues().getMap();
    }
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    @java.lang.Override
    public /* nullable */ com.google.protobuf.ByteString getPcrValuesOrDefault(
        int key,
        /* nullable */
        com.google.protobuf.ByteString defaultValue) {

      java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> map =
          internalGetPcrValues().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Raw binary values of each PCRs being quoted.
     * </pre>
     *
     * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getPcrValuesOrThrow(int key) {

      java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> map =
          internalGetPcrValues().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public static final int RAW_QUOTE_FIELD_NUMBER = 3;
    private com.google.protobuf.ByteString rawQuote_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * TPM2 quote, encoded as a TPMS_ATTEST
     * </pre>
     *
     * <code>bytes raw_quote = 3;</code>
     *
     * @return The rawQuote.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getRawQuote() {
      return rawQuote_;
    }

    public static final int RAW_SIGNATURE_FIELD_NUMBER = 4;
    private com.google.protobuf.ByteString rawSignature_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * TPM2 signature, encoded as a TPMT_SIGNATURE
     * </pre>
     *
     * <code>bytes raw_signature = 4;</code>
     *
     * @return The rawSignature.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getRawSignature() {
      return rawSignature_;
    }

    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 (hashAlgo_ != 0) {
        output.writeInt32(1, hashAlgo_);
      }
      com.google.protobuf.GeneratedMessageV3.serializeIntegerMapTo(
          output, internalGetPcrValues(), PcrValuesDefaultEntryHolder.defaultEntry, 2);
      if (!rawQuote_.isEmpty()) {
        output.writeBytes(3, rawQuote_);
      }
      if (!rawSignature_.isEmpty()) {
        output.writeBytes(4, rawSignature_);
      }
      getUnknownFields().writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (hashAlgo_ != 0) {
        size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, hashAlgo_);
      }
      for (java.util.Map.Entry<java.lang.Integer, com.google.protobuf.ByteString> entry :
          internalGetPcrValues().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.Integer, com.google.protobuf.ByteString>
            pcrValues__ =
                PcrValuesDefaultEntryHolder.defaultEntry
                    .newBuilderForType()
                    .setKey(entry.getKey())
                    .setValue(entry.getValue())
                    .build();
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, pcrValues__);
      }
      if (!rawQuote_.isEmpty()) {
        size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, rawQuote_);
      }
      if (!rawSignature_.isEmpty()) {
        size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, rawSignature_);
      }
      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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote)) {
        return super.equals(obj);
      }
      com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote other =
          (com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote) obj;

      if (getHashAlgo() != other.getHashAlgo()) return false;
      if (!internalGetPcrValues().equals(other.internalGetPcrValues())) return false;
      if (!getRawQuote().equals(other.getRawQuote())) return false;
      if (!getRawSignature().equals(other.getRawSignature())) 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) + HASH_ALGO_FIELD_NUMBER;
      hash = (53 * hash) + getHashAlgo();
      if (!internalGetPcrValues().getMap().isEmpty()) {
        hash = (37 * hash) + PCR_VALUES_FIELD_NUMBER;
        hash = (53 * hash) + internalGetPcrValues().hashCode();
      }
      hash = (37 * hash) + RAW_QUOTE_FIELD_NUMBER;
      hash = (53 * hash) + getRawQuote().hashCode();
      hash = (37 * hash) + RAW_SIGNATURE_FIELD_NUMBER;
      hash = (53 * hash) + getRawSignature().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
        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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote 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;
    }
    /**
     *
     *
     * <pre>
     * Information about Platform Control Registers (PCRs) including a signature
     * over their values, which can be used for remote validation.
     * </pre>
     *
     * Protobuf type {@code google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote)
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
            .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_Quote_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(int number) {
        switch (number) {
          case 2:
            return internalGetPcrValues();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
        switch (number) {
          case 2:
            return internalGetMutablePcrValues();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
            .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_Quote_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.class,
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder.class);
      }

      // Construct using
      // com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.newBuilder()
      private Builder() {}

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        hashAlgo_ = 0;
        internalGetMutablePcrValues().clear();
        rawQuote_ = com.google.protobuf.ByteString.EMPTY;
        rawSignature_ = com.google.protobuf.ByteString.EMPTY;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
            .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_Quote_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
          getDefaultInstanceForType() {
        return com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote build() {
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote buildPartial() {
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote result =
            new com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.hashAlgo_ = hashAlgo_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.pcrValues_ = internalGetPcrValues();
          result.pcrValues_.makeImmutable();
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.rawQuote_ = rawQuote_;
        }
        if (((from_bitField0_ & 0x00000008) != 0)) {
          result.rawSignature_ = rawSignature_;
        }
      }

      @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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote) {
          return mergeFrom(
              (com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote other) {
        if (other
            == com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
                .getDefaultInstance()) return this;
        if (other.getHashAlgo() != 0) {
          setHashAlgo(other.getHashAlgo());
        }
        internalGetMutablePcrValues().mergeFrom(other.internalGetPcrValues());
        bitField0_ |= 0x00000002;
        if (other.getRawQuote() != com.google.protobuf.ByteString.EMPTY) {
          setRawQuote(other.getRawQuote());
        }
        if (other.getRawSignature() != com.google.protobuf.ByteString.EMPTY) {
          setRawSignature(other.getRawSignature());
        }
        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 8:
                {
                  hashAlgo_ = input.readInt32();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 8
              case 18:
                {
                  com.google.protobuf.MapEntry<java.lang.Integer, com.google.protobuf.ByteString>
                      pcrValues__ =
                          input.readMessage(
                              PcrValuesDefaultEntryHolder.defaultEntry.getParserForType(),
                              extensionRegistry);
                  internalGetMutablePcrValues()
                      .getMutableMap()
                      .put(pcrValues__.getKey(), pcrValues__.getValue());
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              case 26:
                {
                  rawQuote_ = input.readBytes();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 26
              case 34:
                {
                  rawSignature_ = input.readBytes();
                  bitField0_ |= 0x00000008;
                  break;
                } // case 34
              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 int bitField0_;

      private int hashAlgo_;
      /**
       *
       *
       * <pre>
       * The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
       * </pre>
       *
       * <code>int32 hash_algo = 1;</code>
       *
       * @return The hashAlgo.
       */
      @java.lang.Override
      public int getHashAlgo() {
        return hashAlgo_;
      }
      /**
       *
       *
       * <pre>
       * The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
       * </pre>
       *
       * <code>int32 hash_algo = 1;</code>
       *
       * @param value The hashAlgo to set.
       * @return This builder for chaining.
       */
      public Builder setHashAlgo(int value) {

        hashAlgo_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The hash algorithm of the PCR bank being quoted, encoded as a TPM_ALG_ID
       * </pre>
       *
       * <code>int32 hash_algo = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearHashAlgo() {
        bitField0_ = (bitField0_ & ~0x00000001);
        hashAlgo_ = 0;
        onChanged();
        return this;
      }

      private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
          pcrValues_;

      private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
          internalGetPcrValues() {
        if (pcrValues_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              PcrValuesDefaultEntryHolder.defaultEntry);
        }
        return pcrValues_;
      }

      private com.google.protobuf.MapField<java.lang.Integer, com.google.protobuf.ByteString>
          internalGetMutablePcrValues() {
        if (pcrValues_ == null) {
          pcrValues_ =
              com.google.protobuf.MapField.newMapField(PcrValuesDefaultEntryHolder.defaultEntry);
        }
        if (!pcrValues_.isMutable()) {
          pcrValues_ = pcrValues_.copy();
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return pcrValues_;
      }

      public int getPcrValuesCount() {
        return internalGetPcrValues().getMap().size();
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      @java.lang.Override
      public boolean containsPcrValues(int key) {

        return internalGetPcrValues().getMap().containsKey(key);
      }
      /** Use {@link #getPcrValuesMap()} instead. */
      @java.lang.Override
      @java.lang.Deprecated
      public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getPcrValues() {
        return getPcrValuesMap();
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      @java.lang.Override
      public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> getPcrValuesMap() {
        return internalGetPcrValues().getMap();
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      @java.lang.Override
      public /* nullable */ com.google.protobuf.ByteString getPcrValuesOrDefault(
          int key,
          /* nullable */
          com.google.protobuf.ByteString defaultValue) {

        java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> map =
            internalGetPcrValues().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      @java.lang.Override
      public com.google.protobuf.ByteString getPcrValuesOrThrow(int key) {

        java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> map =
            internalGetPcrValues().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearPcrValues() {
        bitField0_ = (bitField0_ & ~0x00000002);
        internalGetMutablePcrValues().getMutableMap().clear();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      public Builder removePcrValues(int key) {

        internalGetMutablePcrValues().getMutableMap().remove(key);
        return this;
      }
      /** Use alternate mutation accessors instead. */
      @java.lang.Deprecated
      public java.util.Map<java.lang.Integer, com.google.protobuf.ByteString>
          getMutablePcrValues() {
        bitField0_ |= 0x00000002;
        return internalGetMutablePcrValues().getMutableMap();
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      public Builder putPcrValues(int key, com.google.protobuf.ByteString value) {

        if (value == null) {
          throw new NullPointerException("map value");
        }
        internalGetMutablePcrValues().getMutableMap().put(key, value);
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       *
       *
       * <pre>
       * Raw binary values of each PCRs being quoted.
       * </pre>
       *
       * <code>map&lt;int32, bytes&gt; pcr_values = 2;</code>
       */
      public Builder putAllPcrValues(
          java.util.Map<java.lang.Integer, com.google.protobuf.ByteString> values) {
        internalGetMutablePcrValues().getMutableMap().putAll(values);
        bitField0_ |= 0x00000002;
        return this;
      }

      private com.google.protobuf.ByteString rawQuote_ = com.google.protobuf.ByteString.EMPTY;
      /**
       *
       *
       * <pre>
       * TPM2 quote, encoded as a TPMS_ATTEST
       * </pre>
       *
       * <code>bytes raw_quote = 3;</code>
       *
       * @return The rawQuote.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString getRawQuote() {
        return rawQuote_;
      }
      /**
       *
       *
       * <pre>
       * TPM2 quote, encoded as a TPMS_ATTEST
       * </pre>
       *
       * <code>bytes raw_quote = 3;</code>
       *
       * @param value The rawQuote to set.
       * @return This builder for chaining.
       */
      public Builder setRawQuote(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        rawQuote_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * TPM2 quote, encoded as a TPMS_ATTEST
       * </pre>
       *
       * <code>bytes raw_quote = 3;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearRawQuote() {
        bitField0_ = (bitField0_ & ~0x00000004);
        rawQuote_ = getDefaultInstance().getRawQuote();
        onChanged();
        return this;
      }

      private com.google.protobuf.ByteString rawSignature_ = com.google.protobuf.ByteString.EMPTY;
      /**
       *
       *
       * <pre>
       * TPM2 signature, encoded as a TPMT_SIGNATURE
       * </pre>
       *
       * <code>bytes raw_signature = 4;</code>
       *
       * @return The rawSignature.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString getRawSignature() {
        return rawSignature_;
      }
      /**
       *
       *
       * <pre>
       * TPM2 signature, encoded as a TPMT_SIGNATURE
       * </pre>
       *
       * <code>bytes raw_signature = 4;</code>
       *
       * @param value The rawSignature to set.
       * @return This builder for chaining.
       */
      public Builder setRawSignature(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        rawSignature_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * TPM2 signature, encoded as a TPMT_SIGNATURE
       * </pre>
       *
       * <code>bytes raw_signature = 4;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearRawSignature() {
        bitField0_ = (bitField0_ & ~0x00000008);
        rawSignature_ = getDefaultInstance().getRawSignature();
        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.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote)
    private static final com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote();
    }

    public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<Quote> PARSER =
        new com.google.protobuf.AbstractParser<Quote>() {
          @java.lang.Override
          public Quote 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<Quote> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<Quote> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public static final int QUOTES_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote>
      quotes_;
  /**
   *
   *
   * <pre>
   * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
   * </pre>
   *
   * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote>
      getQuotesList() {
    return quotes_;
  }
  /**
   *
   *
   * <pre>
   * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
   * </pre>
   *
   * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
   * </code>
   */
  @java.lang.Override
  public java.util.List<
          ? extends com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder>
      getQuotesOrBuilderList() {
    return quotes_;
  }
  /**
   *
   *
   * <pre>
   * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
   * </pre>
   *
   * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
   * </code>
   */
  @java.lang.Override
  public int getQuotesCount() {
    return quotes_.size();
  }
  /**
   *
   *
   * <pre>
   * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
   * </pre>
   *
   * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote getQuotes(int index) {
    return quotes_.get(index);
  }
  /**
   *
   *
   * <pre>
   * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
   * </pre>
   *
   * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder
      getQuotesOrBuilder(int index) {
    return quotes_.get(index);
  }

  public static final int TCG_EVENT_LOG_FIELD_NUMBER = 2;
  private com.google.protobuf.ByteString tcgEventLog_ = com.google.protobuf.ByteString.EMPTY;
  /**
   *
   *
   * <pre>
   * The binary TCG Event Log containing events measured into the TPM by the
   * platform firmware and operating system. Formatted as described in the
   * "TCG PC Client Platform Firmware Profile Specification".
   * </pre>
   *
   * <code>bytes tcg_event_log = 2;</code>
   *
   * @return The tcgEventLog.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTcgEventLog() {
    return tcgEventLog_;
  }

  public static final int CANONICAL_EVENT_LOG_FIELD_NUMBER = 3;
  private com.google.protobuf.ByteString canonicalEventLog_ = com.google.protobuf.ByteString.EMPTY;
  /**
   *
   *
   * <pre>
   * An Event Log containing additional events measured into the TPM that are
   * not already present in the tcg_event_log. Formatted as described in the
   * "Canonical Event Log Format" TCG Specification.
   * </pre>
   *
   * <code>bytes canonical_event_log = 3;</code>
   *
   * @return The canonicalEventLog.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getCanonicalEventLog() {
    return canonicalEventLog_;
  }

  public static final int AK_CERT_FIELD_NUMBER = 4;
  private com.google.protobuf.ByteString akCert_ = com.google.protobuf.ByteString.EMPTY;
  /**
   *
   *
   * <pre>
   * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
   * an AK or a TPM restricted signing key) used to generate the quotes.
   * </pre>
   *
   * <code>bytes ak_cert = 4;</code>
   *
   * @return The akCert.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getAkCert() {
    return akCert_;
  }

  public static final int CERT_CHAIN_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private java.util.List<com.google.protobuf.ByteString> certChain_;
  /**
   *
   *
   * <pre>
   * List of DER-encoded X.509 certificates which, together with the ak_cert,
   * chain back to a trusted Root Certificate.
   * </pre>
   *
   * <code>repeated bytes cert_chain = 5;</code>
   *
   * @return A list containing the certChain.
   */
  @java.lang.Override
  public java.util.List<com.google.protobuf.ByteString> getCertChainList() {
    return certChain_;
  }
  /**
   *
   *
   * <pre>
   * List of DER-encoded X.509 certificates which, together with the ak_cert,
   * chain back to a trusted Root Certificate.
   * </pre>
   *
   * <code>repeated bytes cert_chain = 5;</code>
   *
   * @return The count of certChain.
   */
  public int getCertChainCount() {
    return certChain_.size();
  }
  /**
   *
   *
   * <pre>
   * List of DER-encoded X.509 certificates which, together with the ak_cert,
   * chain back to a trusted Root Certificate.
   * </pre>
   *
   * <code>repeated bytes cert_chain = 5;</code>
   *
   * @param index The index of the element to return.
   * @return The certChain at the given index.
   */
  public com.google.protobuf.ByteString getCertChain(int index) {
    return certChain_.get(index);
  }

  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 {
    for (int i = 0; i < quotes_.size(); i++) {
      output.writeMessage(1, quotes_.get(i));
    }
    if (!tcgEventLog_.isEmpty()) {
      output.writeBytes(2, tcgEventLog_);
    }
    if (!canonicalEventLog_.isEmpty()) {
      output.writeBytes(3, canonicalEventLog_);
    }
    if (!akCert_.isEmpty()) {
      output.writeBytes(4, akCert_);
    }
    for (int i = 0; i < certChain_.size(); i++) {
      output.writeBytes(5, certChain_.get(i));
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < quotes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, quotes_.get(i));
    }
    if (!tcgEventLog_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, tcgEventLog_);
    }
    if (!canonicalEventLog_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, canonicalEventLog_);
    }
    if (!akCert_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, akCert_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < certChain_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(certChain_.get(i));
      }
      size += dataSize;
      size += 1 * getCertChainList().size();
    }
    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.cloud.confidentialcomputing.v1alpha1.TpmAttestation)) {
      return super.equals(obj);
    }
    com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation other =
        (com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation) obj;

    if (!getQuotesList().equals(other.getQuotesList())) return false;
    if (!getTcgEventLog().equals(other.getTcgEventLog())) return false;
    if (!getCanonicalEventLog().equals(other.getCanonicalEventLog())) return false;
    if (!getAkCert().equals(other.getAkCert())) return false;
    if (!getCertChainList().equals(other.getCertChainList())) 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();
    if (getQuotesCount() > 0) {
      hash = (37 * hash) + QUOTES_FIELD_NUMBER;
      hash = (53 * hash) + getQuotesList().hashCode();
    }
    hash = (37 * hash) + TCG_EVENT_LOG_FIELD_NUMBER;
    hash = (53 * hash) + getTcgEventLog().hashCode();
    hash = (37 * hash) + CANONICAL_EVENT_LOG_FIELD_NUMBER;
    hash = (53 * hash) + getCanonicalEventLog().hashCode();
    hash = (37 * hash) + AK_CERT_FIELD_NUMBER;
    hash = (53 * hash) + getAkCert().hashCode();
    if (getCertChainCount() > 0) {
      hash = (37 * hash) + CERT_CHAIN_FIELD_NUMBER;
      hash = (53 * hash) + getCertChainList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation 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.cloud.confidentialcomputing.v1alpha1.TpmAttestation 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;
  }
  /**
   *
   *
   * <pre>
   * TPM2 data containing everything necessary to validate any platform state
   * measured into the TPM.
   * </pre>
   *
   * Protobuf type {@code google.cloud.confidentialcomputing.v1alpha1.TpmAttestation}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation)
      com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestationOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
          .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
          .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.class,
              com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Builder.class);
    }

    // Construct using com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (quotesBuilder_ == null) {
        quotes_ = java.util.Collections.emptyList();
      } else {
        quotes_ = null;
        quotesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      tcgEventLog_ = com.google.protobuf.ByteString.EMPTY;
      canonicalEventLog_ = com.google.protobuf.ByteString.EMPTY;
      akCert_ = com.google.protobuf.ByteString.EMPTY;
      certChain_ = java.util.Collections.emptyList();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.confidentialcomputing.v1alpha1.ServiceProto
          .internal_static_google_cloud_confidentialcomputing_v1alpha1_TpmAttestation_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation
        getDefaultInstanceForType() {
      return com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation build() {
      com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation buildPartial() {
      com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation result =
          new com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation result) {
      if (quotesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          quotes_ = java.util.Collections.unmodifiableList(quotes_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.quotes_ = quotes_;
      } else {
        result.quotes_ = quotesBuilder_.build();
      }
      if (((bitField0_ & 0x00000010) != 0)) {
        certChain_ = java.util.Collections.unmodifiableList(certChain_);
        bitField0_ = (bitField0_ & ~0x00000010);
      }
      result.certChain_ = certChain_;
    }

    private void buildPartial0(
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.tcgEventLog_ = tcgEventLog_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.canonicalEventLog_ = canonicalEventLog_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.akCert_ = akCert_;
      }
    }

    @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.cloud.confidentialcomputing.v1alpha1.TpmAttestation) {
        return mergeFrom((com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation other) {
      if (other
          == com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.getDefaultInstance())
        return this;
      if (quotesBuilder_ == null) {
        if (!other.quotes_.isEmpty()) {
          if (quotes_.isEmpty()) {
            quotes_ = other.quotes_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureQuotesIsMutable();
            quotes_.addAll(other.quotes_);
          }
          onChanged();
        }
      } else {
        if (!other.quotes_.isEmpty()) {
          if (quotesBuilder_.isEmpty()) {
            quotesBuilder_.dispose();
            quotesBuilder_ = null;
            quotes_ = other.quotes_;
            bitField0_ = (bitField0_ & ~0x00000001);
            quotesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getQuotesFieldBuilder()
                    : null;
          } else {
            quotesBuilder_.addAllMessages(other.quotes_);
          }
        }
      }
      if (other.getTcgEventLog() != com.google.protobuf.ByteString.EMPTY) {
        setTcgEventLog(other.getTcgEventLog());
      }
      if (other.getCanonicalEventLog() != com.google.protobuf.ByteString.EMPTY) {
        setCanonicalEventLog(other.getCanonicalEventLog());
      }
      if (other.getAkCert() != com.google.protobuf.ByteString.EMPTY) {
        setAkCert(other.getAkCert());
      }
      if (!other.certChain_.isEmpty()) {
        if (certChain_.isEmpty()) {
          certChain_ = other.certChain_;
          bitField0_ = (bitField0_ & ~0x00000010);
        } else {
          ensureCertChainIsMutable();
          certChain_.addAll(other.certChain_);
        }
        onChanged();
      }
      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:
              {
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote m =
                    input.readMessage(
                        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
                            .parser(),
                        extensionRegistry);
                if (quotesBuilder_ == null) {
                  ensureQuotesIsMutable();
                  quotes_.add(m);
                } else {
                  quotesBuilder_.addMessage(m);
                }
                break;
              } // case 10
            case 18:
              {
                tcgEventLog_ = input.readBytes();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                canonicalEventLog_ = input.readBytes();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                akCert_ = input.readBytes();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                com.google.protobuf.ByteString v = input.readBytes();
                ensureCertChainIsMutable();
                certChain_.add(v);
                break;
              } // case 42
            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 int bitField0_;

    private java.util.List<com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote>
        quotes_ = java.util.Collections.emptyList();

    private void ensureQuotesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        quotes_ =
            new java.util.ArrayList<
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote>(quotes_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote,
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder,
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder>
        quotesBuilder_;

    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public java.util.List<com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote>
        getQuotesList() {
      if (quotesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(quotes_);
      } else {
        return quotesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public int getQuotesCount() {
      if (quotesBuilder_ == null) {
        return quotes_.size();
      } else {
        return quotesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote getQuotes(
        int index) {
      if (quotesBuilder_ == null) {
        return quotes_.get(index);
      } else {
        return quotesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder setQuotes(
        int index, com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote value) {
      if (quotesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureQuotesIsMutable();
        quotes_.set(index, value);
        onChanged();
      } else {
        quotesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder setQuotes(
        int index,
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder
            builderForValue) {
      if (quotesBuilder_ == null) {
        ensureQuotesIsMutable();
        quotes_.set(index, builderForValue.build());
        onChanged();
      } else {
        quotesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder addQuotes(
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote value) {
      if (quotesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureQuotesIsMutable();
        quotes_.add(value);
        onChanged();
      } else {
        quotesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder addQuotes(
        int index, com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote value) {
      if (quotesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureQuotesIsMutable();
        quotes_.add(index, value);
        onChanged();
      } else {
        quotesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder addQuotes(
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder
            builderForValue) {
      if (quotesBuilder_ == null) {
        ensureQuotesIsMutable();
        quotes_.add(builderForValue.build());
        onChanged();
      } else {
        quotesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder addQuotes(
        int index,
        com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder
            builderForValue) {
      if (quotesBuilder_ == null) {
        ensureQuotesIsMutable();
        quotes_.add(index, builderForValue.build());
        onChanged();
      } else {
        quotesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder addAllQuotes(
        java.lang.Iterable<
                ? extends com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote>
            values) {
      if (quotesBuilder_ == null) {
        ensureQuotesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, quotes_);
        onChanged();
      } else {
        quotesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder clearQuotes() {
      if (quotesBuilder_ == null) {
        quotes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        quotesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public Builder removeQuotes(int index) {
      if (quotesBuilder_ == null) {
        ensureQuotesIsMutable();
        quotes_.remove(index);
        onChanged();
      } else {
        quotesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder
        getQuotesBuilder(int index) {
      return getQuotesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder
        getQuotesOrBuilder(int index) {
      if (quotesBuilder_ == null) {
        return quotes_.get(index);
      } else {
        return quotesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public java.util.List<
            ? extends com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder>
        getQuotesOrBuilderList() {
      if (quotesBuilder_ != null) {
        return quotesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(quotes_);
      }
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder
        addQuotesBuilder() {
      return getQuotesFieldBuilder()
          .addBuilder(
              com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
                  .getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder
        addQuotesBuilder(int index) {
      return getQuotesFieldBuilder()
          .addBuilder(
              index,
              com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote
                  .getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     * </pre>
     *
     * <code>repeated .google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote quotes = 1;
     * </code>
     */
    public java.util.List<
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder>
        getQuotesBuilderList() {
      return getQuotesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote,
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder,
            com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder>
        getQuotesFieldBuilder() {
      if (quotesBuilder_ == null) {
        quotesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote,
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.Quote.Builder,
                com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation.QuoteOrBuilder>(
                quotes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        quotes_ = null;
      }
      return quotesBuilder_;
    }

    private com.google.protobuf.ByteString tcgEventLog_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * The binary TCG Event Log containing events measured into the TPM by the
     * platform firmware and operating system. Formatted as described in the
     * "TCG PC Client Platform Firmware Profile Specification".
     * </pre>
     *
     * <code>bytes tcg_event_log = 2;</code>
     *
     * @return The tcgEventLog.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getTcgEventLog() {
      return tcgEventLog_;
    }
    /**
     *
     *
     * <pre>
     * The binary TCG Event Log containing events measured into the TPM by the
     * platform firmware and operating system. Formatted as described in the
     * "TCG PC Client Platform Firmware Profile Specification".
     * </pre>
     *
     * <code>bytes tcg_event_log = 2;</code>
     *
     * @param value The tcgEventLog to set.
     * @return This builder for chaining.
     */
    public Builder setTcgEventLog(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      tcgEventLog_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The binary TCG Event Log containing events measured into the TPM by the
     * platform firmware and operating system. Formatted as described in the
     * "TCG PC Client Platform Firmware Profile Specification".
     * </pre>
     *
     * <code>bytes tcg_event_log = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTcgEventLog() {
      bitField0_ = (bitField0_ & ~0x00000002);
      tcgEventLog_ = getDefaultInstance().getTcgEventLog();
      onChanged();
      return this;
    }

    private com.google.protobuf.ByteString canonicalEventLog_ =
        com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * An Event Log containing additional events measured into the TPM that are
     * not already present in the tcg_event_log. Formatted as described in the
     * "Canonical Event Log Format" TCG Specification.
     * </pre>
     *
     * <code>bytes canonical_event_log = 3;</code>
     *
     * @return The canonicalEventLog.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getCanonicalEventLog() {
      return canonicalEventLog_;
    }
    /**
     *
     *
     * <pre>
     * An Event Log containing additional events measured into the TPM that are
     * not already present in the tcg_event_log. Formatted as described in the
     * "Canonical Event Log Format" TCG Specification.
     * </pre>
     *
     * <code>bytes canonical_event_log = 3;</code>
     *
     * @param value The canonicalEventLog to set.
     * @return This builder for chaining.
     */
    public Builder setCanonicalEventLog(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      canonicalEventLog_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * An Event Log containing additional events measured into the TPM that are
     * not already present in the tcg_event_log. Formatted as described in the
     * "Canonical Event Log Format" TCG Specification.
     * </pre>
     *
     * <code>bytes canonical_event_log = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCanonicalEventLog() {
      bitField0_ = (bitField0_ & ~0x00000004);
      canonicalEventLog_ = getDefaultInstance().getCanonicalEventLog();
      onChanged();
      return this;
    }

    private com.google.protobuf.ByteString akCert_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     * an AK or a TPM restricted signing key) used to generate the quotes.
     * </pre>
     *
     * <code>bytes ak_cert = 4;</code>
     *
     * @return The akCert.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getAkCert() {
      return akCert_;
    }
    /**
     *
     *
     * <pre>
     * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     * an AK or a TPM restricted signing key) used to generate the quotes.
     * </pre>
     *
     * <code>bytes ak_cert = 4;</code>
     *
     * @param value The akCert to set.
     * @return This builder for chaining.
     */
    public Builder setAkCert(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      akCert_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     * an AK or a TPM restricted signing key) used to generate the quotes.
     * </pre>
     *
     * <code>bytes ak_cert = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAkCert() {
      bitField0_ = (bitField0_ & ~0x00000008);
      akCert_ = getDefaultInstance().getAkCert();
      onChanged();
      return this;
    }

    private java.util.List<com.google.protobuf.ByteString> certChain_ =
        java.util.Collections.emptyList();

    private void ensureCertChainIsMutable() {
      if (!((bitField0_ & 0x00000010) != 0)) {
        certChain_ = new java.util.ArrayList<com.google.protobuf.ByteString>(certChain_);
        bitField0_ |= 0x00000010;
      }
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @return A list containing the certChain.
     */
    public java.util.List<com.google.protobuf.ByteString> getCertChainList() {
      return ((bitField0_ & 0x00000010) != 0)
          ? java.util.Collections.unmodifiableList(certChain_)
          : certChain_;
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @return The count of certChain.
     */
    public int getCertChainCount() {
      return certChain_.size();
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @param index The index of the element to return.
     * @return The certChain at the given index.
     */
    public com.google.protobuf.ByteString getCertChain(int index) {
      return certChain_.get(index);
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @param index The index to set the value at.
     * @param value The certChain to set.
     * @return This builder for chaining.
     */
    public Builder setCertChain(int index, com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureCertChainIsMutable();
      certChain_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @param value The certChain to add.
     * @return This builder for chaining.
     */
    public Builder addCertChain(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureCertChainIsMutable();
      certChain_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @param values The certChain to add.
     * @return This builder for chaining.
     */
    public Builder addAllCertChain(
        java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {
      ensureCertChainIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certChain_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     * </pre>
     *
     * <code>repeated bytes cert_chain = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCertChain() {
      certChain_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000010);
      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.cloud.confidentialcomputing.v1alpha1.TpmAttestation)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.confidentialcomputing.v1alpha1.TpmAttestation)
  private static final com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation();
  }

  public static com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation
      getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<TpmAttestation> PARSER =
      new com.google.protobuf.AbstractParser<TpmAttestation>() {
        @java.lang.Override
        public TpmAttestation 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<TpmAttestation> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<TpmAttestation> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.confidentialcomputing.v1alpha1.TpmAttestation
      getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
