
io.grafeas.v1beta1.attestation.PgpSignedAttestation 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 with a PGP-compatible signature. This message only
* supports `ATTACHED` signatures, where the payload that is signed is included
* alongside the signature itself in the same file.
*
*
* Protobuf type {@code grafeas.v1beta1.attestation.PgpSignedAttestation}
*/
public final class PgpSignedAttestation extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.PgpSignedAttestation)
PgpSignedAttestationOrBuilder {
private static final long serialVersionUID = 0L;
// Use PgpSignedAttestation.newBuilder() to construct.
private PgpSignedAttestation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private PgpSignedAttestation() {
signature_ = "";
contentType_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new PgpSignedAttestation();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grafeas.v1beta1.attestation.PgpSignedAttestation.class,
io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder.class);
}
/**
*
*
*
* Type (for example schema) of the attestation payload that was signed.
*
*
* Protobuf enum {@code grafeas.v1beta1.attestation.PgpSignedAttestation.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 from `signature` 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 from `signature` 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.PgpSignedAttestation.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.PgpSignedAttestation.ContentType)
}
private int keyIdCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object keyId_;
public enum KeyIdCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
PGP_KEY_ID(2),
KEYID_NOT_SET(0);
private final int value;
private KeyIdCase(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 KeyIdCase valueOf(int value) {
return forNumber(value);
}
public static KeyIdCase forNumber(int value) {
switch (value) {
case 2:
return PGP_KEY_ID;
case 0:
return KEYID_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public KeyIdCase getKeyIdCase() {
return KeyIdCase.forNumber(keyIdCase_);
}
public static final int SIGNATURE_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object signature_ = "";
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @return The signature.
*/
@java.lang.Override
public java.lang.String getSignature() {
java.lang.Object ref = signature_;
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();
signature_ = s;
return s;
}
}
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @return The bytes for signature.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSignatureBytes() {
java.lang.Object ref = signature_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
signature_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CONTENT_TYPE_FIELD_NUMBER = 3;
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.PgpSignedAttestation.ContentType content_type = 3;
*
* @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.PgpSignedAttestation.ContentType content_type = 3;
*
* @return The contentType.
*/
@java.lang.Override
public io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType getContentType() {
io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType result =
io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.forNumber(contentType_);
return result == null
? io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.UNRECOGNIZED
: result;
}
public static final int PGP_KEY_ID_FIELD_NUMBER = 2;
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return Whether the pgpKeyId field is set.
*/
public boolean hasPgpKeyId() {
return keyIdCase_ == 2;
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return The pgpKeyId.
*/
public java.lang.String getPgpKeyId() {
java.lang.Object ref = "";
if (keyIdCase_ == 2) {
ref = keyId_;
}
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();
if (keyIdCase_ == 2) {
keyId_ = s;
}
return s;
}
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return The bytes for pgpKeyId.
*/
public com.google.protobuf.ByteString getPgpKeyIdBytes() {
java.lang.Object ref = "";
if (keyIdCase_ == 2) {
ref = keyId_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (keyIdCase_ == 2) {
keyId_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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.GeneratedMessageV3.isStringEmpty(signature_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, signature_);
}
if (keyIdCase_ == 2) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyId_);
}
if (contentType_
!= io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.CONTENT_TYPE_UNSPECIFIED
.getNumber()) {
output.writeEnum(3, contentType_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(signature_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, signature_);
}
if (keyIdCase_ == 2) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyId_);
}
if (contentType_
!= io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.CONTENT_TYPE_UNSPECIFIED
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, contentType_);
}
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.PgpSignedAttestation)) {
return super.equals(obj);
}
io.grafeas.v1beta1.attestation.PgpSignedAttestation other =
(io.grafeas.v1beta1.attestation.PgpSignedAttestation) obj;
if (!getSignature().equals(other.getSignature())) return false;
if (contentType_ != other.contentType_) return false;
if (!getKeyIdCase().equals(other.getKeyIdCase())) return false;
switch (keyIdCase_) {
case 2:
if (!getPgpKeyId().equals(other.getPgpKeyId())) 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) + SIGNATURE_FIELD_NUMBER;
hash = (53 * hash) + getSignature().hashCode();
hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER;
hash = (53 * hash) + contentType_;
switch (keyIdCase_) {
case 2:
hash = (37 * hash) + PGP_KEY_ID_FIELD_NUMBER;
hash = (53 * hash) + getPgpKeyId().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation 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.PgpSignedAttestation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation 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.PgpSignedAttestation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation 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.PgpSignedAttestation parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation 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.PgpSignedAttestation parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation 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.PgpSignedAttestation 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 with a PGP-compatible signature. This message only
* supports `ATTACHED` signatures, where the payload that is signed is included
* alongside the signature itself in the same file.
*
*
* Protobuf type {@code grafeas.v1beta1.attestation.PgpSignedAttestation}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.PgpSignedAttestation)
io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grafeas.v1beta1.attestation.PgpSignedAttestation.class,
io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder.class);
}
// Construct using io.grafeas.v1beta1.attestation.PgpSignedAttestation.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
signature_ = "";
contentType_ = 0;
keyIdCase_ = 0;
keyId_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return io.grafeas.v1beta1.attestation.AttestationOuterClass
.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor;
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.PgpSignedAttestation getDefaultInstanceForType() {
return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance();
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.PgpSignedAttestation build() {
io.grafeas.v1beta1.attestation.PgpSignedAttestation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grafeas.v1beta1.attestation.PgpSignedAttestation buildPartial() {
io.grafeas.v1beta1.attestation.PgpSignedAttestation result =
new io.grafeas.v1beta1.attestation.PgpSignedAttestation(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(io.grafeas.v1beta1.attestation.PgpSignedAttestation result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.signature_ = signature_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.contentType_ = contentType_;
}
}
private void buildPartialOneofs(io.grafeas.v1beta1.attestation.PgpSignedAttestation result) {
result.keyIdCase_ = keyIdCase_;
result.keyId_ = this.keyId_;
}
@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.PgpSignedAttestation) {
return mergeFrom((io.grafeas.v1beta1.attestation.PgpSignedAttestation) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grafeas.v1beta1.attestation.PgpSignedAttestation other) {
if (other == io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance())
return this;
if (!other.getSignature().isEmpty()) {
signature_ = other.signature_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.contentType_ != 0) {
setContentTypeValue(other.getContentTypeValue());
}
switch (other.getKeyIdCase()) {
case PGP_KEY_ID:
{
keyIdCase_ = 2;
keyId_ = other.keyId_;
onChanged();
break;
}
case KEYID_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:
{
signature_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
keyIdCase_ = 2;
keyId_ = s;
break;
} // case 18
case 24:
{
contentType_ = input.readEnum();
bitField0_ |= 0x00000002;
break;
} // case 24
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 keyIdCase_ = 0;
private java.lang.Object keyId_;
public KeyIdCase getKeyIdCase() {
return KeyIdCase.forNumber(keyIdCase_);
}
public Builder clearKeyId() {
keyIdCase_ = 0;
keyId_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object signature_ = "";
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @return The signature.
*/
public java.lang.String getSignature() {
java.lang.Object ref = signature_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
signature_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @return The bytes for signature.
*/
public com.google.protobuf.ByteString getSignatureBytes() {
java.lang.Object ref = signature_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
signature_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @param value The signature to set.
* @return This builder for chaining.
*/
public Builder setSignature(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
signature_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @return This builder for chaining.
*/
public Builder clearSignature() {
signature_ = getDefaultInstance().getSignature();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Required. The raw content of the signature, as output by GNU Privacy Guard
* (GPG) or equivalent. Since this message only supports attached signatures,
* the payload that was signed must be attached. While the signature format
* supported is dependent on the verification implementation, currently only
* ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
* `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
* --output=signature.gpg payload.json` will create the signature content
* expected in this field in `signature.gpg` for the `payload.json`
* attestation payload.
*
*
* string signature = 1;
*
* @param value The bytes for signature to set.
* @return This builder for chaining.
*/
public Builder setSignatureBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
signature_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
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.PgpSignedAttestation.ContentType content_type = 3;
*
* @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.PgpSignedAttestation.ContentType content_type = 3;
*
* @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_ |= 0x00000002;
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.PgpSignedAttestation.ContentType content_type = 3;
*
* @return The contentType.
*/
@java.lang.Override
public io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType getContentType() {
io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType result =
io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.forNumber(contentType_);
return result == null
? io.grafeas.v1beta1.attestation.PgpSignedAttestation.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.PgpSignedAttestation.ContentType content_type = 3;
*
* @param value The contentType to set.
* @return This builder for chaining.
*/
public Builder setContentType(
io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
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.PgpSignedAttestation.ContentType content_type = 3;
*
* @return This builder for chaining.
*/
public Builder clearContentType() {
bitField0_ = (bitField0_ & ~0x00000002);
contentType_ = 0;
onChanged();
return this;
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return Whether the pgpKeyId field is set.
*/
@java.lang.Override
public boolean hasPgpKeyId() {
return keyIdCase_ == 2;
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return The pgpKeyId.
*/
@java.lang.Override
public java.lang.String getPgpKeyId() {
java.lang.Object ref = "";
if (keyIdCase_ == 2) {
ref = keyId_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (keyIdCase_ == 2) {
keyId_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return The bytes for pgpKeyId.
*/
@java.lang.Override
public com.google.protobuf.ByteString getPgpKeyIdBytes() {
java.lang.Object ref = "";
if (keyIdCase_ == 2) {
ref = keyId_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (keyIdCase_ == 2) {
keyId_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @param value The pgpKeyId to set.
* @return This builder for chaining.
*/
public Builder setPgpKeyId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
keyIdCase_ = 2;
keyId_ = value;
onChanged();
return this;
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @return This builder for chaining.
*/
public Builder clearPgpKeyId() {
if (keyIdCase_ == 2) {
keyIdCase_ = 0;
keyId_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* The cryptographic fingerprint of the key used to generate the signature,
* as output by, e.g. `gpg --list-keys`. This should be the version 4, full
* 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
* https://tools.ietf.org/html/rfc4880#section-12.2 for details.
* Implementations may choose to acknowledge "LONG", "SHORT", or other
* abbreviated key IDs, but only the full fingerprint is guaranteed to work.
* In gpg, the full fingerprint can be retrieved from the `fpr` field
* returned when calling --list-keys with --with-colons. For example:
* ```
* gpg --with-colons --with-fingerprint --force-v4-certs \
* --list-keys attester@example.com
* tru::1:1513631572:0:3:1:5
* pub:...<SNIP>...
* fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
* ```
* Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
*
*
* string pgp_key_id = 2;
*
* @param value The bytes for pgpKeyId to set.
* @return This builder for chaining.
*/
public Builder setPgpKeyIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
keyIdCase_ = 2;
keyId_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.PgpSignedAttestation)
}
// @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.PgpSignedAttestation)
private static final io.grafeas.v1beta1.attestation.PgpSignedAttestation DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.PgpSignedAttestation();
}
public static io.grafeas.v1beta1.attestation.PgpSignedAttestation getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public PgpSignedAttestation 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.PgpSignedAttestation getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy