Bundle.java
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: sigstore_bundle.proto
// Protobuf Java Version: 4.30.2
package dev.sigstore.proto.bundle.v1;
/**
* Protobuf type {@code dev.sigstore.bundle.v1.Bundle}
*/
@javax.annotation.Generated(value="protoc", comments="annotations:Bundle.java.pb.meta")
public final class Bundle extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:dev.sigstore.bundle.v1.Bundle)
BundleOrBuilder {
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= */ "",
Bundle.class.getName());
}
// Use Bundle.newBuilder() to construct.
private Bundle(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private Bundle() {
mediaType_ = "";
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return dev.sigstore.proto.bundle.v1.BundleProto.internal_static_dev_sigstore_bundle_v1_Bundle_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return dev.sigstore.proto.bundle.v1.BundleProto.internal_static_dev_sigstore_bundle_v1_Bundle_fieldAccessorTable
.ensureFieldAccessorsInitialized(
dev.sigstore.proto.bundle.v1.Bundle.class, dev.sigstore.proto.bundle.v1.Bundle.Builder.class);
}
private int bitField0_;
private int contentCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object content_;
public enum ContentCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
MESSAGE_SIGNATURE(3),
DSSE_ENVELOPE(4),
CONTENT_NOT_SET(0);
private final int value;
private ContentCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ContentCase valueOf(int value) {
return forNumber(value);
}
public static ContentCase forNumber(int value) {
switch (value) {
case 3: return MESSAGE_SIGNATURE;
case 4: return DSSE_ENVELOPE;
case 0: return CONTENT_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public ContentCase
getContentCase() {
return ContentCase.forNumber(
contentCase_);
}
public static final int MEDIA_TYPE_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object mediaType_ = "";
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @return The mediaType.
*/
@java.lang.Override
public java.lang.String getMediaType() {
java.lang.Object ref = mediaType_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
mediaType_ = s;
return s;
}
}
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @return The bytes for mediaType.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getMediaTypeBytes() {
java.lang.Object ref = mediaType_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
mediaType_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VERIFICATION_MATERIAL_FIELD_NUMBER = 2;
private dev.sigstore.proto.bundle.v1.VerificationMaterial verificationMaterial_;
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @return Whether the verificationMaterial field is set.
*/
@java.lang.Override
public boolean hasVerificationMaterial() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @return The verificationMaterial.
*/
@java.lang.Override
public dev.sigstore.proto.bundle.v1.VerificationMaterial getVerificationMaterial() {
return verificationMaterial_ == null ? dev.sigstore.proto.bundle.v1.VerificationMaterial.getDefaultInstance() : verificationMaterial_;
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
@java.lang.Override
public dev.sigstore.proto.bundle.v1.VerificationMaterialOrBuilder getVerificationMaterialOrBuilder() {
return verificationMaterial_ == null ? dev.sigstore.proto.bundle.v1.VerificationMaterial.getDefaultInstance() : verificationMaterial_;
}
public static final int MESSAGE_SIGNATURE_FIELD_NUMBER = 3;
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
* @return Whether the messageSignature field is set.
*/
@java.lang.Override
public boolean hasMessageSignature() {
return contentCase_ == 3;
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
* @return The messageSignature.
*/
@java.lang.Override
public dev.sigstore.proto.common.v1.MessageSignature getMessageSignature() {
if (contentCase_ == 3) {
return (dev.sigstore.proto.common.v1.MessageSignature) content_;
}
return dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance();
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
@java.lang.Override
public dev.sigstore.proto.common.v1.MessageSignatureOrBuilder getMessageSignatureOrBuilder() {
if (contentCase_ == 3) {
return (dev.sigstore.proto.common.v1.MessageSignature) content_;
}
return dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance();
}
public static final int DSSE_ENVELOPE_FIELD_NUMBER = 4;
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
* @return Whether the dsseEnvelope field is set.
*/
@java.lang.Override
public boolean hasDsseEnvelope() {
return contentCase_ == 4;
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
* @return The dsseEnvelope.
*/
@java.lang.Override
public io.intoto.EnvelopeOuterClass.Envelope getDsseEnvelope() {
if (contentCase_ == 4) {
return (io.intoto.EnvelopeOuterClass.Envelope) content_;
}
return io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance();
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
@java.lang.Override
public io.intoto.EnvelopeOuterClass.EnvelopeOrBuilder getDsseEnvelopeOrBuilder() {
if (contentCase_ == 4) {
return (io.intoto.EnvelopeOuterClass.Envelope) content_;
}
return io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mediaType_)) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, mediaType_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getVerificationMaterial());
}
if (contentCase_ == 3) {
output.writeMessage(3, (dev.sigstore.proto.common.v1.MessageSignature) content_);
}
if (contentCase_ == 4) {
output.writeMessage(4, (io.intoto.EnvelopeOuterClass.Envelope) content_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(mediaType_)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, mediaType_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getVerificationMaterial());
}
if (contentCase_ == 3) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, (dev.sigstore.proto.common.v1.MessageSignature) content_);
}
if (contentCase_ == 4) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, (io.intoto.EnvelopeOuterClass.Envelope) content_);
}
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.bundle.v1.Bundle)) {
return super.equals(obj);
}
dev.sigstore.proto.bundle.v1.Bundle other = (dev.sigstore.proto.bundle.v1.Bundle) obj;
if (!getMediaType()
.equals(other.getMediaType())) return false;
if (hasVerificationMaterial() != other.hasVerificationMaterial()) return false;
if (hasVerificationMaterial()) {
if (!getVerificationMaterial()
.equals(other.getVerificationMaterial())) return false;
}
if (!getContentCase().equals(other.getContentCase())) return false;
switch (contentCase_) {
case 3:
if (!getMessageSignature()
.equals(other.getMessageSignature())) return false;
break;
case 4:
if (!getDsseEnvelope()
.equals(other.getDsseEnvelope())) return false;
break;
case 0:
default:
}
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) + MEDIA_TYPE_FIELD_NUMBER;
hash = (53 * hash) + getMediaType().hashCode();
if (hasVerificationMaterial()) {
hash = (37 * hash) + VERIFICATION_MATERIAL_FIELD_NUMBER;
hash = (53 * hash) + getVerificationMaterial().hashCode();
}
switch (contentCase_) {
case 3:
hash = (37 * hash) + MESSAGE_SIGNATURE_FIELD_NUMBER;
hash = (53 * hash) + getMessageSignature().hashCode();
break;
case 4:
hash = (37 * hash) + DSSE_ENVELOPE_FIELD_NUMBER;
hash = (53 * hash) + getDsseEnvelope().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static dev.sigstore.proto.bundle.v1.Bundle parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static dev.sigstore.proto.bundle.v1.Bundle 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.bundle.v1.Bundle parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static dev.sigstore.proto.bundle.v1.Bundle 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.bundle.v1.Bundle parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static dev.sigstore.proto.bundle.v1.Bundle parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static dev.sigstore.proto.bundle.v1.Bundle parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static dev.sigstore.proto.bundle.v1.Bundle 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.bundle.v1.Bundle parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static dev.sigstore.proto.bundle.v1.Bundle 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.bundle.v1.Bundle parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static dev.sigstore.proto.bundle.v1.Bundle 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.bundle.v1.Bundle 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.bundle.v1.Bundle}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:dev.sigstore.bundle.v1.Bundle)
dev.sigstore.proto.bundle.v1.BundleOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return dev.sigstore.proto.bundle.v1.BundleProto.internal_static_dev_sigstore_bundle_v1_Bundle_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return dev.sigstore.proto.bundle.v1.BundleProto.internal_static_dev_sigstore_bundle_v1_Bundle_fieldAccessorTable
.ensureFieldAccessorsInitialized(
dev.sigstore.proto.bundle.v1.Bundle.class, dev.sigstore.proto.bundle.v1.Bundle.Builder.class);
}
// Construct using dev.sigstore.proto.bundle.v1.Bundle.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage
.alwaysUseFieldBuilders) {
internalGetVerificationMaterialFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
mediaType_ = "";
verificationMaterial_ = null;
if (verificationMaterialBuilder_ != null) {
verificationMaterialBuilder_.dispose();
verificationMaterialBuilder_ = null;
}
if (messageSignatureBuilder_ != null) {
messageSignatureBuilder_.clear();
}
if (dsseEnvelopeBuilder_ != null) {
dsseEnvelopeBuilder_.clear();
}
contentCase_ = 0;
content_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return dev.sigstore.proto.bundle.v1.BundleProto.internal_static_dev_sigstore_bundle_v1_Bundle_descriptor;
}
@java.lang.Override
public dev.sigstore.proto.bundle.v1.Bundle getDefaultInstanceForType() {
return dev.sigstore.proto.bundle.v1.Bundle.getDefaultInstance();
}
@java.lang.Override
public dev.sigstore.proto.bundle.v1.Bundle build() {
dev.sigstore.proto.bundle.v1.Bundle result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public dev.sigstore.proto.bundle.v1.Bundle buildPartial() {
dev.sigstore.proto.bundle.v1.Bundle result = new dev.sigstore.proto.bundle.v1.Bundle(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(dev.sigstore.proto.bundle.v1.Bundle result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.mediaType_ = mediaType_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.verificationMaterial_ = verificationMaterialBuilder_ == null
? verificationMaterial_
: verificationMaterialBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartialOneofs(dev.sigstore.proto.bundle.v1.Bundle result) {
result.contentCase_ = contentCase_;
result.content_ = this.content_;
if (contentCase_ == 3 &&
messageSignatureBuilder_ != null) {
result.content_ = messageSignatureBuilder_.build();
}
if (contentCase_ == 4 &&
dsseEnvelopeBuilder_ != null) {
result.content_ = dsseEnvelopeBuilder_.build();
}
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof dev.sigstore.proto.bundle.v1.Bundle) {
return mergeFrom((dev.sigstore.proto.bundle.v1.Bundle)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(dev.sigstore.proto.bundle.v1.Bundle other) {
if (other == dev.sigstore.proto.bundle.v1.Bundle.getDefaultInstance()) return this;
if (!other.getMediaType().isEmpty()) {
mediaType_ = other.mediaType_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.hasVerificationMaterial()) {
mergeVerificationMaterial(other.getVerificationMaterial());
}
switch (other.getContentCase()) {
case MESSAGE_SIGNATURE: {
mergeMessageSignature(other.getMessageSignature());
break;
}
case DSSE_ENVELOPE: {
mergeDsseEnvelope(other.getDsseEnvelope());
break;
}
case CONTENT_NOT_SET: {
break;
}
}
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: {
mediaType_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
input.readMessage(
internalGetVerificationMaterialFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 26: {
input.readMessage(
internalGetMessageSignatureFieldBuilder().getBuilder(),
extensionRegistry);
contentCase_ = 3;
break;
} // case 26
case 34: {
input.readMessage(
internalGetDsseEnvelopeFieldBuilder().getBuilder(),
extensionRegistry);
contentCase_ = 4;
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 contentCase_ = 0;
private java.lang.Object content_;
public ContentCase
getContentCase() {
return ContentCase.forNumber(
contentCase_);
}
public Builder clearContent() {
contentCase_ = 0;
content_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object mediaType_ = "";
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @return The mediaType.
*/
public java.lang.String getMediaType() {
java.lang.Object ref = mediaType_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
mediaType_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @return The bytes for mediaType.
*/
public com.google.protobuf.ByteString
getMediaTypeBytes() {
java.lang.Object ref = mediaType_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
mediaType_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @param value The mediaType to set.
* @return This builder for chaining.
*/
public Builder setMediaType(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
mediaType_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @return This builder for chaining.
*/
public Builder clearMediaType() {
mediaType_ = getDefaultInstance().getMediaType();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <pre>
* MUST be application/vnd.dev.sigstore.bundle.v0.3+json when
* when encoded as JSON.
* Clients must to be able to accept media type using the previously
* defined formats:
* * application/vnd.dev.sigstore.bundle+json;version=0.1
* * application/vnd.dev.sigstore.bundle+json;version=0.2
* * application/vnd.dev.sigstore.bundle+json;version=0.3
* </pre>
*
* <code>string media_type = 1;</code>
* @param value The bytes for mediaType to set.
* @return This builder for chaining.
*/
public Builder setMediaTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
mediaType_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private dev.sigstore.proto.bundle.v1.VerificationMaterial verificationMaterial_;
private com.google.protobuf.SingleFieldBuilder<
dev.sigstore.proto.bundle.v1.VerificationMaterial, dev.sigstore.proto.bundle.v1.VerificationMaterial.Builder, dev.sigstore.proto.bundle.v1.VerificationMaterialOrBuilder> verificationMaterialBuilder_;
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @return Whether the verificationMaterial field is set.
*/
public boolean hasVerificationMaterial() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @return The verificationMaterial.
*/
public dev.sigstore.proto.bundle.v1.VerificationMaterial getVerificationMaterial() {
if (verificationMaterialBuilder_ == null) {
return verificationMaterial_ == null ? dev.sigstore.proto.bundle.v1.VerificationMaterial.getDefaultInstance() : verificationMaterial_;
} else {
return verificationMaterialBuilder_.getMessage();
}
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder setVerificationMaterial(dev.sigstore.proto.bundle.v1.VerificationMaterial value) {
if (verificationMaterialBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
verificationMaterial_ = value;
} else {
verificationMaterialBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder setVerificationMaterial(
dev.sigstore.proto.bundle.v1.VerificationMaterial.Builder builderForValue) {
if (verificationMaterialBuilder_ == null) {
verificationMaterial_ = builderForValue.build();
} else {
verificationMaterialBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder mergeVerificationMaterial(dev.sigstore.proto.bundle.v1.VerificationMaterial value) {
if (verificationMaterialBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
verificationMaterial_ != null &&
verificationMaterial_ != dev.sigstore.proto.bundle.v1.VerificationMaterial.getDefaultInstance()) {
getVerificationMaterialBuilder().mergeFrom(value);
} else {
verificationMaterial_ = value;
}
} else {
verificationMaterialBuilder_.mergeFrom(value);
}
if (verificationMaterial_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder clearVerificationMaterial() {
bitField0_ = (bitField0_ & ~0x00000002);
verificationMaterial_ = null;
if (verificationMaterialBuilder_ != null) {
verificationMaterialBuilder_.dispose();
verificationMaterialBuilder_ = null;
}
onChanged();
return this;
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public dev.sigstore.proto.bundle.v1.VerificationMaterial.Builder getVerificationMaterialBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return internalGetVerificationMaterialFieldBuilder().getBuilder();
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public dev.sigstore.proto.bundle.v1.VerificationMaterialOrBuilder getVerificationMaterialOrBuilder() {
if (verificationMaterialBuilder_ != null) {
return verificationMaterialBuilder_.getMessageOrBuilder();
} else {
return verificationMaterial_ == null ?
dev.sigstore.proto.bundle.v1.VerificationMaterial.getDefaultInstance() : verificationMaterial_;
}
}
/**
* <pre>
* When a signer is identified by a X.509 certificate, a verifier MUST
* verify that the signature was computed at the time the certificate
* was valid as described in the Sigstore client spec: "Verification
* using a Bundle".
* <https://docs.google.com/document/d/1kbhK2qyPPk8SLavHzYSDM8-Ueul9_oxIMVFuWMWKz0E/edit#heading=h.x8bduppe89ln>
* If the verification material contains a public key identifier
* (key hint) and the `content` is a DSSE envelope, the key hints
* MUST be exactly the same in the verification material and in the
* DSSE envelope.
* </pre>
*
* <code>.dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
private com.google.protobuf.SingleFieldBuilder<
dev.sigstore.proto.bundle.v1.VerificationMaterial, dev.sigstore.proto.bundle.v1.VerificationMaterial.Builder, dev.sigstore.proto.bundle.v1.VerificationMaterialOrBuilder>
internalGetVerificationMaterialFieldBuilder() {
if (verificationMaterialBuilder_ == null) {
verificationMaterialBuilder_ = new com.google.protobuf.SingleFieldBuilder<
dev.sigstore.proto.bundle.v1.VerificationMaterial, dev.sigstore.proto.bundle.v1.VerificationMaterial.Builder, dev.sigstore.proto.bundle.v1.VerificationMaterialOrBuilder>(
getVerificationMaterial(),
getParentForChildren(),
isClean());
verificationMaterial_ = null;
}
return verificationMaterialBuilder_;
}
private com.google.protobuf.SingleFieldBuilder<
dev.sigstore.proto.common.v1.MessageSignature, dev.sigstore.proto.common.v1.MessageSignature.Builder, dev.sigstore.proto.common.v1.MessageSignatureOrBuilder> messageSignatureBuilder_;
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
* @return Whether the messageSignature field is set.
*/
@java.lang.Override
public boolean hasMessageSignature() {
return contentCase_ == 3;
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
* @return The messageSignature.
*/
@java.lang.Override
public dev.sigstore.proto.common.v1.MessageSignature getMessageSignature() {
if (messageSignatureBuilder_ == null) {
if (contentCase_ == 3) {
return (dev.sigstore.proto.common.v1.MessageSignature) content_;
}
return dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance();
} else {
if (contentCase_ == 3) {
return messageSignatureBuilder_.getMessage();
}
return dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance();
}
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder setMessageSignature(dev.sigstore.proto.common.v1.MessageSignature value) {
if (messageSignatureBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
content_ = value;
onChanged();
} else {
messageSignatureBuilder_.setMessage(value);
}
contentCase_ = 3;
return this;
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder setMessageSignature(
dev.sigstore.proto.common.v1.MessageSignature.Builder builderForValue) {
if (messageSignatureBuilder_ == null) {
content_ = builderForValue.build();
onChanged();
} else {
messageSignatureBuilder_.setMessage(builderForValue.build());
}
contentCase_ = 3;
return this;
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder mergeMessageSignature(dev.sigstore.proto.common.v1.MessageSignature value) {
if (messageSignatureBuilder_ == null) {
if (contentCase_ == 3 &&
content_ != dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance()) {
content_ = dev.sigstore.proto.common.v1.MessageSignature.newBuilder((dev.sigstore.proto.common.v1.MessageSignature) content_)
.mergeFrom(value).buildPartial();
} else {
content_ = value;
}
onChanged();
} else {
if (contentCase_ == 3) {
messageSignatureBuilder_.mergeFrom(value);
} else {
messageSignatureBuilder_.setMessage(value);
}
}
contentCase_ = 3;
return this;
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder clearMessageSignature() {
if (messageSignatureBuilder_ == null) {
if (contentCase_ == 3) {
contentCase_ = 0;
content_ = null;
onChanged();
}
} else {
if (contentCase_ == 3) {
contentCase_ = 0;
content_ = null;
}
messageSignatureBuilder_.clear();
}
return this;
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public dev.sigstore.proto.common.v1.MessageSignature.Builder getMessageSignatureBuilder() {
return internalGetMessageSignatureFieldBuilder().getBuilder();
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
@java.lang.Override
public dev.sigstore.proto.common.v1.MessageSignatureOrBuilder getMessageSignatureOrBuilder() {
if ((contentCase_ == 3) && (messageSignatureBuilder_ != null)) {
return messageSignatureBuilder_.getMessageOrBuilder();
} else {
if (contentCase_ == 3) {
return (dev.sigstore.proto.common.v1.MessageSignature) content_;
}
return dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance();
}
}
/**
* <code>.dev.sigstore.common.v1.MessageSignature message_signature = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*/
private com.google.protobuf.SingleFieldBuilder<
dev.sigstore.proto.common.v1.MessageSignature, dev.sigstore.proto.common.v1.MessageSignature.Builder, dev.sigstore.proto.common.v1.MessageSignatureOrBuilder>
internalGetMessageSignatureFieldBuilder() {
if (messageSignatureBuilder_ == null) {
if (!(contentCase_ == 3)) {
content_ = dev.sigstore.proto.common.v1.MessageSignature.getDefaultInstance();
}
messageSignatureBuilder_ = new com.google.protobuf.SingleFieldBuilder<
dev.sigstore.proto.common.v1.MessageSignature, dev.sigstore.proto.common.v1.MessageSignature.Builder, dev.sigstore.proto.common.v1.MessageSignatureOrBuilder>(
(dev.sigstore.proto.common.v1.MessageSignature) content_,
getParentForChildren(),
isClean());
content_ = null;
}
contentCase_ = 3;
onChanged();
return messageSignatureBuilder_;
}
private com.google.protobuf.SingleFieldBuilder<
io.intoto.EnvelopeOuterClass.Envelope, io.intoto.EnvelopeOuterClass.Envelope.Builder, io.intoto.EnvelopeOuterClass.EnvelopeOrBuilder> dsseEnvelopeBuilder_;
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
* @return Whether the dsseEnvelope field is set.
*/
@java.lang.Override
public boolean hasDsseEnvelope() {
return contentCase_ == 4;
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
* @return The dsseEnvelope.
*/
@java.lang.Override
public io.intoto.EnvelopeOuterClass.Envelope getDsseEnvelope() {
if (dsseEnvelopeBuilder_ == null) {
if (contentCase_ == 4) {
return (io.intoto.EnvelopeOuterClass.Envelope) content_;
}
return io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance();
} else {
if (contentCase_ == 4) {
return dsseEnvelopeBuilder_.getMessage();
}
return io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance();
}
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder setDsseEnvelope(io.intoto.EnvelopeOuterClass.Envelope value) {
if (dsseEnvelopeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
content_ = value;
onChanged();
} else {
dsseEnvelopeBuilder_.setMessage(value);
}
contentCase_ = 4;
return this;
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder setDsseEnvelope(
io.intoto.EnvelopeOuterClass.Envelope.Builder builderForValue) {
if (dsseEnvelopeBuilder_ == null) {
content_ = builderForValue.build();
onChanged();
} else {
dsseEnvelopeBuilder_.setMessage(builderForValue.build());
}
contentCase_ = 4;
return this;
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder mergeDsseEnvelope(io.intoto.EnvelopeOuterClass.Envelope value) {
if (dsseEnvelopeBuilder_ == null) {
if (contentCase_ == 4 &&
content_ != io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance()) {
content_ = io.intoto.EnvelopeOuterClass.Envelope.newBuilder((io.intoto.EnvelopeOuterClass.Envelope) content_)
.mergeFrom(value).buildPartial();
} else {
content_ = value;
}
onChanged();
} else {
if (contentCase_ == 4) {
dsseEnvelopeBuilder_.mergeFrom(value);
} else {
dsseEnvelopeBuilder_.setMessage(value);
}
}
contentCase_ = 4;
return this;
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public Builder clearDsseEnvelope() {
if (dsseEnvelopeBuilder_ == null) {
if (contentCase_ == 4) {
contentCase_ = 0;
content_ = null;
onChanged();
}
} else {
if (contentCase_ == 4) {
contentCase_ = 0;
content_ = null;
}
dsseEnvelopeBuilder_.clear();
}
return this;
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
public io.intoto.EnvelopeOuterClass.Envelope.Builder getDsseEnvelopeBuilder() {
return internalGetDsseEnvelopeFieldBuilder().getBuilder();
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
@java.lang.Override
public io.intoto.EnvelopeOuterClass.EnvelopeOrBuilder getDsseEnvelopeOrBuilder() {
if ((contentCase_ == 4) && (dsseEnvelopeBuilder_ != null)) {
return dsseEnvelopeBuilder_.getMessageOrBuilder();
} else {
if (contentCase_ == 4) {
return (io.intoto.EnvelopeOuterClass.Envelope) content_;
}
return io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance();
}
}
/**
* <pre>
* A DSSE envelope can contain arbitrary payloads.
* Verifiers must verify that the payload type is a
* supported and expected type. This is part of the DSSE
* protocol which is defined here:
* <https://github.com/secure-systems-lab/dsse/blob/master/protocol.md>
* DSSE envelopes in a bundle MUST have exactly one signature.
* This is a limitation from the DSSE spec, as it can contain
* multiple signatures. There are two primary reasons:
* 1. It simplifies the verification logic and policy
* 2. The bundle (currently) can only contain a single
* instance of the required verification materials
* During verification a client MUST reject an envelope if
* the number of signatures is not equal to one.
* </pre>
*
* <code>.io.intoto.Envelope dsse_envelope = 4 [(.google.api.field_behavior) = REQUIRED];</code>
*/
private com.google.protobuf.SingleFieldBuilder<
io.intoto.EnvelopeOuterClass.Envelope, io.intoto.EnvelopeOuterClass.Envelope.Builder, io.intoto.EnvelopeOuterClass.EnvelopeOrBuilder>
internalGetDsseEnvelopeFieldBuilder() {
if (dsseEnvelopeBuilder_ == null) {
if (!(contentCase_ == 4)) {
content_ = io.intoto.EnvelopeOuterClass.Envelope.getDefaultInstance();
}
dsseEnvelopeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
io.intoto.EnvelopeOuterClass.Envelope, io.intoto.EnvelopeOuterClass.Envelope.Builder, io.intoto.EnvelopeOuterClass.EnvelopeOrBuilder>(
(io.intoto.EnvelopeOuterClass.Envelope) content_,
getParentForChildren(),
isClean());
content_ = null;
}
contentCase_ = 4;
onChanged();
return dsseEnvelopeBuilder_;
}
// @@protoc_insertion_point(builder_scope:dev.sigstore.bundle.v1.Bundle)
}
// @@protoc_insertion_point(class_scope:dev.sigstore.bundle.v1.Bundle)
private static final dev.sigstore.proto.bundle.v1.Bundle DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new dev.sigstore.proto.bundle.v1.Bundle();
}
public static dev.sigstore.proto.bundle.v1.Bundle getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Bundle>
PARSER = new com.google.protobuf.AbstractParser<Bundle>() {
@java.lang.Override
public Bundle 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<Bundle> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Bundle> getParserForType() {
return PARSER;
}
@java.lang.Override
public dev.sigstore.proto.bundle.v1.Bundle getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}