
io.grafeas.v1beta1.attestation.GenericSignedAttestation Maven / Gradle / Ivy
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto
// Protobuf Java Version: 3.25.5
package io.grafeas.v1beta1.attestation;
/**
*
*
*
* An attestation wrapper that uses the Grafeas `Signature` message.
* This attestation must define the `serialized_payload` that the `signatures`
* verify and any metadata necessary to interpret that plaintext. The
* signatures should always be over the `serialized_payload` bytestring.
*
*
* Protobuf type {@code grafeas.v1beta1.attestation.GenericSignedAttestation}
*/
public final class GenericSignedAttestation extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.GenericSignedAttestation)
GenericSignedAttestationOrBuilder {
private static final long serialVersionUID = 0L;
// Use GenericSignedAttestation.newBuilder() to construct.
private GenericSignedAttestation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private GenericSignedAttestation() {
contentType_ = 0;
serializedPayload_ = com.google.protobuf.ByteString.EMPTY;
signatures_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new GenericSignedAttestation();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_GenericSignedAttestation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_GenericSignedAttestation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grafeas.v1beta1.attestation.GenericSignedAttestation.class,
io.grafeas.v1beta1.attestation.GenericSignedAttestation.Builder.class);
}
/**
*
*
*
* Type of the attestation plaintext that was signed.
*
*
* Protobuf enum {@code grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType}
*/
public enum ContentType implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* `ContentType` is not set.
*
*
* CONTENT_TYPE_UNSPECIFIED = 0;
*/
CONTENT_TYPE_UNSPECIFIED(0),
/**
*
*
*
* Atomic format attestation signature. See
* https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
* The payload extracted in `plaintext` is a JSON blob conforming to the
* linked schema.
*
*
* SIMPLE_SIGNING_JSON = 1;
*/
SIMPLE_SIGNING_JSON(1),
UNRECOGNIZED(-1),
;
/**
*
*
*
* `ContentType` is not set.
*
*
* CONTENT_TYPE_UNSPECIFIED = 0;
*/
public static final int CONTENT_TYPE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* Atomic format attestation signature. See
* https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
* The payload extracted in `plaintext` is a JSON blob conforming to the
* linked schema.
*
*
* SIMPLE_SIGNING_JSON = 1;
*/
public static final int SIMPLE_SIGNING_JSON_VALUE = 1;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ContentType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static ContentType forNumber(int value) {
switch (value) {
case 0:
return CONTENT_TYPE_UNSPECIFIED;
case 1:
return SIMPLE_SIGNING_JSON;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public ContentType findValueByNumber(int number) {
return ContentType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return io.grafeas.v1beta1.attestation.GenericSignedAttestation.getDescriptor()
.getEnumTypes()
.get(0);
}
private static final ContentType[] VALUES = values();
public static ContentType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private ContentType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType)
}
public static final int CONTENT_TYPE_FIELD_NUMBER = 1;
private int contentType_ = 0;
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @return The enum numeric value on the wire for contentType.
*/
@java.lang.Override
public int getContentTypeValue() {
return contentType_;
}
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @return The contentType.
*/
@java.lang.Override
public io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType getContentType() {
io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType result =
io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType.forNumber(contentType_);
return result == null
? io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType.UNRECOGNIZED
: result;
}
public static final int SERIALIZED_PAYLOAD_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString serializedPayload_ = com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* The serialized payload that is verified by one or more `signatures`.
* The encoding and semantic meaning of this payload must match what is set in
* `content_type`.
*
*
* bytes serialized_payload = 2;
*
* @return The serializedPayload.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSerializedPayload() {
return serializedPayload_;
}
public static final int SIGNATURES_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List signatures_;
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
@java.lang.Override
public java.util.List getSignaturesList() {
return signatures_;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
@java.lang.Override
public java.util.List extends io.grafeas.v1beta1.common.SignatureOrBuilder>
getSignaturesOrBuilderList() {
return signatures_;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
@java.lang.Override
public int getSignaturesCount() {
return signatures_.size();
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
@java.lang.Override
public io.grafeas.v1beta1.common.Signature getSignatures(int index) {
return signatures_.get(index);
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
@java.lang.Override
public io.grafeas.v1beta1.common.SignatureOrBuilder getSignaturesOrBuilder(int index) {
return signatures_.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 {
if (contentType_
!= io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType
.CONTENT_TYPE_UNSPECIFIED
.getNumber()) {
output.writeEnum(1, contentType_);
}
if (!serializedPayload_.isEmpty()) {
output.writeBytes(2, serializedPayload_);
}
for (int i = 0; i < signatures_.size(); i++) {
output.writeMessage(3, signatures_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (contentType_
!= io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType
.CONTENT_TYPE_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, contentType_);
}
if (!serializedPayload_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, serializedPayload_);
}
for (int i = 0; i < signatures_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, signatures_.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 io.grafeas.v1beta1.attestation.GenericSignedAttestation)) {
return super.equals(obj);
}
io.grafeas.v1beta1.attestation.GenericSignedAttestation other =
(io.grafeas.v1beta1.attestation.GenericSignedAttestation) obj;
if (contentType_ != other.contentType_) return false;
if (!getSerializedPayload().equals(other.getSerializedPayload())) return false;
if (!getSignaturesList().equals(other.getSignaturesList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER;
hash = (53 * hash) + contentType_;
hash = (37 * hash) + SERIALIZED_PAYLOAD_FIELD_NUMBER;
hash = (53 * hash) + getSerializedPayload().hashCode();
if (getSignaturesCount() > 0) {
hash = (37 * hash) + SIGNATURES_FIELD_NUMBER;
hash = (53 * hash) + getSignaturesList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
io.grafeas.v1beta1.attestation.GenericSignedAttestation prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* An attestation wrapper that uses the Grafeas `Signature` message.
* This attestation must define the `serialized_payload` that the `signatures`
* verify and any metadata necessary to interpret that plaintext. The
* signatures should always be over the `serialized_payload` bytestring.
*
*
* Protobuf type {@code grafeas.v1beta1.attestation.GenericSignedAttestation}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.GenericSignedAttestation)
io.grafeas.v1beta1.attestation.GenericSignedAttestationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_GenericSignedAttestation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_GenericSignedAttestation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grafeas.v1beta1.attestation.GenericSignedAttestation.class,
io.grafeas.v1beta1.attestation.GenericSignedAttestation.Builder.class);
}
// Construct using io.grafeas.v1beta1.attestation.GenericSignedAttestation.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
contentType_ = 0;
serializedPayload_ = com.google.protobuf.ByteString.EMPTY;
if (signaturesBuilder_ == null) {
signatures_ = java.util.Collections.emptyList();
} else {
signatures_ = null;
signaturesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_GenericSignedAttestation_descriptor;
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.GenericSignedAttestation getDefaultInstanceForType() {
return io.grafeas.v1beta1.attestation.GenericSignedAttestation.getDefaultInstance();
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.GenericSignedAttestation build() {
io.grafeas.v1beta1.attestation.GenericSignedAttestation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.GenericSignedAttestation buildPartial() {
io.grafeas.v1beta1.attestation.GenericSignedAttestation result =
new io.grafeas.v1beta1.attestation.GenericSignedAttestation(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
io.grafeas.v1beta1.attestation.GenericSignedAttestation result) {
if (signaturesBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
signatures_ = java.util.Collections.unmodifiableList(signatures_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.signatures_ = signatures_;
} else {
result.signatures_ = signaturesBuilder_.build();
}
}
private void buildPartial0(io.grafeas.v1beta1.attestation.GenericSignedAttestation result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.contentType_ = contentType_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.serializedPayload_ = serializedPayload_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grafeas.v1beta1.attestation.GenericSignedAttestation) {
return mergeFrom((io.grafeas.v1beta1.attestation.GenericSignedAttestation) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grafeas.v1beta1.attestation.GenericSignedAttestation other) {
if (other == io.grafeas.v1beta1.attestation.GenericSignedAttestation.getDefaultInstance())
return this;
if (other.contentType_ != 0) {
setContentTypeValue(other.getContentTypeValue());
}
if (other.getSerializedPayload() != com.google.protobuf.ByteString.EMPTY) {
setSerializedPayload(other.getSerializedPayload());
}
if (signaturesBuilder_ == null) {
if (!other.signatures_.isEmpty()) {
if (signatures_.isEmpty()) {
signatures_ = other.signatures_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureSignaturesIsMutable();
signatures_.addAll(other.signatures_);
}
onChanged();
}
} else {
if (!other.signatures_.isEmpty()) {
if (signaturesBuilder_.isEmpty()) {
signaturesBuilder_.dispose();
signaturesBuilder_ = null;
signatures_ = other.signatures_;
bitField0_ = (bitField0_ & ~0x00000004);
signaturesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getSignaturesFieldBuilder()
: null;
} else {
signaturesBuilder_.addAllMessages(other.signatures_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8:
{
contentType_ = input.readEnum();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18:
{
serializedPayload_ = input.readBytes();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
io.grafeas.v1beta1.common.Signature m =
input.readMessage(
io.grafeas.v1beta1.common.Signature.parser(), extensionRegistry);
if (signaturesBuilder_ == null) {
ensureSignaturesIsMutable();
signatures_.add(m);
} else {
signaturesBuilder_.addMessage(m);
}
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 int contentType_ = 0;
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @return The enum numeric value on the wire for contentType.
*/
@java.lang.Override
public int getContentTypeValue() {
return contentType_;
}
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @param value The enum numeric value on the wire for contentType to set.
* @return This builder for chaining.
*/
public Builder setContentTypeValue(int value) {
contentType_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @return The contentType.
*/
@java.lang.Override
public io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType getContentType() {
io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType result =
io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType.forNumber(
contentType_);
return result == null
? io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType.UNRECOGNIZED
: result;
}
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @param value The contentType to set.
* @return This builder for chaining.
*/
public Builder setContentType(
io.grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
contentType_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
* The verifier must ensure that the provided type is one that the verifier
* supports, and that the attestation payload is a valid instantiation of that
* type (for example by validating a JSON schema).
*
*
* .grafeas.v1beta1.attestation.GenericSignedAttestation.ContentType content_type = 1;
*
*
* @return This builder for chaining.
*/
public Builder clearContentType() {
bitField0_ = (bitField0_ & ~0x00000001);
contentType_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString serializedPayload_ =
com.google.protobuf.ByteString.EMPTY;
/**
*
*
*
* The serialized payload that is verified by one or more `signatures`.
* The encoding and semantic meaning of this payload must match what is set in
* `content_type`.
*
*
* bytes serialized_payload = 2;
*
* @return The serializedPayload.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSerializedPayload() {
return serializedPayload_;
}
/**
*
*
*
* The serialized payload that is verified by one or more `signatures`.
* The encoding and semantic meaning of this payload must match what is set in
* `content_type`.
*
*
* bytes serialized_payload = 2;
*
* @param value The serializedPayload to set.
* @return This builder for chaining.
*/
public Builder setSerializedPayload(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
serializedPayload_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The serialized payload that is verified by one or more `signatures`.
* The encoding and semantic meaning of this payload must match what is set in
* `content_type`.
*
*
* bytes serialized_payload = 2;
*
* @return This builder for chaining.
*/
public Builder clearSerializedPayload() {
bitField0_ = (bitField0_ & ~0x00000002);
serializedPayload_ = getDefaultInstance().getSerializedPayload();
onChanged();
return this;
}
private java.util.List signatures_ =
java.util.Collections.emptyList();
private void ensureSignaturesIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
signatures_ = new java.util.ArrayList(signatures_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.grafeas.v1beta1.common.Signature,
io.grafeas.v1beta1.common.Signature.Builder,
io.grafeas.v1beta1.common.SignatureOrBuilder>
signaturesBuilder_;
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public java.util.List getSignaturesList() {
if (signaturesBuilder_ == null) {
return java.util.Collections.unmodifiableList(signatures_);
} else {
return signaturesBuilder_.getMessageList();
}
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public int getSignaturesCount() {
if (signaturesBuilder_ == null) {
return signatures_.size();
} else {
return signaturesBuilder_.getCount();
}
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public io.grafeas.v1beta1.common.Signature getSignatures(int index) {
if (signaturesBuilder_ == null) {
return signatures_.get(index);
} else {
return signaturesBuilder_.getMessage(index);
}
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder setSignatures(int index, io.grafeas.v1beta1.common.Signature value) {
if (signaturesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureSignaturesIsMutable();
signatures_.set(index, value);
onChanged();
} else {
signaturesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder setSignatures(
int index, io.grafeas.v1beta1.common.Signature.Builder builderForValue) {
if (signaturesBuilder_ == null) {
ensureSignaturesIsMutable();
signatures_.set(index, builderForValue.build());
onChanged();
} else {
signaturesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder addSignatures(io.grafeas.v1beta1.common.Signature value) {
if (signaturesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureSignaturesIsMutable();
signatures_.add(value);
onChanged();
} else {
signaturesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder addSignatures(int index, io.grafeas.v1beta1.common.Signature value) {
if (signaturesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureSignaturesIsMutable();
signatures_.add(index, value);
onChanged();
} else {
signaturesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder addSignatures(io.grafeas.v1beta1.common.Signature.Builder builderForValue) {
if (signaturesBuilder_ == null) {
ensureSignaturesIsMutable();
signatures_.add(builderForValue.build());
onChanged();
} else {
signaturesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder addSignatures(
int index, io.grafeas.v1beta1.common.Signature.Builder builderForValue) {
if (signaturesBuilder_ == null) {
ensureSignaturesIsMutable();
signatures_.add(index, builderForValue.build());
onChanged();
} else {
signaturesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder addAllSignatures(
java.lang.Iterable extends io.grafeas.v1beta1.common.Signature> values) {
if (signaturesBuilder_ == null) {
ensureSignaturesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, signatures_);
onChanged();
} else {
signaturesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder clearSignatures() {
if (signaturesBuilder_ == null) {
signatures_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
signaturesBuilder_.clear();
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public Builder removeSignatures(int index) {
if (signaturesBuilder_ == null) {
ensureSignaturesIsMutable();
signatures_.remove(index);
onChanged();
} else {
signaturesBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public io.grafeas.v1beta1.common.Signature.Builder getSignaturesBuilder(int index) {
return getSignaturesFieldBuilder().getBuilder(index);
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public io.grafeas.v1beta1.common.SignatureOrBuilder getSignaturesOrBuilder(int index) {
if (signaturesBuilder_ == null) {
return signatures_.get(index);
} else {
return signaturesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public java.util.List extends io.grafeas.v1beta1.common.SignatureOrBuilder>
getSignaturesOrBuilderList() {
if (signaturesBuilder_ != null) {
return signaturesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(signatures_);
}
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public io.grafeas.v1beta1.common.Signature.Builder addSignaturesBuilder() {
return getSignaturesFieldBuilder()
.addBuilder(io.grafeas.v1beta1.common.Signature.getDefaultInstance());
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public io.grafeas.v1beta1.common.Signature.Builder addSignaturesBuilder(int index) {
return getSignaturesFieldBuilder()
.addBuilder(index, io.grafeas.v1beta1.common.Signature.getDefaultInstance());
}
/**
*
*
*
* One or more signatures over `serialized_payload`. Verifier implementations
* should consider this attestation message verified if at least one
* `signature` verifies `serialized_payload`. See `Signature` in common.proto
* for more details on signature structure and verification.
*
*
* repeated .grafeas.v1beta1.Signature signatures = 3;
*/
public java.util.List getSignaturesBuilderList() {
return getSignaturesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.grafeas.v1beta1.common.Signature,
io.grafeas.v1beta1.common.Signature.Builder,
io.grafeas.v1beta1.common.SignatureOrBuilder>
getSignaturesFieldBuilder() {
if (signaturesBuilder_ == null) {
signaturesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
io.grafeas.v1beta1.common.Signature,
io.grafeas.v1beta1.common.Signature.Builder,
io.grafeas.v1beta1.common.SignatureOrBuilder>(
signatures_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean());
signatures_ = null;
}
return signaturesBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.GenericSignedAttestation)
}
// @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.GenericSignedAttestation)
private static final io.grafeas.v1beta1.attestation.GenericSignedAttestation DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.GenericSignedAttestation();
}
public static io.grafeas.v1beta1.attestation.GenericSignedAttestation getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public GenericSignedAttestation parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.GenericSignedAttestation getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy