X509CertificateChain.java

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: sigstore_common.proto
// Protobuf Java Version: 4.30.2

package dev.sigstore.proto.common.v1;

/**
 * <pre>
 * A collection of X.509 certificates.
 *
 * This "chain" can be used in multiple contexts, such as providing a root CA
 * certificate within a TUF root of trust or multiple untrusted certificates for
 * the purpose of chain building.
 * </pre>
 *
 * Protobuf type {@code dev.sigstore.common.v1.X509CertificateChain}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:X509CertificateChain.java.pb.meta")
public final class X509CertificateChain extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:dev.sigstore.common.v1.X509CertificateChain)
    X509CertificateChainOrBuilder {
private static final long serialVersionUID = 0L;
  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
      /* major= */ 4,
      /* minor= */ 30,
      /* patch= */ 2,
      /* suffix= */ "",
      X509CertificateChain.class.getName());
  }
  // Use X509CertificateChain.newBuilder() to construct.
  private X509CertificateChain(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }
  private X509CertificateChain() {
    certificates_ = java.util.Collections.emptyList();
  }

  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_X509CertificateChain_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_X509CertificateChain_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            dev.sigstore.proto.common.v1.X509CertificateChain.class, dev.sigstore.proto.common.v1.X509CertificateChain.Builder.class);
  }

  public static final int CERTIFICATES_FIELD_NUMBER = 1;
  @SuppressWarnings("serial")
  private java.util.List<dev.sigstore.proto.common.v1.X509Certificate> certificates_;
  /**
   * <pre>
   * One or more DER-encoded certificates.
   *
   * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
   * has an imposed order. Unless explicitly specified, there is otherwise no
   * guaranteed order.
   * </pre>
   *
   * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
   */
  @java.lang.Override
  public java.util.List<dev.sigstore.proto.common.v1.X509Certificate> getCertificatesList() {
    return certificates_;
  }
  /**
   * <pre>
   * One or more DER-encoded certificates.
   *
   * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
   * has an imposed order. Unless explicitly specified, there is otherwise no
   * guaranteed order.
   * </pre>
   *
   * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends dev.sigstore.proto.common.v1.X509CertificateOrBuilder> 
      getCertificatesOrBuilderList() {
    return certificates_;
  }
  /**
   * <pre>
   * One or more DER-encoded certificates.
   *
   * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
   * has an imposed order. Unless explicitly specified, there is otherwise no
   * guaranteed order.
   * </pre>
   *
   * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
   */
  @java.lang.Override
  public int getCertificatesCount() {
    return certificates_.size();
  }
  /**
   * <pre>
   * One or more DER-encoded certificates.
   *
   * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
   * has an imposed order. Unless explicitly specified, there is otherwise no
   * guaranteed order.
   * </pre>
   *
   * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.X509Certificate getCertificates(int index) {
    return certificates_.get(index);
  }
  /**
   * <pre>
   * One or more DER-encoded certificates.
   *
   * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
   * has an imposed order. Unless explicitly specified, there is otherwise no
   * guaranteed order.
   * </pre>
   *
   * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.X509CertificateOrBuilder getCertificatesOrBuilder(
      int index) {
    return certificates_.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 < certificates_.size(); i++) {
      output.writeMessage(1, certificates_.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 < certificates_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, certificates_.get(i));
    }
    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 dev.sigstore.proto.common.v1.X509CertificateChain)) {
      return super.equals(obj);
    }
    dev.sigstore.proto.common.v1.X509CertificateChain other = (dev.sigstore.proto.common.v1.X509CertificateChain) obj;

    if (!getCertificatesList()
        .equals(other.getCertificatesList())) 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 (getCertificatesCount() > 0) {
      hash = (37 * hash) + CERTIFICATES_FIELD_NUMBER;
      hash = (53 * hash) + getCertificatesList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public static dev.sigstore.proto.common.v1.X509CertificateChain parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static dev.sigstore.proto.common.v1.X509CertificateChain parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.common.v1.X509CertificateChain parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(dev.sigstore.proto.common.v1.X509CertificateChain 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.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * A collection of X.509 certificates.
   *
   * This "chain" can be used in multiple contexts, such as providing a root CA
   * certificate within a TUF root of trust or multiple untrusted certificates for
   * the purpose of chain building.
   * </pre>
   *
   * Protobuf type {@code dev.sigstore.common.v1.X509CertificateChain}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:dev.sigstore.common.v1.X509CertificateChain)
      dev.sigstore.proto.common.v1.X509CertificateChainOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_X509CertificateChain_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_X509CertificateChain_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              dev.sigstore.proto.common.v1.X509CertificateChain.class, dev.sigstore.proto.common.v1.X509CertificateChain.Builder.class);
    }

    // Construct using dev.sigstore.proto.common.v1.X509CertificateChain.newBuilder()
    private Builder() {

    }

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

    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      if (certificatesBuilder_ == null) {
        certificates_ = java.util.Collections.emptyList();
      } else {
        certificates_ = null;
        certificatesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_X509CertificateChain_descriptor;
    }

    @java.lang.Override
    public dev.sigstore.proto.common.v1.X509CertificateChain getDefaultInstanceForType() {
      return dev.sigstore.proto.common.v1.X509CertificateChain.getDefaultInstance();
    }

    @java.lang.Override
    public dev.sigstore.proto.common.v1.X509CertificateChain build() {
      dev.sigstore.proto.common.v1.X509CertificateChain result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public dev.sigstore.proto.common.v1.X509CertificateChain buildPartial() {
      dev.sigstore.proto.common.v1.X509CertificateChain result = new dev.sigstore.proto.common.v1.X509CertificateChain(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) { buildPartial0(result); }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(dev.sigstore.proto.common.v1.X509CertificateChain result) {
      if (certificatesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          certificates_ = java.util.Collections.unmodifiableList(certificates_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.certificates_ = certificates_;
      } else {
        result.certificates_ = certificatesBuilder_.build();
      }
    }

    private void buildPartial0(dev.sigstore.proto.common.v1.X509CertificateChain result) {
      int from_bitField0_ = bitField0_;
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof dev.sigstore.proto.common.v1.X509CertificateChain) {
        return mergeFrom((dev.sigstore.proto.common.v1.X509CertificateChain)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(dev.sigstore.proto.common.v1.X509CertificateChain other) {
      if (other == dev.sigstore.proto.common.v1.X509CertificateChain.getDefaultInstance()) return this;
      if (certificatesBuilder_ == null) {
        if (!other.certificates_.isEmpty()) {
          if (certificates_.isEmpty()) {
            certificates_ = other.certificates_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureCertificatesIsMutable();
            certificates_.addAll(other.certificates_);
          }
          onChanged();
        }
      } else {
        if (!other.certificates_.isEmpty()) {
          if (certificatesBuilder_.isEmpty()) {
            certificatesBuilder_.dispose();
            certificatesBuilder_ = null;
            certificates_ = other.certificates_;
            bitField0_ = (bitField0_ & ~0x00000001);
            certificatesBuilder_ = 
              com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                 internalGetCertificatesFieldBuilder() : null;
          } else {
            certificatesBuilder_.addAllMessages(other.certificates_);
          }
        }
      }
      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: {
              dev.sigstore.proto.common.v1.X509Certificate m =
                  input.readMessage(
                      dev.sigstore.proto.common.v1.X509Certificate.parser(),
                      extensionRegistry);
              if (certificatesBuilder_ == null) {
                ensureCertificatesIsMutable();
                certificates_.add(m);
              } else {
                certificatesBuilder_.addMessage(m);
              }
              break;
            } // case 10
            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<dev.sigstore.proto.common.v1.X509Certificate> certificates_ =
      java.util.Collections.emptyList();
    private void ensureCertificatesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        certificates_ = new java.util.ArrayList<dev.sigstore.proto.common.v1.X509Certificate>(certificates_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilder<
        dev.sigstore.proto.common.v1.X509Certificate, dev.sigstore.proto.common.v1.X509Certificate.Builder, dev.sigstore.proto.common.v1.X509CertificateOrBuilder> certificatesBuilder_;

    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public java.util.List<dev.sigstore.proto.common.v1.X509Certificate> getCertificatesList() {
      if (certificatesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(certificates_);
      } else {
        return certificatesBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public int getCertificatesCount() {
      if (certificatesBuilder_ == null) {
        return certificates_.size();
      } else {
        return certificatesBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public dev.sigstore.proto.common.v1.X509Certificate getCertificates(int index) {
      if (certificatesBuilder_ == null) {
        return certificates_.get(index);
      } else {
        return certificatesBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder setCertificates(
        int index, dev.sigstore.proto.common.v1.X509Certificate value) {
      if (certificatesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCertificatesIsMutable();
        certificates_.set(index, value);
        onChanged();
      } else {
        certificatesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder setCertificates(
        int index, dev.sigstore.proto.common.v1.X509Certificate.Builder builderForValue) {
      if (certificatesBuilder_ == null) {
        ensureCertificatesIsMutable();
        certificates_.set(index, builderForValue.build());
        onChanged();
      } else {
        certificatesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder addCertificates(dev.sigstore.proto.common.v1.X509Certificate value) {
      if (certificatesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCertificatesIsMutable();
        certificates_.add(value);
        onChanged();
      } else {
        certificatesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder addCertificates(
        int index, dev.sigstore.proto.common.v1.X509Certificate value) {
      if (certificatesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCertificatesIsMutable();
        certificates_.add(index, value);
        onChanged();
      } else {
        certificatesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder addCertificates(
        dev.sigstore.proto.common.v1.X509Certificate.Builder builderForValue) {
      if (certificatesBuilder_ == null) {
        ensureCertificatesIsMutable();
        certificates_.add(builderForValue.build());
        onChanged();
      } else {
        certificatesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder addCertificates(
        int index, dev.sigstore.proto.common.v1.X509Certificate.Builder builderForValue) {
      if (certificatesBuilder_ == null) {
        ensureCertificatesIsMutable();
        certificates_.add(index, builderForValue.build());
        onChanged();
      } else {
        certificatesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder addAllCertificates(
        java.lang.Iterable<? extends dev.sigstore.proto.common.v1.X509Certificate> values) {
      if (certificatesBuilder_ == null) {
        ensureCertificatesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, certificates_);
        onChanged();
      } else {
        certificatesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder clearCertificates() {
      if (certificatesBuilder_ == null) {
        certificates_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        certificatesBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public Builder removeCertificates(int index) {
      if (certificatesBuilder_ == null) {
        ensureCertificatesIsMutable();
        certificates_.remove(index);
        onChanged();
      } else {
        certificatesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public dev.sigstore.proto.common.v1.X509Certificate.Builder getCertificatesBuilder(
        int index) {
      return internalGetCertificatesFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public dev.sigstore.proto.common.v1.X509CertificateOrBuilder getCertificatesOrBuilder(
        int index) {
      if (certificatesBuilder_ == null) {
        return certificates_.get(index);  } else {
        return certificatesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public java.util.List<? extends dev.sigstore.proto.common.v1.X509CertificateOrBuilder> 
         getCertificatesOrBuilderList() {
      if (certificatesBuilder_ != null) {
        return certificatesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(certificates_);
      }
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public dev.sigstore.proto.common.v1.X509Certificate.Builder addCertificatesBuilder() {
      return internalGetCertificatesFieldBuilder().addBuilder(
          dev.sigstore.proto.common.v1.X509Certificate.getDefaultInstance());
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public dev.sigstore.proto.common.v1.X509Certificate.Builder addCertificatesBuilder(
        int index) {
      return internalGetCertificatesFieldBuilder().addBuilder(
          index, dev.sigstore.proto.common.v1.X509Certificate.getDefaultInstance());
    }
    /**
     * <pre>
     * One or more DER-encoded certificates.
     *
     * In some contexts (such as `VerificationMaterial.x509_certificate_chain`), this sequence
     * has an imposed order. Unless explicitly specified, there is otherwise no
     * guaranteed order.
     * </pre>
     *
     * <code>repeated .dev.sigstore.common.v1.X509Certificate certificates = 1;</code>
     */
    public java.util.List<dev.sigstore.proto.common.v1.X509Certificate.Builder> 
         getCertificatesBuilderList() {
      return internalGetCertificatesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilder<
        dev.sigstore.proto.common.v1.X509Certificate, dev.sigstore.proto.common.v1.X509Certificate.Builder, dev.sigstore.proto.common.v1.X509CertificateOrBuilder> 
        internalGetCertificatesFieldBuilder() {
      if (certificatesBuilder_ == null) {
        certificatesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
            dev.sigstore.proto.common.v1.X509Certificate, dev.sigstore.proto.common.v1.X509Certificate.Builder, dev.sigstore.proto.common.v1.X509CertificateOrBuilder>(
                certificates_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        certificates_ = null;
      }
      return certificatesBuilder_;
    }

    // @@protoc_insertion_point(builder_scope:dev.sigstore.common.v1.X509CertificateChain)
  }

  // @@protoc_insertion_point(class_scope:dev.sigstore.common.v1.X509CertificateChain)
  private static final dev.sigstore.proto.common.v1.X509CertificateChain DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new dev.sigstore.proto.common.v1.X509CertificateChain();
  }

  public static dev.sigstore.proto.common.v1.X509CertificateChain getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public dev.sigstore.proto.common.v1.X509CertificateChain getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}