diff --git a/java-confidentialcomputing/README.md b/java-confidentialcomputing/README.md index 711586bc9905..746a38f4a480 100644 --- a/java-confidentialcomputing/README.md +++ b/java-confidentialcomputing/README.md @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-confidentialcomputing/java11.html [stability-image]: https://img.shields.io/badge/stability-preview-yellow [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-confidentialcomputing.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-confidentialcomputing/0.7.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-confidentialcomputing/0.8.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClient.java b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClient.java index 35154d61f31a..b717776fd8d9 100644 --- a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClient.java +++ b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClient.java @@ -327,6 +327,8 @@ public final UnaryCallable createChallengeCal * .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) * .setGcpCredentials(GcpCredentials.newBuilder().build()) * .setTpmAttestation(TpmAttestation.newBuilder().build()) + * .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + * .setTokenOptions(TokenOptions.newBuilder().build()) * .build(); * VerifyAttestationResponse response = confidentialComputingClient.verifyAttestation(request); * } @@ -358,6 +360,8 @@ public final VerifyAttestationResponse verifyAttestation(VerifyAttestationReques * .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) * .setGcpCredentials(GcpCredentials.newBuilder().build()) * .setTpmAttestation(TpmAttestation.newBuilder().build()) + * .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + * .setTokenOptions(TokenOptions.newBuilder().build()) * .build(); * ApiFuture future = * confidentialComputingClient.verifyAttestationCallable().futureCall(request); diff --git a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/resources/META-INF/native-image/com.google.cloud.confidentialcomputing.v1/reflect-config.json b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/resources/META-INF/native-image/com.google.cloud.confidentialcomputing.v1/reflect-config.json index fc86933fb914..07f569b6979f 100644 --- a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/resources/META-INF/native-image/com.google.cloud.confidentialcomputing.v1/reflect-config.json +++ b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/main/resources/META-INF/native-image/com.google.cloud.confidentialcomputing.v1/reflect-config.json @@ -395,6 +395,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.ContainerImageSignature", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.ContainerImageSignature$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.confidentialcomputing.v1.CreateChallengeRequest", "queryAllDeclaredConstructors": true, @@ -431,6 +467,51 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.confidentialcomputing.v1.SignedEntity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.SignedEntity$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.SigningAlgorithm", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.TokenOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.confidentialcomputing.v1.TokenOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.confidentialcomputing.v1.TpmAttestation", "queryAllDeclaredConstructors": true, diff --git a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientHttpJsonTest.java b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientHttpJsonTest.java index 140c81f8d27a..32742b09b202 100644 --- a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientHttpJsonTest.java +++ b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientHttpJsonTest.java @@ -195,6 +195,8 @@ public void verifyAttestationTest() throws Exception { .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) .setGcpCredentials(GcpCredentials.newBuilder().build()) .setTpmAttestation(TpmAttestation.newBuilder().build()) + .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + .setTokenOptions(TokenOptions.newBuilder().build()) .build(); VerifyAttestationResponse actualResponse = client.verifyAttestation(request); @@ -228,6 +230,8 @@ public void verifyAttestationExceptionTest() throws Exception { .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) .setGcpCredentials(GcpCredentials.newBuilder().build()) .setTpmAttestation(TpmAttestation.newBuilder().build()) + .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + .setTokenOptions(TokenOptions.newBuilder().build()) .build(); client.verifyAttestation(request); Assert.fail("No exception raised"); diff --git a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientTest.java b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientTest.java index d77b6b165aee..0c1c3b5fa11b 100644 --- a/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientTest.java +++ b/java-confidentialcomputing/google-cloud-confidentialcomputing/src/test/java/com/google/cloud/confidentialcomputing/v1/ConfidentialComputingClientTest.java @@ -191,6 +191,8 @@ public void verifyAttestationTest() throws Exception { .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) .setGcpCredentials(GcpCredentials.newBuilder().build()) .setTpmAttestation(TpmAttestation.newBuilder().build()) + .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + .setTokenOptions(TokenOptions.newBuilder().build()) .build(); VerifyAttestationResponse actualResponse = client.verifyAttestation(request); @@ -203,6 +205,9 @@ public void verifyAttestationTest() throws Exception { Assert.assertEquals(request.getChallenge(), actualRequest.getChallenge()); Assert.assertEquals(request.getGcpCredentials(), actualRequest.getGcpCredentials()); Assert.assertEquals(request.getTpmAttestation(), actualRequest.getTpmAttestation()); + Assert.assertEquals( + request.getConfidentialSpaceInfo(), actualRequest.getConfidentialSpaceInfo()); + Assert.assertEquals(request.getTokenOptions(), actualRequest.getTokenOptions()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -220,6 +225,8 @@ public void verifyAttestationExceptionTest() throws Exception { .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) .setGcpCredentials(GcpCredentials.newBuilder().build()) .setTpmAttestation(TpmAttestation.newBuilder().build()) + .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + .setTokenOptions(TokenOptions.newBuilder().build()) .build(); client.verifyAttestation(request); Assert.fail("No exception raised"); diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialSpaceInfo.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialSpaceInfo.java new file mode 100644 index 000000000000..07458506ec0d --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialSpaceInfo.java @@ -0,0 +1,1032 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +/** + * + * + *
+ * ConfidentialSpaceInfo contains information related to the Confidential Space
+ * TEE.
+ * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo} + */ +public final class ConfidentialSpaceInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) + ConfidentialSpaceInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfidentialSpaceInfo.newBuilder() to construct. + private ConfidentialSpaceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConfidentialSpaceInfo() { + signedEntities_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConfidentialSpaceInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.class, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder.class); + } + + public static final int SIGNED_ENTITIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List signedEntities_; + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSignedEntitiesList() { + return signedEntities_; + } + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getSignedEntitiesOrBuilderList() { + return signedEntities_; + } + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getSignedEntitiesCount() { + return signedEntities_.size(); + } + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SignedEntity getSignedEntities(int index) { + return signedEntities_.get(index); + } + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder getSignedEntitiesOrBuilder( + int index) { + return signedEntities_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < signedEntities_.size(); i++) { + output.writeMessage(1, signedEntities_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < signedEntities_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, signedEntities_.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 com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo)) { + return super.equals(obj); + } + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo other = + (com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) obj; + + if (!getSignedEntitiesList().equals(other.getSignedEntitiesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSignedEntitiesCount() > 0) { + hash = (37 * hash) + SIGNED_ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getSignedEntitiesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo 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 com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo 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 com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo 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( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo 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; + } + /** + * + * + *
+   * ConfidentialSpaceInfo contains information related to the Confidential Space
+   * TEE.
+   * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.class, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder.class); + } + + // Construct using com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (signedEntitiesBuilder_ == null) { + signedEntities_ = java.util.Collections.emptyList(); + } else { + signedEntities_ = null; + signedEntitiesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + getDefaultInstanceForType() { + return com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo build() { + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo buildPartial() { + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo result = + new com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo result) { + if (signedEntitiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + signedEntities_ = java.util.Collections.unmodifiableList(signedEntities_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.signedEntities_ = signedEntities_; + } else { + result.signedEntities_ = signedEntitiesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo result) { + int from_bitField0_ = bitField0_; + } + + @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 com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) { + return mergeFrom((com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo other) { + if (other + == com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.getDefaultInstance()) + return this; + if (signedEntitiesBuilder_ == null) { + if (!other.signedEntities_.isEmpty()) { + if (signedEntities_.isEmpty()) { + signedEntities_ = other.signedEntities_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSignedEntitiesIsMutable(); + signedEntities_.addAll(other.signedEntities_); + } + onChanged(); + } + } else { + if (!other.signedEntities_.isEmpty()) { + if (signedEntitiesBuilder_.isEmpty()) { + signedEntitiesBuilder_.dispose(); + signedEntitiesBuilder_ = null; + signedEntities_ = other.signedEntities_; + bitField0_ = (bitField0_ & ~0x00000001); + signedEntitiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSignedEntitiesFieldBuilder() + : null; + } else { + signedEntitiesBuilder_.addAllMessages(other.signedEntities_); + } + } + } + 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: + { + com.google.cloud.confidentialcomputing.v1.SignedEntity m = + input.readMessage( + com.google.cloud.confidentialcomputing.v1.SignedEntity.parser(), + extensionRegistry); + if (signedEntitiesBuilder_ == null) { + ensureSignedEntitiesIsMutable(); + signedEntities_.add(m); + } else { + signedEntitiesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List signedEntities_ = + java.util.Collections.emptyList(); + + private void ensureSignedEntitiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + signedEntities_ = + new java.util.ArrayList( + signedEntities_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.SignedEntity, + com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder, + com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder> + signedEntitiesBuilder_; + + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSignedEntitiesList() { + if (signedEntitiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(signedEntities_); + } else { + return signedEntitiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getSignedEntitiesCount() { + if (signedEntitiesBuilder_ == null) { + return signedEntities_.size(); + } else { + return signedEntitiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.SignedEntity getSignedEntities(int index) { + if (signedEntitiesBuilder_ == null) { + return signedEntities_.get(index); + } else { + return signedEntitiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSignedEntities( + int index, com.google.cloud.confidentialcomputing.v1.SignedEntity value) { + if (signedEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignedEntitiesIsMutable(); + signedEntities_.set(index, value); + onChanged(); + } else { + signedEntitiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSignedEntities( + int index, com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder builderForValue) { + if (signedEntitiesBuilder_ == null) { + ensureSignedEntitiesIsMutable(); + signedEntities_.set(index, builderForValue.build()); + onChanged(); + } else { + signedEntitiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSignedEntities(com.google.cloud.confidentialcomputing.v1.SignedEntity value) { + if (signedEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignedEntitiesIsMutable(); + signedEntities_.add(value); + onChanged(); + } else { + signedEntitiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSignedEntities( + int index, com.google.cloud.confidentialcomputing.v1.SignedEntity value) { + if (signedEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSignedEntitiesIsMutable(); + signedEntities_.add(index, value); + onChanged(); + } else { + signedEntitiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSignedEntities( + com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder builderForValue) { + if (signedEntitiesBuilder_ == null) { + ensureSignedEntitiesIsMutable(); + signedEntities_.add(builderForValue.build()); + onChanged(); + } else { + signedEntitiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addSignedEntities( + int index, com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder builderForValue) { + if (signedEntitiesBuilder_ == null) { + ensureSignedEntitiesIsMutable(); + signedEntities_.add(index, builderForValue.build()); + onChanged(); + } else { + signedEntitiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllSignedEntities( + java.lang.Iterable + values) { + if (signedEntitiesBuilder_ == null) { + ensureSignedEntitiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, signedEntities_); + onChanged(); + } else { + signedEntitiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSignedEntities() { + if (signedEntitiesBuilder_ == null) { + signedEntities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + signedEntitiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeSignedEntities(int index) { + if (signedEntitiesBuilder_ == null) { + ensureSignedEntitiesIsMutable(); + signedEntities_.remove(index); + onChanged(); + } else { + signedEntitiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder getSignedEntitiesBuilder( + int index) { + return getSignedEntitiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder + getSignedEntitiesOrBuilder(int index) { + if (signedEntitiesBuilder_ == null) { + return signedEntities_.get(index); + } else { + return signedEntitiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSignedEntitiesOrBuilderList() { + if (signedEntitiesBuilder_ != null) { + return signedEntitiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(signedEntities_); + } + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder + addSignedEntitiesBuilder() { + return getSignedEntitiesFieldBuilder() + .addBuilder(com.google.cloud.confidentialcomputing.v1.SignedEntity.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder addSignedEntitiesBuilder( + int index) { + return getSignedEntitiesFieldBuilder() + .addBuilder( + index, com.google.cloud.confidentialcomputing.v1.SignedEntity.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of signed entities containing container image signatures
+     * that can be used for server-side signature verification.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getSignedEntitiesBuilderList() { + return getSignedEntitiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.SignedEntity, + com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder, + com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder> + getSignedEntitiesFieldBuilder() { + if (signedEntitiesBuilder_ == null) { + signedEntitiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.SignedEntity, + com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder, + com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder>( + signedEntities_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + signedEntities_ = null; + } + return signedEntitiesBuilder_; + } + + @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:google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) + private static final com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo(); + } + + public static com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfidentialSpaceInfo 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 com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialSpaceInfoOrBuilder.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialSpaceInfoOrBuilder.java new file mode 100644 index 000000000000..530a98d822d6 --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ConfidentialSpaceInfoOrBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +public interface ConfidentialSpaceInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getSignedEntitiesList(); + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.confidentialcomputing.v1.SignedEntity getSignedEntities(int index); + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getSignedEntitiesCount(); + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getSignedEntitiesOrBuilderList(); + /** + * + * + *
+   * Optional. A list of signed entities containing container image signatures
+   * that can be used for server-side signature verification.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.SignedEntity signed_entities = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder getSignedEntitiesOrBuilder( + int index); +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ContainerImageSignature.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ContainerImageSignature.java new file mode 100644 index 000000000000..895407a40595 --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ContainerImageSignature.java @@ -0,0 +1,944 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +/** + * + * + *
+ * ContainerImageSignature holds necessary metadata to verify a container image
+ * signature.
+ * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.ContainerImageSignature} + */ +public final class ContainerImageSignature extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.confidentialcomputing.v1.ContainerImageSignature) + ContainerImageSignatureOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContainerImageSignature.newBuilder() to construct. + private ContainerImageSignature(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContainerImageSignature() { + payload_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + publicKey_ = com.google.protobuf.ByteString.EMPTY; + sigAlg_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContainerImageSignature(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.class, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder.class); + } + + public static final int PAYLOAD_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Required. The binary signature payload following the SimpleSigning format
+   * https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
+   * This payload includes the container image digest.
+   * 
+ * + * bytes payload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + + public static final int SIGNATURE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Required. A signature over the payload.
+   * The container image digest is incorporated into the signature as follows:
+   * 1. Generate a SimpleSigning format payload that includes the container
+   * image digest.
+   * 2. Generate a signature over SHA256 digest of the payload.
+   * The signature generation process can be represented as follows:
+   * `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
+   * 
+ * + * bytes signature = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString publicKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+   * Required. An associated public key used to verify the signature.
+   * 
+ * + * bytes public_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKey() { + return publicKey_; + } + + public static final int SIG_ALG_FIELD_NUMBER = 4; + private int sigAlg_ = 0; + /** + * + * + *
+   * Required. The algorithm used to produce the container image signature.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for sigAlg. + */ + @java.lang.Override + public int getSigAlgValue() { + return sigAlg_; + } + /** + * + * + *
+   * Required. The algorithm used to produce the container image signature.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sigAlg. + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SigningAlgorithm getSigAlg() { + com.google.cloud.confidentialcomputing.v1.SigningAlgorithm result = + com.google.cloud.confidentialcomputing.v1.SigningAlgorithm.forNumber(sigAlg_); + return result == null + ? com.google.cloud.confidentialcomputing.v1.SigningAlgorithm.UNRECOGNIZED + : result; + } + + 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 (!payload_.isEmpty()) { + output.writeBytes(1, payload_); + } + if (!signature_.isEmpty()) { + output.writeBytes(2, signature_); + } + if (!publicKey_.isEmpty()) { + output.writeBytes(3, publicKey_); + } + if (sigAlg_ + != com.google.cloud.confidentialcomputing.v1.SigningAlgorithm.SIGNING_ALGORITHM_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, sigAlg_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!payload_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, payload_); + } + if (!signature_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, signature_); + } + if (!publicKey_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(3, publicKey_); + } + if (sigAlg_ + != com.google.cloud.confidentialcomputing.v1.SigningAlgorithm.SIGNING_ALGORITHM_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, sigAlg_); + } + 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 com.google.cloud.confidentialcomputing.v1.ContainerImageSignature)) { + return super.equals(obj); + } + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature other = + (com.google.cloud.confidentialcomputing.v1.ContainerImageSignature) obj; + + if (!getPayload().equals(other.getPayload())) return false; + if (!getSignature().equals(other.getSignature())) return false; + if (!getPublicKey().equals(other.getPublicKey())) return false; + if (sigAlg_ != other.sigAlg_) 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) + PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getPayload().hashCode(); + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + SIG_ALG_FIELD_NUMBER; + hash = (53 * hash) + sigAlg_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature 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 com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + 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 com.google.cloud.confidentialcomputing.v1.ContainerImageSignature parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature 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( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature 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; + } + /** + * + * + *
+   * ContainerImageSignature holds necessary metadata to verify a container image
+   * signature.
+   * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.ContainerImageSignature} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.confidentialcomputing.v1.ContainerImageSignature) + com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.class, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder.class); + } + + // Construct using + // com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + payload_ = com.google.protobuf.ByteString.EMPTY; + signature_ = com.google.protobuf.ByteString.EMPTY; + publicKey_ = com.google.protobuf.ByteString.EMPTY; + sigAlg_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_descriptor; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + getDefaultInstanceForType() { + return com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature build() { + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature buildPartial() { + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature result = + new com.google.cloud.confidentialcomputing.v1.ContainerImageSignature(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.payload_ = payload_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.signature_ = signature_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.publicKey_ = publicKey_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.sigAlg_ = sigAlg_; + } + } + + @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 com.google.cloud.confidentialcomputing.v1.ContainerImageSignature) { + return mergeFrom((com.google.cloud.confidentialcomputing.v1.ContainerImageSignature) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature other) { + if (other + == com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.getDefaultInstance()) + return this; + if (other.getPayload() != com.google.protobuf.ByteString.EMPTY) { + setPayload(other.getPayload()); + } + if (other.getSignature() != com.google.protobuf.ByteString.EMPTY) { + setSignature(other.getSignature()); + } + if (other.getPublicKey() != com.google.protobuf.ByteString.EMPTY) { + setPublicKey(other.getPublicKey()); + } + if (other.sigAlg_ != 0) { + setSigAlgValue(other.getSigAlgValue()); + } + 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: + { + payload_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + signature_ = input.readBytes(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + publicKey_ = input.readBytes(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + sigAlg_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Required. The binary signature payload following the SimpleSigning format
+     * https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
+     * This payload includes the container image digest.
+     * 
+ * + * bytes payload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The payload. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPayload() { + return payload_; + } + /** + * + * + *
+     * Required. The binary signature payload following the SimpleSigning format
+     * https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
+     * This payload includes the container image digest.
+     * 
+ * + * bytes payload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The payload to set. + * @return This builder for chaining. + */ + public Builder setPayload(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The binary signature payload following the SimpleSigning format
+     * https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
+     * This payload includes the container image digest.
+     * 
+ * + * bytes payload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPayload() { + bitField0_ = (bitField0_ & ~0x00000001); + payload_ = getDefaultInstance().getPayload(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Required. A signature over the payload.
+     * The container image digest is incorporated into the signature as follows:
+     * 1. Generate a SimpleSigning format payload that includes the container
+     * image digest.
+     * 2. Generate a signature over SHA256 digest of the payload.
+     * The signature generation process can be represented as follows:
+     * `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
+     * 
+ * + * bytes signature = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The signature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + * + * + *
+     * Required. A signature over the payload.
+     * The container image digest is incorporated into the signature as follows:
+     * 1. Generate a SimpleSigning format payload that includes the container
+     * image digest.
+     * 2. Generate a signature over SHA256 digest of the payload.
+     * The signature generation process can be represented as follows:
+     * `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
+     * 
+ * + * bytes signature = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The signature to set. + * @return This builder for chaining. + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + signature_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. A signature over the payload.
+     * The container image digest is incorporated into the signature as follows:
+     * 1. Generate a SimpleSigning format payload that includes the container
+     * image digest.
+     * 2. Generate a signature over SHA256 digest of the payload.
+     * The signature generation process can be represented as follows:
+     * `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
+     * 
+ * + * bytes signature = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearSignature() { + bitField0_ = (bitField0_ & ~0x00000002); + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString publicKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Required. An associated public key used to verify the signature.
+     * 
+ * + * bytes public_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The publicKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPublicKey() { + return publicKey_; + } + /** + * + * + *
+     * Required. An associated public key used to verify the signature.
+     * 
+ * + * bytes public_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The publicKey to set. + * @return This builder for chaining. + */ + public Builder setPublicKey(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + publicKey_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. An associated public key used to verify the signature.
+     * 
+ * + * bytes public_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearPublicKey() { + bitField0_ = (bitField0_ & ~0x00000004); + publicKey_ = getDefaultInstance().getPublicKey(); + onChanged(); + return this; + } + + private int sigAlg_ = 0; + /** + * + * + *
+     * Required. The algorithm used to produce the container image signature.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for sigAlg. + */ + @java.lang.Override + public int getSigAlgValue() { + return sigAlg_; + } + /** + * + * + *
+     * Required. The algorithm used to produce the container image signature.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The enum numeric value on the wire for sigAlg to set. + * @return This builder for chaining. + */ + public Builder setSigAlgValue(int value) { + sigAlg_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The algorithm used to produce the container image signature.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sigAlg. + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SigningAlgorithm getSigAlg() { + com.google.cloud.confidentialcomputing.v1.SigningAlgorithm result = + com.google.cloud.confidentialcomputing.v1.SigningAlgorithm.forNumber(sigAlg_); + return result == null + ? com.google.cloud.confidentialcomputing.v1.SigningAlgorithm.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. The algorithm used to produce the container image signature.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The sigAlg to set. + * @return This builder for chaining. + */ + public Builder setSigAlg(com.google.cloud.confidentialcomputing.v1.SigningAlgorithm value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + sigAlg_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The algorithm used to produce the container image signature.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearSigAlg() { + bitField0_ = (bitField0_ & ~0x00000008); + sigAlg_ = 0; + 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:google.cloud.confidentialcomputing.v1.ContainerImageSignature) + } + + // @@protoc_insertion_point(class_scope:google.cloud.confidentialcomputing.v1.ContainerImageSignature) + private static final com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.confidentialcomputing.v1.ContainerImageSignature(); + } + + public static com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContainerImageSignature 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 com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ContainerImageSignatureOrBuilder.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ContainerImageSignatureOrBuilder.java new file mode 100644 index 000000000000..689105cddaf6 --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ContainerImageSignatureOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +public interface ContainerImageSignatureOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.confidentialcomputing.v1.ContainerImageSignature) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The binary signature payload following the SimpleSigning format
+   * https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing.
+   * This payload includes the container image digest.
+   * 
+ * + * bytes payload = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The payload. + */ + com.google.protobuf.ByteString getPayload(); + + /** + * + * + *
+   * Required. A signature over the payload.
+   * The container image digest is incorporated into the signature as follows:
+   * 1. Generate a SimpleSigning format payload that includes the container
+   * image digest.
+   * 2. Generate a signature over SHA256 digest of the payload.
+   * The signature generation process can be represented as follows:
+   * `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))`
+   * 
+ * + * bytes signature = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The signature. + */ + com.google.protobuf.ByteString getSignature(); + + /** + * + * + *
+   * Required. An associated public key used to verify the signature.
+   * 
+ * + * bytes public_key = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The publicKey. + */ + com.google.protobuf.ByteString getPublicKey(); + + /** + * + * + *
+   * Required. The algorithm used to produce the container image signature.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The enum numeric value on the wire for sigAlg. + */ + int getSigAlgValue(); + /** + * + * + *
+   * Required. The algorithm used to produce the container image signature.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.SigningAlgorithm sig_alg = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The sigAlg. + */ + com.google.cloud.confidentialcomputing.v1.SigningAlgorithm getSigAlg(); +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ServiceProto.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ServiceProto.java index b3d88972f4f3..a10b34e6680b 100644 --- a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ServiceProto.java +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/ServiceProto.java @@ -47,6 +47,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_confidentialcomputing_v1_GcpCredentials_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_confidentialcomputing_v1_GcpCredentials_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -59,6 +63,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_Quote_PcrValuesEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_Quote_PcrValuesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -85,48 +101,68 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "eRequest\022:\n\006parent\030\001 \001(\tB*\342A\001\002\372A#\n!locat" + "ions.googleapis.com/Location\022I\n\tchalleng" + "e\030\002 \001(\01320.google.cloud.confidentialcompu" - + "ting.v1.ChallengeB\004\342A\001\002\"\222\002\n\030VerifyAttest" + + "ting.v1.ChallengeB\004\342A\001\002\"\311\003\n\030VerifyAttest" + "ationRequest\022J\n\tchallenge\030\001 \001(\tB7\342A\001\002\372A0" + "\n.confidentialcomputing.googleapis.com/C" + "hallenge\022T\n\017gcp_credentials\030\002 \001(\01325.goog" + "le.cloud.confidentialcomputing.v1.GcpCre" + "dentialsB\004\342A\001\001\022T\n\017tpm_attestation\030\003 \001(\0132" + "5.google.cloud.confidentialcomputing.v1." - + "TpmAttestationB\004\342A\001\002\"<\n\031VerifyAttestatio" - + "nResponse\022\037\n\021oidc_claims_token\030\002 \001(\tB\004\342A" - + "\001\003\"3\n\016GcpCredentials\022!\n\031service_account_" - + "id_tokens\030\002 \003(\t\"\217\003\n\016TpmAttestation\022K\n\006qu" - + "otes\030\001 \003(\0132;.google.cloud.confidentialco" - + "mputing.v1.TpmAttestation.Quote\022\025\n\rtcg_e" - + "vent_log\030\002 \001(\014\022\033\n\023canonical_event_log\030\003 " - + "\001(\014\022\017\n\007ak_cert\030\004 \001(\014\022\022\n\ncert_chain\030\005 \003(\014" - + "\032\326\001\n\005Quote\022\021\n\thash_algo\030\001 \001(\005\022^\n\npcr_val" - + "ues\030\002 \003(\0132J.google.cloud.confidentialcom" - + "puting.v1.TpmAttestation.Quote.PcrValues" - + "Entry\022\021\n\traw_quote\030\003 \001(\014\022\025\n\rraw_signatur" - + "e\030\004 \001(\014\0320\n\016PcrValuesEntry\022\013\n\003key\030\001 \001(\005\022\r" - + "\n\005value\030\002 \001(\014:\0028\0012\267\004\n\025ConfidentialComput" - + "ing\022\330\001\n\017CreateChallenge\022=.google.cloud.c" - + "onfidentialcomputing.v1.CreateChallengeR" - + "equest\0320.google.cloud.confidentialcomput" - + "ing.v1.Challenge\"T\332A\020parent,challenge\202\323\344" - + "\223\002;\"./v1/{parent=projects/*/locations/*}" - + "/challenges:\tchallenge\022\350\001\n\021VerifyAttesta" - + "tion\022?.google.cloud.confidentialcomputin" - + "g.v1.VerifyAttestationRequest\032@.google.c" - + "loud.confidentialcomputing.v1.VerifyAtte" - + "stationResponse\"P\202\323\344\223\002J\"E/v1/{challenge=" - + "projects/*/locations/*/challenges/*}:ver" - + "ifyAttestation:\001*\032X\312A$confidentialcomput" - + "ing.googleapis.com\322A.https://www.googlea" - + "pis.com/auth/cloud-platformB\227\002\n)com.goog" - + "le.cloud.confidentialcomputing.v1B\014Servi" - + "ceProtoP\001Z_cloud.google.com/go/confident" - + "ialcomputing/apiv1/confidentialcomputing" - + "pb;confidentialcomputingpb\252\002%Google.Clou" - + "d.ConfidentialComputing.V1\312\002%Google\\Clou" - + "d\\ConfidentialComputing\\V1\352\002(Google::Clo" - + "ud::ConfidentialComputing::V1b\006proto3" + + "TpmAttestationB\004\342A\001\002\022c\n\027confidential_spa" + + "ce_info\030\004 \001(\0132<.google.cloud.confidentia" + + "lcomputing.v1.ConfidentialSpaceInfoB\004\342A\001" + + "\001\022P\n\rtoken_options\030\005 \001(\01323.google.cloud." + + "confidentialcomputing.v1.TokenOptionsB\004\342" + + "A\001\001\"<\n\031VerifyAttestationResponse\022\037\n\021oidc" + + "_claims_token\030\002 \001(\tB\004\342A\001\003\"3\n\016GcpCredenti" + + "als\022!\n\031service_account_id_tokens\030\002 \003(\t\";" + + "\n\014TokenOptions\022\026\n\010audience\030\001 \001(\tB\004\342A\001\001\022\023" + + "\n\005nonce\030\002 \003(\tB\004\342A\001\001\"\217\003\n\016TpmAttestation\022K" + + "\n\006quotes\030\001 \003(\0132;.google.cloud.confidenti" + + "alcomputing.v1.TpmAttestation.Quote\022\025\n\rt" + + "cg_event_log\030\002 \001(\014\022\033\n\023canonical_event_lo" + + "g\030\003 \001(\014\022\017\n\007ak_cert\030\004 \001(\014\022\022\n\ncert_chain\030\005" + + " \003(\014\032\326\001\n\005Quote\022\021\n\thash_algo\030\001 \001(\005\022^\n\npcr" + + "_values\030\002 \003(\0132J.google.cloud.confidentia" + + "lcomputing.v1.TpmAttestation.Quote.PcrVa" + + "luesEntry\022\021\n\traw_quote\030\003 \001(\014\022\025\n\rraw_sign" + + "ature\030\004 \001(\014\0320\n\016PcrValuesEntry\022\013\n\003key\030\001 \001" + + "(\005\022\r\n\005value\030\002 \001(\014:\0028\001\"k\n\025ConfidentialSpa" + + "ceInfo\022R\n\017signed_entities\030\001 \003(\01323.google" + + ".cloud.confidentialcomputing.v1.SignedEn" + + "tityB\004\342A\001\001\"x\n\014SignedEntity\022h\n\032container_" + + "image_signatures\030\001 \003(\0132>.google.cloud.co" + + "nfidentialcomputing.v1.ContainerImageSig" + + "natureB\004\342A\001\001\"\263\001\n\027ContainerImageSignature" + + "\022\025\n\007payload\030\001 \001(\014B\004\342A\001\002\022\027\n\tsignature\030\002 \001" + + "(\014B\004\342A\001\002\022\030\n\npublic_key\030\003 \001(\014B\004\342A\001\002\022N\n\007si" + + "g_alg\030\004 \001(\01627.google.cloud.confidentialc" + + "omputing.v1.SigningAlgorithmB\004\342A\001\002*\177\n\020Si" + + "gningAlgorithm\022!\n\035SIGNING_ALGORITHM_UNSP" + + "ECIFIED\020\000\022\025\n\021RSASSA_PSS_SHA256\020\001\022\032\n\026RSAS" + + "SA_PKCS1V15_SHA256\020\002\022\025\n\021ECDSA_P256_SHA25" + + "6\020\0032\267\004\n\025ConfidentialComputing\022\330\001\n\017Create" + + "Challenge\022=.google.cloud.confidentialcom" + + "puting.v1.CreateChallengeRequest\0320.googl" + + "e.cloud.confidentialcomputing.v1.Challen" + + "ge\"T\332A\020parent,challenge\202\323\344\223\002;\"./v1/{pare" + + "nt=projects/*/locations/*}/challenges:\tc" + + "hallenge\022\350\001\n\021VerifyAttestation\022?.google." + + "cloud.confidentialcomputing.v1.VerifyAtt" + + "estationRequest\032@.google.cloud.confident" + + "ialcomputing.v1.VerifyAttestationRespons" + + "e\"P\202\323\344\223\002J\"E/v1/{challenge=projects/*/loc" + + "ations/*/challenges/*}:verifyAttestation" + + ":\001*\032X\312A$confidentialcomputing.googleapis" + + ".com\322A.https://www.googleapis.com/auth/c" + + "loud-platformB\227\002\n)com.google.cloud.confi" + + "dentialcomputing.v1B\014ServiceProtoP\001Z_clo" + + "ud.google.com/go/confidentialcomputing/a" + + "piv1/confidentialcomputingpb;confidentia" + + "lcomputingpb\252\002%Google.Cloud.Confidential" + + "Computing.V1\312\002%Google\\Cloud\\Confidential" + + "Computing\\V1\352\002(Google::Cloud::Confidenti" + + "alComputing::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -160,7 +196,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_confidentialcomputing_v1_VerifyAttestationRequest_descriptor, new java.lang.String[] { - "Challenge", "GcpCredentials", "TpmAttestation", + "Challenge", + "GcpCredentials", + "TpmAttestation", + "ConfidentialSpaceInfo", + "TokenOptions", }); internal_static_google_cloud_confidentialcomputing_v1_VerifyAttestationResponse_descriptor = getDescriptor().getMessageTypes().get(3); @@ -178,8 +218,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "ServiceAccountIdTokens", }); - internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_descriptor = + internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_descriptor, + new java.lang.String[] { + "Audience", "Nonce", + }); + internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_descriptor = + getDescriptor().getMessageTypes().get(6); internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_confidentialcomputing_v1_TpmAttestation_descriptor, @@ -206,6 +254,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_confidentialcomputing_v1_ConfidentialSpaceInfo_descriptor, + new java.lang.String[] { + "SignedEntities", + }); + internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_descriptor, + new java.lang.String[] { + "ContainerImageSignatures", + }); + internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_confidentialcomputing_v1_ContainerImageSignature_descriptor, + new java.lang.String[] { + "Payload", "Signature", "PublicKey", "SigAlg", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SignedEntity.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SignedEntity.java new file mode 100644 index 000000000000..1bfe013ab8ac --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SignedEntity.java @@ -0,0 +1,1043 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +/** + * + * + *
+ * SignedEntity represents an OCI image object containing everything necessary
+ * to verify container image signatures.
+ * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.SignedEntity} + */ +public final class SignedEntity extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.confidentialcomputing.v1.SignedEntity) + SignedEntityOrBuilder { + private static final long serialVersionUID = 0L; + // Use SignedEntity.newBuilder() to construct. + private SignedEntity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SignedEntity() { + containerImageSignatures_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SignedEntity(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.SignedEntity.class, + com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder.class); + } + + public static final int CONTAINER_IMAGE_SIGNATURES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + containerImageSignatures_; + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getContainerImageSignaturesList() { + return containerImageSignatures_; + } + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder> + getContainerImageSignaturesOrBuilderList() { + return containerImageSignatures_; + } + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getContainerImageSignaturesCount() { + return containerImageSignatures_.size(); + } + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + getContainerImageSignatures(int index) { + return containerImageSignatures_.get(index); + } + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder + getContainerImageSignaturesOrBuilder(int index) { + return containerImageSignatures_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < containerImageSignatures_.size(); i++) { + output.writeMessage(1, containerImageSignatures_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < containerImageSignatures_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, containerImageSignatures_.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 com.google.cloud.confidentialcomputing.v1.SignedEntity)) { + return super.equals(obj); + } + com.google.cloud.confidentialcomputing.v1.SignedEntity other = + (com.google.cloud.confidentialcomputing.v1.SignedEntity) obj; + + if (!getContainerImageSignaturesList().equals(other.getContainerImageSignaturesList())) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getContainerImageSignaturesCount() > 0) { + hash = (37 * hash) + CONTAINER_IMAGE_SIGNATURES_FIELD_NUMBER; + hash = (53 * hash) + getContainerImageSignaturesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity 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 com.google.cloud.confidentialcomputing.v1.SignedEntity parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity 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 com.google.cloud.confidentialcomputing.v1.SignedEntity parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity 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( + com.google.cloud.confidentialcomputing.v1.SignedEntity 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; + } + /** + * + * + *
+   * SignedEntity represents an OCI image object containing everything necessary
+   * to verify container image signatures.
+   * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.SignedEntity} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.confidentialcomputing.v1.SignedEntity) + com.google.cloud.confidentialcomputing.v1.SignedEntityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.SignedEntity.class, + com.google.cloud.confidentialcomputing.v1.SignedEntity.Builder.class); + } + + // Construct using com.google.cloud.confidentialcomputing.v1.SignedEntity.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (containerImageSignaturesBuilder_ == null) { + containerImageSignatures_ = java.util.Collections.emptyList(); + } else { + containerImageSignatures_ = null; + containerImageSignaturesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_SignedEntity_descriptor; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SignedEntity getDefaultInstanceForType() { + return com.google.cloud.confidentialcomputing.v1.SignedEntity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SignedEntity build() { + com.google.cloud.confidentialcomputing.v1.SignedEntity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.SignedEntity buildPartial() { + com.google.cloud.confidentialcomputing.v1.SignedEntity result = + new com.google.cloud.confidentialcomputing.v1.SignedEntity(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.confidentialcomputing.v1.SignedEntity result) { + if (containerImageSignaturesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + containerImageSignatures_ = + java.util.Collections.unmodifiableList(containerImageSignatures_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.containerImageSignatures_ = containerImageSignatures_; + } else { + result.containerImageSignatures_ = containerImageSignaturesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.confidentialcomputing.v1.SignedEntity result) { + int from_bitField0_ = bitField0_; + } + + @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 com.google.cloud.confidentialcomputing.v1.SignedEntity) { + return mergeFrom((com.google.cloud.confidentialcomputing.v1.SignedEntity) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.confidentialcomputing.v1.SignedEntity other) { + if (other == com.google.cloud.confidentialcomputing.v1.SignedEntity.getDefaultInstance()) + return this; + if (containerImageSignaturesBuilder_ == null) { + if (!other.containerImageSignatures_.isEmpty()) { + if (containerImageSignatures_.isEmpty()) { + containerImageSignatures_ = other.containerImageSignatures_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.addAll(other.containerImageSignatures_); + } + onChanged(); + } + } else { + if (!other.containerImageSignatures_.isEmpty()) { + if (containerImageSignaturesBuilder_.isEmpty()) { + containerImageSignaturesBuilder_.dispose(); + containerImageSignaturesBuilder_ = null; + containerImageSignatures_ = other.containerImageSignatures_; + bitField0_ = (bitField0_ & ~0x00000001); + containerImageSignaturesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getContainerImageSignaturesFieldBuilder() + : null; + } else { + containerImageSignaturesBuilder_.addAllMessages(other.containerImageSignatures_); + } + } + } + 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: + { + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature m = + input.readMessage( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.parser(), + extensionRegistry); + if (containerImageSignaturesBuilder_ == null) { + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.add(m); + } else { + containerImageSignaturesBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + containerImageSignatures_ = java.util.Collections.emptyList(); + + private void ensureContainerImageSignaturesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + containerImageSignatures_ = + new java.util.ArrayList< + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature>( + containerImageSignatures_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder> + containerImageSignaturesBuilder_; + + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getContainerImageSignaturesList() { + if (containerImageSignaturesBuilder_ == null) { + return java.util.Collections.unmodifiableList(containerImageSignatures_); + } else { + return containerImageSignaturesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getContainerImageSignaturesCount() { + if (containerImageSignaturesBuilder_ == null) { + return containerImageSignatures_.size(); + } else { + return containerImageSignaturesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + getContainerImageSignatures(int index) { + if (containerImageSignaturesBuilder_ == null) { + return containerImageSignatures_.get(index); + } else { + return containerImageSignaturesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContainerImageSignatures( + int index, com.google.cloud.confidentialcomputing.v1.ContainerImageSignature value) { + if (containerImageSignaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.set(index, value); + onChanged(); + } else { + containerImageSignaturesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setContainerImageSignatures( + int index, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder builderForValue) { + if (containerImageSignaturesBuilder_ == null) { + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.set(index, builderForValue.build()); + onChanged(); + } else { + containerImageSignaturesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContainerImageSignatures( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature value) { + if (containerImageSignaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.add(value); + onChanged(); + } else { + containerImageSignaturesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContainerImageSignatures( + int index, com.google.cloud.confidentialcomputing.v1.ContainerImageSignature value) { + if (containerImageSignaturesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.add(index, value); + onChanged(); + } else { + containerImageSignaturesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContainerImageSignatures( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder builderForValue) { + if (containerImageSignaturesBuilder_ == null) { + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.add(builderForValue.build()); + onChanged(); + } else { + containerImageSignaturesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addContainerImageSignatures( + int index, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder builderForValue) { + if (containerImageSignaturesBuilder_ == null) { + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.add(index, builderForValue.build()); + onChanged(); + } else { + containerImageSignaturesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllContainerImageSignatures( + java.lang.Iterable< + ? extends com.google.cloud.confidentialcomputing.v1.ContainerImageSignature> + values) { + if (containerImageSignaturesBuilder_ == null) { + ensureContainerImageSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, containerImageSignatures_); + onChanged(); + } else { + containerImageSignaturesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearContainerImageSignatures() { + if (containerImageSignaturesBuilder_ == null) { + containerImageSignatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + containerImageSignaturesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeContainerImageSignatures(int index) { + if (containerImageSignaturesBuilder_ == null) { + ensureContainerImageSignaturesIsMutable(); + containerImageSignatures_.remove(index); + onChanged(); + } else { + containerImageSignaturesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder + getContainerImageSignaturesBuilder(int index) { + return getContainerImageSignaturesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder + getContainerImageSignaturesOrBuilder(int index) { + if (containerImageSignaturesBuilder_ == null) { + return containerImageSignatures_.get(index); + } else { + return containerImageSignaturesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder> + getContainerImageSignaturesOrBuilderList() { + if (containerImageSignaturesBuilder_ != null) { + return containerImageSignaturesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(containerImageSignatures_); + } + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder + addContainerImageSignaturesBuilder() { + return getContainerImageSignaturesFieldBuilder() + .addBuilder( + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + .getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder + addContainerImageSignaturesBuilder(int index) { + return getContainerImageSignaturesFieldBuilder() + .addBuilder( + index, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature + .getDefaultInstance()); + } + /** + * + * + *
+     * Optional. A list of container image signatures attached to an OCI image
+     * object.
+     * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getContainerImageSignaturesBuilderList() { + return getContainerImageSignaturesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder> + getContainerImageSignaturesFieldBuilder() { + if (containerImageSignaturesBuilder_ == null) { + containerImageSignaturesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature.Builder, + com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder>( + containerImageSignatures_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + containerImageSignatures_ = null; + } + return containerImageSignaturesBuilder_; + } + + @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:google.cloud.confidentialcomputing.v1.SignedEntity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.confidentialcomputing.v1.SignedEntity) + private static final com.google.cloud.confidentialcomputing.v1.SignedEntity DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.confidentialcomputing.v1.SignedEntity(); + } + + public static com.google.cloud.confidentialcomputing.v1.SignedEntity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SignedEntity 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 com.google.cloud.confidentialcomputing.v1.SignedEntity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SignedEntityOrBuilder.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SignedEntityOrBuilder.java new file mode 100644 index 000000000000..d7154d4903a2 --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SignedEntityOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +public interface SignedEntityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.confidentialcomputing.v1.SignedEntity) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getContainerImageSignaturesList(); + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.confidentialcomputing.v1.ContainerImageSignature getContainerImageSignatures( + int index); + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getContainerImageSignaturesCount(); + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List< + ? extends com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder> + getContainerImageSignaturesOrBuilderList(); + /** + * + * + *
+   * Optional. A list of container image signatures attached to an OCI image
+   * object.
+   * 
+ * + * + * repeated .google.cloud.confidentialcomputing.v1.ContainerImageSignature container_image_signatures = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.confidentialcomputing.v1.ContainerImageSignatureOrBuilder + getContainerImageSignaturesOrBuilder(int index); +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SigningAlgorithm.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SigningAlgorithm.java new file mode 100644 index 000000000000..50b0dda68ca1 --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/SigningAlgorithm.java @@ -0,0 +1,200 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +/** + * + * + *
+ * SigningAlgorithm enumerates all the supported signing algorithms.
+ * 
+ * + * Protobuf enum {@code google.cloud.confidentialcomputing.v1.SigningAlgorithm} + */ +public enum SigningAlgorithm implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified signing algorithm.
+   * 
+ * + * SIGNING_ALGORITHM_UNSPECIFIED = 0; + */ + SIGNING_ALGORITHM_UNSPECIFIED(0), + /** + * + * + *
+   * RSASSA-PSS with a SHA256 digest.
+   * 
+ * + * RSASSA_PSS_SHA256 = 1; + */ + RSASSA_PSS_SHA256(1), + /** + * + * + *
+   * RSASSA-PKCS1 v1.5 with a SHA256 digest.
+   * 
+ * + * RSASSA_PKCS1V15_SHA256 = 2; + */ + RSASSA_PKCS1V15_SHA256(2), + /** + * + * + *
+   * ECDSA on the P-256 Curve with a SHA256 digest.
+   * 
+ * + * ECDSA_P256_SHA256 = 3; + */ + ECDSA_P256_SHA256(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified signing algorithm.
+   * 
+ * + * SIGNING_ALGORITHM_UNSPECIFIED = 0; + */ + public static final int SIGNING_ALGORITHM_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * RSASSA-PSS with a SHA256 digest.
+   * 
+ * + * RSASSA_PSS_SHA256 = 1; + */ + public static final int RSASSA_PSS_SHA256_VALUE = 1; + /** + * + * + *
+   * RSASSA-PKCS1 v1.5 with a SHA256 digest.
+   * 
+ * + * RSASSA_PKCS1V15_SHA256 = 2; + */ + public static final int RSASSA_PKCS1V15_SHA256_VALUE = 2; + /** + * + * + *
+   * ECDSA on the P-256 Curve with a SHA256 digest.
+   * 
+ * + * ECDSA_P256_SHA256 = 3; + */ + public static final int ECDSA_P256_SHA256_VALUE = 3; + + 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 SigningAlgorithm 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 SigningAlgorithm forNumber(int value) { + switch (value) { + case 0: + return SIGNING_ALGORITHM_UNSPECIFIED; + case 1: + return RSASSA_PSS_SHA256; + case 2: + return RSASSA_PKCS1V15_SHA256; + case 3: + return ECDSA_P256_SHA256; + 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 SigningAlgorithm findValueByNumber(int number) { + return SigningAlgorithm.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 com.google.cloud.confidentialcomputing.v1.ServiceProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SigningAlgorithm[] VALUES = values(); + + public static SigningAlgorithm 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 SigningAlgorithm(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.confidentialcomputing.v1.SigningAlgorithm) +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptions.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptions.java new file mode 100644 index 000000000000..8899c5003b74 --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptions.java @@ -0,0 +1,935 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +/** + * + * + *
+ * Options to modify claims in the token to generate custom-purpose tokens.
+ * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.TokenOptions} + */ +public final class TokenOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.confidentialcomputing.v1.TokenOptions) + TokenOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TokenOptions.newBuilder() to construct. + private TokenOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TokenOptions() { + audience_ = ""; + nonce_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TokenOptions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.TokenOptions.class, + com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder.class); + } + + public static final int AUDIENCE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object audience_ = ""; + /** + * + * + *
+   * Optional. Optional string to issue the token with a custom audience claim.
+   * Required if one or more nonces are specified.
+   * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The audience. + */ + @java.lang.Override + public java.lang.String getAudience() { + java.lang.Object ref = audience_; + 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(); + audience_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Optional string to issue the token with a custom audience claim.
+   * Required if one or more nonces are specified.
+   * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for audience. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudienceBytes() { + java.lang.Object ref = audience_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audience_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NONCE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList nonce_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the nonce. + */ + public com.google.protobuf.ProtocolStringList getNonceList() { + return nonce_; + } + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of nonce. + */ + public int getNonceCount() { + return nonce_.size(); + } + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The nonce at the given index. + */ + public java.lang.String getNonce(int index) { + return nonce_.get(index); + } + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the nonce at the given index. + */ + public com.google.protobuf.ByteString getNonceBytes(int index) { + return nonce_.getByteString(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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audience_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, audience_); + } + for (int i = 0; i < nonce_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nonce_.getRaw(i)); + } + 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(audience_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, audience_); + } + { + int dataSize = 0; + for (int i = 0; i < nonce_.size(); i++) { + dataSize += computeStringSizeNoTag(nonce_.getRaw(i)); + } + size += dataSize; + size += 1 * getNonceList().size(); + } + 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 com.google.cloud.confidentialcomputing.v1.TokenOptions)) { + return super.equals(obj); + } + com.google.cloud.confidentialcomputing.v1.TokenOptions other = + (com.google.cloud.confidentialcomputing.v1.TokenOptions) obj; + + if (!getAudience().equals(other.getAudience())) return false; + if (!getNonceList().equals(other.getNonceList())) 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) + AUDIENCE_FIELD_NUMBER; + hash = (53 * hash) + getAudience().hashCode(); + if (getNonceCount() > 0) { + hash = (37 * hash) + NONCE_FIELD_NUMBER; + hash = (53 * hash) + getNonceList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions 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 com.google.cloud.confidentialcomputing.v1.TokenOptions parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions 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 com.google.cloud.confidentialcomputing.v1.TokenOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions 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( + com.google.cloud.confidentialcomputing.v1.TokenOptions 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; + } + /** + * + * + *
+   * Options to modify claims in the token to generate custom-purpose tokens.
+   * 
+ * + * Protobuf type {@code google.cloud.confidentialcomputing.v1.TokenOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.confidentialcomputing.v1.TokenOptions) + com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.confidentialcomputing.v1.TokenOptions.class, + com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder.class); + } + + // Construct using com.google.cloud.confidentialcomputing.v1.TokenOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + audience_ = ""; + nonce_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.confidentialcomputing.v1.ServiceProto + .internal_static_google_cloud_confidentialcomputing_v1_TokenOptions_descriptor; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.TokenOptions getDefaultInstanceForType() { + return com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.TokenOptions build() { + com.google.cloud.confidentialcomputing.v1.TokenOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.TokenOptions buildPartial() { + com.google.cloud.confidentialcomputing.v1.TokenOptions result = + new com.google.cloud.confidentialcomputing.v1.TokenOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.confidentialcomputing.v1.TokenOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.audience_ = audience_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + nonce_.makeImmutable(); + result.nonce_ = nonce_; + } + } + + @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 com.google.cloud.confidentialcomputing.v1.TokenOptions) { + return mergeFrom((com.google.cloud.confidentialcomputing.v1.TokenOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.confidentialcomputing.v1.TokenOptions other) { + if (other == com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance()) + return this; + if (!other.getAudience().isEmpty()) { + audience_ = other.audience_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.nonce_.isEmpty()) { + if (nonce_.isEmpty()) { + nonce_ = other.nonce_; + bitField0_ |= 0x00000002; + } else { + ensureNonceIsMutable(); + nonce_.addAll(other.nonce_); + } + onChanged(); + } + 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: + { + audience_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureNonceIsMutable(); + nonce_.add(s); + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object audience_ = ""; + /** + * + * + *
+     * Optional. Optional string to issue the token with a custom audience claim.
+     * Required if one or more nonces are specified.
+     * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The audience. + */ + public java.lang.String getAudience() { + java.lang.Object ref = audience_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audience_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Optional string to issue the token with a custom audience claim.
+     * Required if one or more nonces are specified.
+     * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for audience. + */ + public com.google.protobuf.ByteString getAudienceBytes() { + java.lang.Object ref = audience_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audience_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Optional string to issue the token with a custom audience claim.
+     * Required if one or more nonces are specified.
+     * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The audience to set. + * @return This builder for chaining. + */ + public Builder setAudience(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + audience_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional string to issue the token with a custom audience claim.
+     * Required if one or more nonces are specified.
+     * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearAudience() { + audience_ = getDefaultInstance().getAudience(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional string to issue the token with a custom audience claim.
+     * Required if one or more nonces are specified.
+     * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for audience to set. + * @return This builder for chaining. + */ + public Builder setAudienceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + audience_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList nonce_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureNonceIsMutable() { + if (!nonce_.isModifiable()) { + nonce_ = new com.google.protobuf.LazyStringArrayList(nonce_); + } + bitField0_ |= 0x00000002; + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the nonce. + */ + public com.google.protobuf.ProtocolStringList getNonceList() { + nonce_.makeImmutable(); + return nonce_; + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of nonce. + */ + public int getNonceCount() { + return nonce_.size(); + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The nonce at the given index. + */ + public java.lang.String getNonce(int index) { + return nonce_.get(index); + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the nonce at the given index. + */ + public com.google.protobuf.ByteString getNonceBytes(int index) { + return nonce_.getByteString(index); + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index to set the value at. + * @param value The nonce to set. + * @return This builder for chaining. + */ + public Builder setNonce(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNonceIsMutable(); + nonce_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The nonce to add. + * @return This builder for chaining. + */ + public Builder addNonce(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNonceIsMutable(); + nonce_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param values The nonce to add. + * @return This builder for chaining. + */ + public Builder addAllNonce(java.lang.Iterable values) { + ensureNonceIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, nonce_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearNonce() { + nonce_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional parameter to place one or more nonces in the eat_nonce
+     * claim in the output token. The minimum size for JSON-encoded EATs is 10
+     * bytes and the maximum size is 74 bytes.
+     * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes of the nonce to add. + * @return This builder for chaining. + */ + public Builder addNonceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNonceIsMutable(); + nonce_.add(value); + bitField0_ |= 0x00000002; + 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:google.cloud.confidentialcomputing.v1.TokenOptions) + } + + // @@protoc_insertion_point(class_scope:google.cloud.confidentialcomputing.v1.TokenOptions) + private static final com.google.cloud.confidentialcomputing.v1.TokenOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.confidentialcomputing.v1.TokenOptions(); + } + + public static com.google.cloud.confidentialcomputing.v1.TokenOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TokenOptions 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 com.google.cloud.confidentialcomputing.v1.TokenOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java new file mode 100644 index 000000000000..f20c180eb0de --- /dev/null +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/TokenOptionsOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2023 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/cloud/confidentialcomputing/v1/service.proto + +package com.google.cloud.confidentialcomputing.v1; + +public interface TokenOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.confidentialcomputing.v1.TokenOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Optional string to issue the token with a custom audience claim.
+   * Required if one or more nonces are specified.
+   * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The audience. + */ + java.lang.String getAudience(); + /** + * + * + *
+   * Optional. Optional string to issue the token with a custom audience claim.
+   * Required if one or more nonces are specified.
+   * 
+ * + * string audience = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for audience. + */ + com.google.protobuf.ByteString getAudienceBytes(); + + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return A list containing the nonce. + */ + java.util.List getNonceList(); + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The count of nonce. + */ + int getNonceCount(); + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the element to return. + * @return The nonce at the given index. + */ + java.lang.String getNonce(int index); + /** + * + * + *
+   * Optional. Optional parameter to place one or more nonces in the eat_nonce
+   * claim in the output token. The minimum size for JSON-encoded EATs is 10
+   * bytes and the maximum size is 74 bytes.
+   * 
+ * + * repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param index The index of the value to return. + * @return The bytes of the nonce at the given index. + */ + com.google.protobuf.ByteString getNonceBytes(int index); +} diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequest.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequest.java index 6070a355447a..30b30360b48c 100644 --- a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequest.java +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequest.java @@ -242,6 +242,124 @@ public com.google.cloud.confidentialcomputing.v1.TpmAttestation getTpmAttestatio : tpmAttestation_; } + public static final int CONFIDENTIAL_SPACE_INFO_FIELD_NUMBER = 4; + private com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidentialSpaceInfo_; + /** + * + * + *
+   * Optional. Optional information related to the Confidential Space TEE.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the confidentialSpaceInfo field is set. + */ + @java.lang.Override + public boolean hasConfidentialSpaceInfo() { + return confidentialSpaceInfo_ != null; + } + /** + * + * + *
+   * Optional. Optional information related to the Confidential Space TEE.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The confidentialSpaceInfo. + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + getConfidentialSpaceInfo() { + return confidentialSpaceInfo_ == null + ? com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.getDefaultInstance() + : confidentialSpaceInfo_; + } + /** + * + * + *
+   * Optional. Optional information related to the Confidential Space TEE.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder + getConfidentialSpaceInfoOrBuilder() { + return confidentialSpaceInfo_ == null + ? com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.getDefaultInstance() + : confidentialSpaceInfo_; + } + + public static final int TOKEN_OPTIONS_FIELD_NUMBER = 5; + private com.google.cloud.confidentialcomputing.v1.TokenOptions tokenOptions_; + /** + * + * + *
+   * Optional. A collection of optional, workload-specified claims that modify
+   * the token output.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tokenOptions field is set. + */ + @java.lang.Override + public boolean hasTokenOptions() { + return tokenOptions_ != null; + } + /** + * + * + *
+   * Optional. A collection of optional, workload-specified claims that modify
+   * the token output.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tokenOptions. + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.TokenOptions getTokenOptions() { + return tokenOptions_ == null + ? com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance() + : tokenOptions_; + } + /** + * + * + *
+   * Optional. A collection of optional, workload-specified claims that modify
+   * the token output.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder + getTokenOptionsOrBuilder() { + return tokenOptions_ == null + ? com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance() + : tokenOptions_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -265,6 +383,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (tpmAttestation_ != null) { output.writeMessage(3, getTpmAttestation()); } + if (confidentialSpaceInfo_ != null) { + output.writeMessage(4, getConfidentialSpaceInfo()); + } + if (tokenOptions_ != null) { + output.writeMessage(5, getTokenOptions()); + } getUnknownFields().writeTo(output); } @@ -283,6 +407,13 @@ public int getSerializedSize() { if (tpmAttestation_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getTpmAttestation()); } + if (confidentialSpaceInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getConfidentialSpaceInfo()); + } + if (tokenOptions_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTokenOptions()); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -308,6 +439,14 @@ public boolean equals(final java.lang.Object obj) { if (hasTpmAttestation()) { if (!getTpmAttestation().equals(other.getTpmAttestation())) return false; } + if (hasConfidentialSpaceInfo() != other.hasConfidentialSpaceInfo()) return false; + if (hasConfidentialSpaceInfo()) { + if (!getConfidentialSpaceInfo().equals(other.getConfidentialSpaceInfo())) return false; + } + if (hasTokenOptions() != other.hasTokenOptions()) return false; + if (hasTokenOptions()) { + if (!getTokenOptions().equals(other.getTokenOptions())) return false; + } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -329,6 +468,14 @@ public int hashCode() { hash = (37 * hash) + TPM_ATTESTATION_FIELD_NUMBER; hash = (53 * hash) + getTpmAttestation().hashCode(); } + if (hasConfidentialSpaceInfo()) { + hash = (37 * hash) + CONFIDENTIAL_SPACE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getConfidentialSpaceInfo().hashCode(); + } + if (hasTokenOptions()) { + hash = (37 * hash) + TOKEN_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getTokenOptions().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -483,6 +630,16 @@ public Builder clear() { tpmAttestationBuilder_.dispose(); tpmAttestationBuilder_ = null; } + confidentialSpaceInfo_ = null; + if (confidentialSpaceInfoBuilder_ != null) { + confidentialSpaceInfoBuilder_.dispose(); + confidentialSpaceInfoBuilder_ = null; + } + tokenOptions_ = null; + if (tokenOptionsBuilder_ != null) { + tokenOptionsBuilder_.dispose(); + tokenOptionsBuilder_ = null; + } return this; } @@ -533,6 +690,16 @@ private void buildPartial0( result.tpmAttestation_ = tpmAttestationBuilder_ == null ? tpmAttestation_ : tpmAttestationBuilder_.build(); } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.confidentialSpaceInfo_ = + confidentialSpaceInfoBuilder_ == null + ? confidentialSpaceInfo_ + : confidentialSpaceInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.tokenOptions_ = + tokenOptionsBuilder_ == null ? tokenOptions_ : tokenOptionsBuilder_.build(); + } } @java.lang.Override @@ -595,6 +762,12 @@ public Builder mergeFrom( if (other.hasTpmAttestation()) { mergeTpmAttestation(other.getTpmAttestation()); } + if (other.hasConfidentialSpaceInfo()) { + mergeConfidentialSpaceInfo(other.getConfidentialSpaceInfo()); + } + if (other.hasTokenOptions()) { + mergeTokenOptions(other.getTokenOptions()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -639,6 +812,19 @@ public Builder mergeFrom( bitField0_ |= 0x00000004; break; } // case 26 + case 34: + { + input.readMessage( + getConfidentialSpaceInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage(getTokenOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1216,6 +1402,428 @@ public Builder clearTpmAttestation() { return tpmAttestationBuilder_; } + private com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidentialSpaceInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder> + confidentialSpaceInfoBuilder_; + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the confidentialSpaceInfo field is set. + */ + public boolean hasConfidentialSpaceInfo() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The confidentialSpaceInfo. + */ + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + getConfidentialSpaceInfo() { + if (confidentialSpaceInfoBuilder_ == null) { + return confidentialSpaceInfo_ == null + ? com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.getDefaultInstance() + : confidentialSpaceInfo_; + } else { + return confidentialSpaceInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConfidentialSpaceInfo( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo value) { + if (confidentialSpaceInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + confidentialSpaceInfo_ = value; + } else { + confidentialSpaceInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConfidentialSpaceInfo( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder builderForValue) { + if (confidentialSpaceInfoBuilder_ == null) { + confidentialSpaceInfo_ = builderForValue.build(); + } else { + confidentialSpaceInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeConfidentialSpaceInfo( + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo value) { + if (confidentialSpaceInfoBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && confidentialSpaceInfo_ != null + && confidentialSpaceInfo_ + != com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo + .getDefaultInstance()) { + getConfidentialSpaceInfoBuilder().mergeFrom(value); + } else { + confidentialSpaceInfo_ = value; + } + } else { + confidentialSpaceInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearConfidentialSpaceInfo() { + bitField0_ = (bitField0_ & ~0x00000008); + confidentialSpaceInfo_ = null; + if (confidentialSpaceInfoBuilder_ != null) { + confidentialSpaceInfoBuilder_.dispose(); + confidentialSpaceInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder + getConfidentialSpaceInfoBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getConfidentialSpaceInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder + getConfidentialSpaceInfoOrBuilder() { + if (confidentialSpaceInfoBuilder_ != null) { + return confidentialSpaceInfoBuilder_.getMessageOrBuilder(); + } else { + return confidentialSpaceInfo_ == null + ? com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.getDefaultInstance() + : confidentialSpaceInfo_; + } + } + /** + * + * + *
+     * Optional. Optional information related to the Confidential Space TEE.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder> + getConfidentialSpaceInfoFieldBuilder() { + if (confidentialSpaceInfoBuilder_ == null) { + confidentialSpaceInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo.Builder, + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder>( + getConfidentialSpaceInfo(), getParentForChildren(), isClean()); + confidentialSpaceInfo_ = null; + } + return confidentialSpaceInfoBuilder_; + } + + private com.google.cloud.confidentialcomputing.v1.TokenOptions tokenOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.TokenOptions, + com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder, + com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder> + tokenOptionsBuilder_; + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tokenOptions field is set. + */ + public boolean hasTokenOptions() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tokenOptions. + */ + public com.google.cloud.confidentialcomputing.v1.TokenOptions getTokenOptions() { + if (tokenOptionsBuilder_ == null) { + return tokenOptions_ == null + ? com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance() + : tokenOptions_; + } else { + return tokenOptionsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTokenOptions(com.google.cloud.confidentialcomputing.v1.TokenOptions value) { + if (tokenOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tokenOptions_ = value; + } else { + tokenOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTokenOptions( + com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder builderForValue) { + if (tokenOptionsBuilder_ == null) { + tokenOptions_ = builderForValue.build(); + } else { + tokenOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTokenOptions(com.google.cloud.confidentialcomputing.v1.TokenOptions value) { + if (tokenOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && tokenOptions_ != null + && tokenOptions_ + != com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance()) { + getTokenOptionsBuilder().mergeFrom(value); + } else { + tokenOptions_ = value; + } + } else { + tokenOptionsBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTokenOptions() { + bitField0_ = (bitField0_ & ~0x00000010); + tokenOptions_ = null; + if (tokenOptionsBuilder_ != null) { + tokenOptionsBuilder_.dispose(); + tokenOptionsBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder getTokenOptionsBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getTokenOptionsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder + getTokenOptionsOrBuilder() { + if (tokenOptionsBuilder_ != null) { + return tokenOptionsBuilder_.getMessageOrBuilder(); + } else { + return tokenOptions_ == null + ? com.google.cloud.confidentialcomputing.v1.TokenOptions.getDefaultInstance() + : tokenOptions_; + } + } + /** + * + * + *
+     * Optional. A collection of optional, workload-specified claims that modify
+     * the token output.
+     * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.TokenOptions, + com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder, + com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder> + getTokenOptionsFieldBuilder() { + if (tokenOptionsBuilder_ == null) { + tokenOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.confidentialcomputing.v1.TokenOptions, + com.google.cloud.confidentialcomputing.v1.TokenOptions.Builder, + com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder>( + getTokenOptions(), getParentForChildren(), isClean()); + tokenOptions_ = null; + } + return tokenOptionsBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequestOrBuilder.java b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequestOrBuilder.java index 2a54a16c5dc3..d82b4e9fbe35 100644 --- a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequestOrBuilder.java +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/java/com/google/cloud/confidentialcomputing/v1/VerifyAttestationRequestOrBuilder.java @@ -143,4 +143,90 @@ public interface VerifyAttestationRequestOrBuilder * */ com.google.cloud.confidentialcomputing.v1.TpmAttestationOrBuilder getTpmAttestationOrBuilder(); + + /** + * + * + *
+   * Optional. Optional information related to the Confidential Space TEE.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the confidentialSpaceInfo field is set. + */ + boolean hasConfidentialSpaceInfo(); + /** + * + * + *
+   * Optional. Optional information related to the Confidential Space TEE.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The confidentialSpaceInfo. + */ + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo getConfidentialSpaceInfo(); + /** + * + * + *
+   * Optional. Optional information related to the Confidential Space TEE.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo confidential_space_info = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfoOrBuilder + getConfidentialSpaceInfoOrBuilder(); + + /** + * + * + *
+   * Optional. A collection of optional, workload-specified claims that modify
+   * the token output.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the tokenOptions field is set. + */ + boolean hasTokenOptions(); + /** + * + * + *
+   * Optional. A collection of optional, workload-specified claims that modify
+   * the token output.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The tokenOptions. + */ + com.google.cloud.confidentialcomputing.v1.TokenOptions getTokenOptions(); + /** + * + * + *
+   * Optional. A collection of optional, workload-specified claims that modify
+   * the token output.
+   * 
+ * + * + * .google.cloud.confidentialcomputing.v1.TokenOptions token_options = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.confidentialcomputing.v1.TokenOptionsOrBuilder getTokenOptionsOrBuilder(); } diff --git a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/proto/google/cloud/confidentialcomputing/v1/service.proto b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/proto/google/cloud/confidentialcomputing/v1/service.proto index 846b4de0470a..4a97c94e0bad 100644 --- a/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/proto/google/cloud/confidentialcomputing/v1/service.proto +++ b/java-confidentialcomputing/proto-google-cloud-confidentialcomputing-v1/src/main/proto/google/cloud/confidentialcomputing/v1/service.proto @@ -55,6 +55,21 @@ service ConfidentialComputing { } } +// SigningAlgorithm enumerates all the supported signing algorithms. +enum SigningAlgorithm { + // Unspecified signing algorithm. + SIGNING_ALGORITHM_UNSPECIFIED = 0; + + // RSASSA-PSS with a SHA256 digest. + RSASSA_PSS_SHA256 = 1; + + // RSASSA-PKCS1 v1.5 with a SHA256 digest. + RSASSA_PKCS1V15_SHA256 = 2; + + // ECDSA on the P-256 Curve with a SHA256 digest. + ECDSA_P256_SHA256 = 3; +} + // A Challenge from the server used to guarantee freshness of attestations message Challenge { option (google.api.resource) = { @@ -118,6 +133,14 @@ message VerifyAttestationRequest { // Required. The TPM-specific data provided by the attesting platform, used to // populate any of the claims regarding platform state. TpmAttestation tpm_attestation = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Optional information related to the Confidential Space TEE. + ConfidentialSpaceInfo confidential_space_info = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A collection of optional, workload-specified claims that modify + // the token output. + TokenOptions token_options = 5 [(google.api.field_behavior) = OPTIONAL]; } // A response once an attestation has been successfully verified, containing a @@ -134,6 +157,18 @@ message GcpCredentials { repeated string service_account_id_tokens = 2; } +// Options to modify claims in the token to generate custom-purpose tokens. +message TokenOptions { + // Optional. Optional string to issue the token with a custom audience claim. + // Required if one or more nonces are specified. + string audience = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional parameter to place one or more nonces in the eat_nonce + // claim in the output token. The minimum size for JSON-encoded EATs is 10 + // bytes and the maximum size is 74 bytes. + repeated string nonce = 2 [(google.api.field_behavior) = OPTIONAL]; +} + // TPM2 data containing everything necessary to validate any platform state // measured into the TPM. message TpmAttestation { @@ -174,3 +209,45 @@ message TpmAttestation { // chain back to a trusted Root Certificate. repeated bytes cert_chain = 5; } + +// ConfidentialSpaceInfo contains information related to the Confidential Space +// TEE. +message ConfidentialSpaceInfo { + // Optional. A list of signed entities containing container image signatures + // that can be used for server-side signature verification. + repeated SignedEntity signed_entities = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// SignedEntity represents an OCI image object containing everything necessary +// to verify container image signatures. +message SignedEntity { + // Optional. A list of container image signatures attached to an OCI image + // object. + repeated ContainerImageSignature container_image_signatures = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// ContainerImageSignature holds necessary metadata to verify a container image +// signature. +message ContainerImageSignature { + // Required. The binary signature payload following the SimpleSigning format + // https://github.com/sigstore/cosign/blob/main/specs/SIGNATURE_SPEC.md#simple-signing. + // This payload includes the container image digest. + bytes payload = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A signature over the payload. + // The container image digest is incorporated into the signature as follows: + // 1. Generate a SimpleSigning format payload that includes the container + // image digest. + // 2. Generate a signature over SHA256 digest of the payload. + // The signature generation process can be represented as follows: + // `Sign(sha256(SimpleSigningPayload(sha256(Image Manifest))))` + bytes signature = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. An associated public key used to verify the signature. + bytes public_key = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The algorithm used to produce the container image signature. + SigningAlgorithm sig_alg = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/AsyncVerifyAttestation.java b/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/AsyncVerifyAttestation.java index 7c6d9ad91f39..a5ae44040588 100644 --- a/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/AsyncVerifyAttestation.java +++ b/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/AsyncVerifyAttestation.java @@ -20,7 +20,9 @@ import com.google.api.core.ApiFuture; import com.google.cloud.confidentialcomputing.v1.ChallengeName; import com.google.cloud.confidentialcomputing.v1.ConfidentialComputingClient; +import com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo; import com.google.cloud.confidentialcomputing.v1.GcpCredentials; +import com.google.cloud.confidentialcomputing.v1.TokenOptions; import com.google.cloud.confidentialcomputing.v1.TpmAttestation; import com.google.cloud.confidentialcomputing.v1.VerifyAttestationRequest; import com.google.cloud.confidentialcomputing.v1.VerifyAttestationResponse; @@ -44,6 +46,8 @@ public static void asyncVerifyAttestation() throws Exception { .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) .setGcpCredentials(GcpCredentials.newBuilder().build()) .setTpmAttestation(TpmAttestation.newBuilder().build()) + .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + .setTokenOptions(TokenOptions.newBuilder().build()) .build(); ApiFuture future = confidentialComputingClient.verifyAttestationCallable().futureCall(request); diff --git a/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/SyncVerifyAttestation.java b/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/SyncVerifyAttestation.java index fbbec0273406..526dca5fb066 100644 --- a/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/SyncVerifyAttestation.java +++ b/java-confidentialcomputing/samples/snippets/generated/com/google/cloud/confidentialcomputing/v1/confidentialcomputing/verifyattestation/SyncVerifyAttestation.java @@ -19,7 +19,9 @@ // [START confidentialcomputing_v1_generated_ConfidentialComputing_VerifyAttestation_sync] import com.google.cloud.confidentialcomputing.v1.ChallengeName; import com.google.cloud.confidentialcomputing.v1.ConfidentialComputingClient; +import com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo; import com.google.cloud.confidentialcomputing.v1.GcpCredentials; +import com.google.cloud.confidentialcomputing.v1.TokenOptions; import com.google.cloud.confidentialcomputing.v1.TpmAttestation; import com.google.cloud.confidentialcomputing.v1.VerifyAttestationRequest; import com.google.cloud.confidentialcomputing.v1.VerifyAttestationResponse; @@ -43,6 +45,8 @@ public static void syncVerifyAttestation() throws Exception { .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString()) .setGcpCredentials(GcpCredentials.newBuilder().build()) .setTpmAttestation(TpmAttestation.newBuilder().build()) + .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build()) + .setTokenOptions(TokenOptions.newBuilder().build()) .build(); VerifyAttestationResponse response = confidentialComputingClient.verifyAttestation(request); }