PublicKey.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;

/**
 * Protobuf type {@code dev.sigstore.common.v1.PublicKey}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:PublicKey.java.pb.meta")
public final class PublicKey extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:dev.sigstore.common.v1.PublicKey)
    PublicKeyOrBuilder {
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= */ "",
      PublicKey.class.getName());
  }
  // Use PublicKey.newBuilder() to construct.
  private PublicKey(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }
  private PublicKey() {
    rawBytes_ = com.google.protobuf.ByteString.EMPTY;
    keyDetails_ = 0;
  }

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

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

  private int bitField0_;
  public static final int RAW_BYTES_FIELD_NUMBER = 1;
  private com.google.protobuf.ByteString rawBytes_ = com.google.protobuf.ByteString.EMPTY;
  /**
   * <pre>
   * DER-encoded public key, encoding method is specified by the
   * key_details attribute.
   * </pre>
   *
   * <code>optional bytes raw_bytes = 1;</code>
   * @return Whether the rawBytes field is set.
   */
  @java.lang.Override
  public boolean hasRawBytes() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   * <pre>
   * DER-encoded public key, encoding method is specified by the
   * key_details attribute.
   * </pre>
   *
   * <code>optional bytes raw_bytes = 1;</code>
   * @return The rawBytes.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getRawBytes() {
    return rawBytes_;
  }

  public static final int KEY_DETAILS_FIELD_NUMBER = 2;
  private int keyDetails_ = 0;
  /**
   * <pre>
   * Key encoding and signature algorithm to use for this key.
   * </pre>
   *
   * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
   * @return The enum numeric value on the wire for keyDetails.
   */
  @java.lang.Override public int getKeyDetailsValue() {
    return keyDetails_;
  }
  /**
   * <pre>
   * Key encoding and signature algorithm to use for this key.
   * </pre>
   *
   * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
   * @return The keyDetails.
   */
  @java.lang.Override public dev.sigstore.proto.common.v1.PublicKeyDetails getKeyDetails() {
    dev.sigstore.proto.common.v1.PublicKeyDetails result = dev.sigstore.proto.common.v1.PublicKeyDetails.forNumber(keyDetails_);
    return result == null ? dev.sigstore.proto.common.v1.PublicKeyDetails.UNRECOGNIZED : result;
  }

  public static final int VALID_FOR_FIELD_NUMBER = 3;
  private dev.sigstore.proto.common.v1.TimeRange validFor_;
  /**
   * <pre>
   * Optional validity period for this key, *inclusive* of the endpoints.
   * </pre>
   *
   * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
   * @return Whether the validFor field is set.
   */
  @java.lang.Override
  public boolean hasValidFor() {
    return ((bitField0_ & 0x00000002) != 0);
  }
  /**
   * <pre>
   * Optional validity period for this key, *inclusive* of the endpoints.
   * </pre>
   *
   * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
   * @return The validFor.
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.TimeRange getValidFor() {
    return validFor_ == null ? dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
  }
  /**
   * <pre>
   * Optional validity period for this key, *inclusive* of the endpoints.
   * </pre>
   *
   * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.TimeRangeOrBuilder getValidForOrBuilder() {
    return validFor_ == null ? dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
  }

  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 (((bitField0_ & 0x00000001) != 0)) {
      output.writeBytes(1, rawBytes_);
    }
    if (keyDetails_ != dev.sigstore.proto.common.v1.PublicKeyDetails.PUBLIC_KEY_DETAILS_UNSPECIFIED.getNumber()) {
      output.writeEnum(2, keyDetails_);
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      output.writeMessage(3, getValidFor());
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeBytesSize(1, rawBytes_);
    }
    if (keyDetails_ != dev.sigstore.proto.common.v1.PublicKeyDetails.PUBLIC_KEY_DETAILS_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(2, keyDetails_);
    }
    if (((bitField0_ & 0x00000002) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getValidFor());
    }
    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.PublicKey)) {
      return super.equals(obj);
    }
    dev.sigstore.proto.common.v1.PublicKey other = (dev.sigstore.proto.common.v1.PublicKey) obj;

    if (hasRawBytes() != other.hasRawBytes()) return false;
    if (hasRawBytes()) {
      if (!getRawBytes()
          .equals(other.getRawBytes())) return false;
    }
    if (keyDetails_ != other.keyDetails_) return false;
    if (hasValidFor() != other.hasValidFor()) return false;
    if (hasValidFor()) {
      if (!getValidFor()
          .equals(other.getValidFor())) 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 (hasRawBytes()) {
      hash = (37 * hash) + RAW_BYTES_FIELD_NUMBER;
      hash = (53 * hash) + getRawBytes().hashCode();
    }
    hash = (37 * hash) + KEY_DETAILS_FIELD_NUMBER;
    hash = (53 * hash) + keyDetails_;
    if (hasValidFor()) {
      hash = (37 * hash) + VALID_FOR_FIELD_NUMBER;
      hash = (53 * hash) + getValidFor().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static dev.sigstore.proto.common.v1.PublicKey parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.PublicKey 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.PublicKey parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.PublicKey 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.PublicKey parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.common.v1.PublicKey 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.PublicKey parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.common.v1.PublicKey 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.PublicKey parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static dev.sigstore.proto.common.v1.PublicKey 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.PublicKey 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.PublicKey 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.PublicKey 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;
  }
  /**
   * Protobuf type {@code dev.sigstore.common.v1.PublicKey}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:dev.sigstore.common.v1.PublicKey)
      dev.sigstore.proto.common.v1.PublicKeyOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return dev.sigstore.proto.common.v1.CommonProto.internal_static_dev_sigstore_common_v1_PublicKey_descriptor;
    }

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

    // Construct using dev.sigstore.proto.common.v1.PublicKey.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage
              .alwaysUseFieldBuilders) {
        internalGetValidForFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      rawBytes_ = com.google.protobuf.ByteString.EMPTY;
      keyDetails_ = 0;
      validFor_ = null;
      if (validForBuilder_ != null) {
        validForBuilder_.dispose();
        validForBuilder_ = null;
      }
      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_PublicKey_descriptor;
    }

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

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

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

    private void buildPartial0(dev.sigstore.proto.common.v1.PublicKey result) {
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.rawBytes_ = rawBytes_;
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.keyDetails_ = keyDetails_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.validFor_ = validForBuilder_ == null
            ? validFor_
            : validForBuilder_.build();
        to_bitField0_ |= 0x00000002;
      }
      result.bitField0_ |= to_bitField0_;
    }

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

    public Builder mergeFrom(dev.sigstore.proto.common.v1.PublicKey other) {
      if (other == dev.sigstore.proto.common.v1.PublicKey.getDefaultInstance()) return this;
      if (other.hasRawBytes()) {
        setRawBytes(other.getRawBytes());
      }
      if (other.keyDetails_ != 0) {
        setKeyDetailsValue(other.getKeyDetailsValue());
      }
      if (other.hasValidFor()) {
        mergeValidFor(other.getValidFor());
      }
      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: {
              rawBytes_ = input.readBytes();
              bitField0_ |= 0x00000001;
              break;
            } // case 10
            case 16: {
              keyDetails_ = input.readEnum();
              bitField0_ |= 0x00000002;
              break;
            } // case 16
            case 26: {
              input.readMessage(
                  internalGetValidForFieldBuilder().getBuilder(),
                  extensionRegistry);
              bitField0_ |= 0x00000004;
              break;
            } // case 26
            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 com.google.protobuf.ByteString rawBytes_ = com.google.protobuf.ByteString.EMPTY;
    /**
     * <pre>
     * DER-encoded public key, encoding method is specified by the
     * key_details attribute.
     * </pre>
     *
     * <code>optional bytes raw_bytes = 1;</code>
     * @return Whether the rawBytes field is set.
     */
    @java.lang.Override
    public boolean hasRawBytes() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     * <pre>
     * DER-encoded public key, encoding method is specified by the
     * key_details attribute.
     * </pre>
     *
     * <code>optional bytes raw_bytes = 1;</code>
     * @return The rawBytes.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getRawBytes() {
      return rawBytes_;
    }
    /**
     * <pre>
     * DER-encoded public key, encoding method is specified by the
     * key_details attribute.
     * </pre>
     *
     * <code>optional bytes raw_bytes = 1;</code>
     * @param value The rawBytes to set.
     * @return This builder for chaining.
     */
    public Builder setRawBytes(com.google.protobuf.ByteString value) {
      if (value == null) { throw new NullPointerException(); }
      rawBytes_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * DER-encoded public key, encoding method is specified by the
     * key_details attribute.
     * </pre>
     *
     * <code>optional bytes raw_bytes = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearRawBytes() {
      bitField0_ = (bitField0_ & ~0x00000001);
      rawBytes_ = getDefaultInstance().getRawBytes();
      onChanged();
      return this;
    }

    private int keyDetails_ = 0;
    /**
     * <pre>
     * Key encoding and signature algorithm to use for this key.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
     * @return The enum numeric value on the wire for keyDetails.
     */
    @java.lang.Override public int getKeyDetailsValue() {
      return keyDetails_;
    }
    /**
     * <pre>
     * Key encoding and signature algorithm to use for this key.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
     * @param value The enum numeric value on the wire for keyDetails to set.
     * @return This builder for chaining.
     */
    public Builder setKeyDetailsValue(int value) {
      keyDetails_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Key encoding and signature algorithm to use for this key.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
     * @return The keyDetails.
     */
    @java.lang.Override
    public dev.sigstore.proto.common.v1.PublicKeyDetails getKeyDetails() {
      dev.sigstore.proto.common.v1.PublicKeyDetails result = dev.sigstore.proto.common.v1.PublicKeyDetails.forNumber(keyDetails_);
      return result == null ? dev.sigstore.proto.common.v1.PublicKeyDetails.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Key encoding and signature algorithm to use for this key.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
     * @param value The keyDetails to set.
     * @return This builder for chaining.
     */
    public Builder setKeyDetails(dev.sigstore.proto.common.v1.PublicKeyDetails value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000002;
      keyDetails_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Key encoding and signature algorithm to use for this key.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.PublicKeyDetails key_details = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearKeyDetails() {
      bitField0_ = (bitField0_ & ~0x00000002);
      keyDetails_ = 0;
      onChanged();
      return this;
    }

    private dev.sigstore.proto.common.v1.TimeRange validFor_;
    private com.google.protobuf.SingleFieldBuilder<
        dev.sigstore.proto.common.v1.TimeRange, dev.sigstore.proto.common.v1.TimeRange.Builder, dev.sigstore.proto.common.v1.TimeRangeOrBuilder> validForBuilder_;
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     * @return Whether the validFor field is set.
     */
    public boolean hasValidFor() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     * @return The validFor.
     */
    public dev.sigstore.proto.common.v1.TimeRange getValidFor() {
      if (validForBuilder_ == null) {
        return validFor_ == null ? dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
      } else {
        return validForBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder setValidFor(dev.sigstore.proto.common.v1.TimeRange value) {
      if (validForBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        validFor_ = value;
      } else {
        validForBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder setValidFor(
        dev.sigstore.proto.common.v1.TimeRange.Builder builderForValue) {
      if (validForBuilder_ == null) {
        validFor_ = builderForValue.build();
      } else {
        validForBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder mergeValidFor(dev.sigstore.proto.common.v1.TimeRange value) {
      if (validForBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0) &&
          validFor_ != null &&
          validFor_ != dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance()) {
          getValidForBuilder().mergeFrom(value);
        } else {
          validFor_ = value;
        }
      } else {
        validForBuilder_.mergeFrom(value);
      }
      if (validFor_ != null) {
        bitField0_ |= 0x00000004;
        onChanged();
      }
      return this;
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder clearValidFor() {
      bitField0_ = (bitField0_ & ~0x00000004);
      validFor_ = null;
      if (validForBuilder_ != null) {
        validForBuilder_.dispose();
        validForBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public dev.sigstore.proto.common.v1.TimeRange.Builder getValidForBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return internalGetValidForFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public dev.sigstore.proto.common.v1.TimeRangeOrBuilder getValidForOrBuilder() {
      if (validForBuilder_ != null) {
        return validForBuilder_.getMessageOrBuilder();
      } else {
        return validFor_ == null ?
            dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
      }
    }
    /**
     * <pre>
     * Optional validity period for this key, *inclusive* of the endpoints.
     * </pre>
     *
     * <code>optional .dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilder<
        dev.sigstore.proto.common.v1.TimeRange, dev.sigstore.proto.common.v1.TimeRange.Builder, dev.sigstore.proto.common.v1.TimeRangeOrBuilder> 
        internalGetValidForFieldBuilder() {
      if (validForBuilder_ == null) {
        validForBuilder_ = new com.google.protobuf.SingleFieldBuilder<
            dev.sigstore.proto.common.v1.TimeRange, dev.sigstore.proto.common.v1.TimeRange.Builder, dev.sigstore.proto.common.v1.TimeRangeOrBuilder>(
                getValidFor(),
                getParentForChildren(),
                isClean());
        validFor_ = null;
      }
      return validForBuilder_;
    }

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

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

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

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

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

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

}