diff --git a/google-api-grpc/grpc-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceGrpc.java b/google-api-grpc/grpc-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceGrpc.java index 6b603439de11..73b36efa26cd 100644 --- a/google-api-grpc/grpc-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceGrpc.java +++ b/google-api-grpc/grpc-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceGrpc.java @@ -23,6 +23,8 @@ * * [KeyRing][google.cloud.kms.v1.KeyRing] * * [CryptoKey][google.cloud.kms.v1.CryptoKey] * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * If you are using manual gRPC libraries, see + * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). * */ @javax.annotation.Generated( @@ -258,6 +260,43 @@ com.google.cloud.kms.v1.CryptoKeyVersion> getGetCryptoKeyVersionMethodHelper() { return getGetCryptoKeyVersionMethod; } @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetPublicKeyMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_PUBLIC_KEY = getGetPublicKeyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetPublicKeyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetPublicKeyMethod() { + return getGetPublicKeyMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetPublicKeyMethodHelper() { + io.grpc.MethodDescriptor getGetPublicKeyMethod; + if ((getGetPublicKeyMethod = KeyManagementServiceGrpc.getGetPublicKeyMethod) == null) { + synchronized (KeyManagementServiceGrpc.class) { + if ((getGetPublicKeyMethod = KeyManagementServiceGrpc.getGetPublicKeyMethod) == null) { + KeyManagementServiceGrpc.getGetPublicKeyMethod = getGetPublicKeyMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.kms.v1.KeyManagementService", "GetPublicKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.kms.v1.GetPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.kms.v1.PublicKey.getDefaultInstance())) + .setSchemaDescriptor(new KeyManagementServiceMethodDescriptorSupplier("GetPublicKey")) + .build(); + } + } + } + return getGetPublicKeyMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getCreateKeyRingMethod()} instead. public static final io.grpc.MethodDescriptor METHOD_CREATE_KEY_RING = getCreateKeyRingMethodHelper(); @@ -517,6 +556,80 @@ com.google.cloud.kms.v1.DecryptResponse> getDecryptMethodHelper() { return getDecryptMethod; } @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAsymmetricSignMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_ASYMMETRIC_SIGN = getAsymmetricSignMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getAsymmetricSignMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getAsymmetricSignMethod() { + return getAsymmetricSignMethodHelper(); + } + + private static io.grpc.MethodDescriptor getAsymmetricSignMethodHelper() { + io.grpc.MethodDescriptor getAsymmetricSignMethod; + if ((getAsymmetricSignMethod = KeyManagementServiceGrpc.getAsymmetricSignMethod) == null) { + synchronized (KeyManagementServiceGrpc.class) { + if ((getAsymmetricSignMethod = KeyManagementServiceGrpc.getAsymmetricSignMethod) == null) { + KeyManagementServiceGrpc.getAsymmetricSignMethod = getAsymmetricSignMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.kms.v1.KeyManagementService", "AsymmetricSign")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.kms.v1.AsymmetricSignRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.kms.v1.AsymmetricSignResponse.getDefaultInstance())) + .setSchemaDescriptor(new KeyManagementServiceMethodDescriptorSupplier("AsymmetricSign")) + .build(); + } + } + } + return getAsymmetricSignMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAsymmetricDecryptMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_ASYMMETRIC_DECRYPT = getAsymmetricDecryptMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getAsymmetricDecryptMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getAsymmetricDecryptMethod() { + return getAsymmetricDecryptMethodHelper(); + } + + private static io.grpc.MethodDescriptor getAsymmetricDecryptMethodHelper() { + io.grpc.MethodDescriptor getAsymmetricDecryptMethod; + if ((getAsymmetricDecryptMethod = KeyManagementServiceGrpc.getAsymmetricDecryptMethod) == null) { + synchronized (KeyManagementServiceGrpc.class) { + if ((getAsymmetricDecryptMethod = KeyManagementServiceGrpc.getAsymmetricDecryptMethod) == null) { + KeyManagementServiceGrpc.getAsymmetricDecryptMethod = getAsymmetricDecryptMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.kms.v1.KeyManagementService", "AsymmetricDecrypt")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.kms.v1.AsymmetricDecryptRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.kms.v1.AsymmetricDecryptResponse.getDefaultInstance())) + .setSchemaDescriptor(new KeyManagementServiceMethodDescriptorSupplier("AsymmetricDecrypt")) + .build(); + } + } + } + return getAsymmetricDecryptMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") @java.lang.Deprecated // Use {@link #getUpdateCryptoKeyPrimaryVersionMethod()} instead. public static final io.grpc.MethodDescriptor METHOD_UPDATE_CRYPTO_KEY_PRIMARY_VERSION = getUpdateCryptoKeyPrimaryVersionMethodHelper(); @@ -659,6 +772,8 @@ public static KeyManagementServiceFutureStub newFutureStub( * * [KeyRing][google.cloud.kms.v1.KeyRing] * * [CryptoKey][google.cloud.kms.v1.CryptoKey] * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + * If you are using manual gRPC libraries, see + * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). * */ public static abstract class KeyManagementServiceImplBase implements io.grpc.BindableService { @@ -724,6 +839,19 @@ public void getCryptoKeyVersion(com.google.cloud.kms.v1.GetCryptoKeyVersionReque asyncUnimplementedUnaryCall(getGetCryptoKeyVersionMethodHelper(), responseObserver); } + /** + *
+     * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+     * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
+     * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
+     * 
+ */ + public void getPublicKey(com.google.cloud.kms.v1.GetPublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetPublicKeyMethodHelper(), responseObserver); + } + /** *
      * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
@@ -737,7 +865,9 @@ public void createKeyRing(com.google.cloud.kms.v1.CreateKeyRingRequest request,
     /**
      * 
      * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
-     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required.
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
+     * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]
+     * are required.
      * 
*/ public void createCryptoKey(com.google.cloud.kms.v1.CreateCryptoKeyRequest request, @@ -786,6 +916,8 @@ public void updateCryptoKeyVersion(com.google.cloud.kms.v1.UpdateCryptoKeyVersio /** *
      * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt].
+     * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
      * 
*/ public void encrypt(com.google.cloud.kms.v1.EncryptRequest request, @@ -795,7 +927,8 @@ public void encrypt(com.google.cloud.kms.v1.EncryptRequest request, /** *
-     * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+     * must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
      * 
*/ public void decrypt(com.google.cloud.kms.v1.DecryptRequest request, @@ -805,7 +938,32 @@ public void decrypt(com.google.cloud.kms.v1.DecryptRequest request, /** *
-     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]
+     * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+     * ASYMMETRIC_SIGN, producing a signature that can be verified with the public
+     * key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ */ + public void asymmetricSign(com.google.cloud.kms.v1.AsymmetricSignRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getAsymmetricSignMethodHelper(), responseObserver); + } + + /** + *
+     * Decrypts data that was encrypted with a public key retrieved from
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
+     * 
+ */ + public void asymmetricDecrypt(com.google.cloud.kms.v1.AsymmetricDecryptRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getAsymmetricDecryptMethodHelper(), responseObserver); + } + + /** + *
+     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Returns an error if called on an asymmetric key.
      * 
*/ public void updateCryptoKeyPrimaryVersion(com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest request, @@ -835,7 +993,7 @@ public void destroyCryptoKeyVersion(com.google.cloud.kms.v1.DestroyCryptoKeyVers /** *
      * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the
-     * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED],
+     * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]
      * state.
      * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state]
      * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED],
@@ -891,6 +1049,13 @@ public void restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVers
                 com.google.cloud.kms.v1.GetCryptoKeyVersionRequest,
                 com.google.cloud.kms.v1.CryptoKeyVersion>(
                   this, METHODID_GET_CRYPTO_KEY_VERSION)))
+          .addMethod(
+            getGetPublicKeyMethodHelper(),
+            asyncUnaryCall(
+              new MethodHandlers<
+                com.google.cloud.kms.v1.GetPublicKeyRequest,
+                com.google.cloud.kms.v1.PublicKey>(
+                  this, METHODID_GET_PUBLIC_KEY)))
           .addMethod(
             getCreateKeyRingMethodHelper(),
             asyncUnaryCall(
@@ -940,6 +1105,20 @@ public void restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVers
                 com.google.cloud.kms.v1.DecryptRequest,
                 com.google.cloud.kms.v1.DecryptResponse>(
                   this, METHODID_DECRYPT)))
+          .addMethod(
+            getAsymmetricSignMethodHelper(),
+            asyncUnaryCall(
+              new MethodHandlers<
+                com.google.cloud.kms.v1.AsymmetricSignRequest,
+                com.google.cloud.kms.v1.AsymmetricSignResponse>(
+                  this, METHODID_ASYMMETRIC_SIGN)))
+          .addMethod(
+            getAsymmetricDecryptMethodHelper(),
+            asyncUnaryCall(
+              new MethodHandlers<
+                com.google.cloud.kms.v1.AsymmetricDecryptRequest,
+                com.google.cloud.kms.v1.AsymmetricDecryptResponse>(
+                  this, METHODID_ASYMMETRIC_DECRYPT)))
           .addMethod(
             getUpdateCryptoKeyPrimaryVersionMethodHelper(),
             asyncUnaryCall(
@@ -973,6 +1152,8 @@ public void restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVers
    * * [KeyRing][google.cloud.kms.v1.KeyRing]
    * * [CryptoKey][google.cloud.kms.v1.CryptoKey]
    * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
+   * If you are using manual gRPC libraries, see
+   * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc).
    * 
*/ public static final class KeyManagementServiceStub extends io.grpc.stub.AbstractStub { @@ -1058,6 +1239,20 @@ public void getCryptoKeyVersion(com.google.cloud.kms.v1.GetCryptoKeyVersionReque getChannel().newCall(getGetCryptoKeyVersionMethodHelper(), getCallOptions()), request, responseObserver); } + /** + *
+     * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+     * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
+     * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
+     * 
+ */ + public void getPublicKey(com.google.cloud.kms.v1.GetPublicKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetPublicKeyMethodHelper(), getCallOptions()), request, responseObserver); + } + /** *
      * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
@@ -1072,7 +1267,9 @@ public void createKeyRing(com.google.cloud.kms.v1.CreateKeyRingRequest request,
     /**
      * 
      * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
-     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required.
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
+     * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]
+     * are required.
      * 
*/ public void createCryptoKey(com.google.cloud.kms.v1.CreateCryptoKeyRequest request, @@ -1125,6 +1322,8 @@ public void updateCryptoKeyVersion(com.google.cloud.kms.v1.UpdateCryptoKeyVersio /** *
      * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt].
+     * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
      * 
*/ public void encrypt(com.google.cloud.kms.v1.EncryptRequest request, @@ -1135,7 +1334,8 @@ public void encrypt(com.google.cloud.kms.v1.EncryptRequest request, /** *
-     * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+     * must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
      * 
*/ public void decrypt(com.google.cloud.kms.v1.DecryptRequest request, @@ -1146,7 +1346,34 @@ public void decrypt(com.google.cloud.kms.v1.DecryptRequest request, /** *
-     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]
+     * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+     * ASYMMETRIC_SIGN, producing a signature that can be verified with the public
+     * key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ */ + public void asymmetricSign(com.google.cloud.kms.v1.AsymmetricSignRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAsymmetricSignMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Decrypts data that was encrypted with a public key retrieved from
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
+     * 
+ */ + public void asymmetricDecrypt(com.google.cloud.kms.v1.AsymmetricDecryptRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAsymmetricDecryptMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Returns an error if called on an asymmetric key.
      * 
*/ public void updateCryptoKeyPrimaryVersion(com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest request, @@ -1178,7 +1405,7 @@ public void destroyCryptoKeyVersion(com.google.cloud.kms.v1.DestroyCryptoKeyVers /** *
      * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the
-     * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED],
+     * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]
      * state.
      * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state]
      * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED],
@@ -1200,6 +1427,8 @@ public void restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVers
    * * [KeyRing][google.cloud.kms.v1.KeyRing]
    * * [CryptoKey][google.cloud.kms.v1.CryptoKey]
    * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
+   * If you are using manual gRPC libraries, see
+   * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc).
    * 
*/ public static final class KeyManagementServiceBlockingStub extends io.grpc.stub.AbstractStub { @@ -1279,6 +1508,19 @@ public com.google.cloud.kms.v1.CryptoKeyVersion getCryptoKeyVersion(com.google.c getChannel(), getGetCryptoKeyVersionMethodHelper(), getCallOptions(), request); } + /** + *
+     * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+     * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
+     * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
+     * 
+ */ + public com.google.cloud.kms.v1.PublicKey getPublicKey(com.google.cloud.kms.v1.GetPublicKeyRequest request) { + return blockingUnaryCall( + getChannel(), getGetPublicKeyMethodHelper(), getCallOptions(), request); + } + /** *
      * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
@@ -1292,7 +1534,9 @@ public com.google.cloud.kms.v1.KeyRing createKeyRing(com.google.cloud.kms.v1.Cre
     /**
      * 
      * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
-     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required.
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
+     * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]
+     * are required.
      * 
*/ public com.google.cloud.kms.v1.CryptoKey createCryptoKey(com.google.cloud.kms.v1.CreateCryptoKeyRequest request) { @@ -1341,6 +1585,8 @@ public com.google.cloud.kms.v1.CryptoKeyVersion updateCryptoKeyVersion(com.googl /** *
      * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt].
+     * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
      * 
*/ public com.google.cloud.kms.v1.EncryptResponse encrypt(com.google.cloud.kms.v1.EncryptRequest request) { @@ -1350,7 +1596,8 @@ public com.google.cloud.kms.v1.EncryptResponse encrypt(com.google.cloud.kms.v1.E /** *
-     * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+     * must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
      * 
*/ public com.google.cloud.kms.v1.DecryptResponse decrypt(com.google.cloud.kms.v1.DecryptRequest request) { @@ -1360,7 +1607,32 @@ public com.google.cloud.kms.v1.DecryptResponse decrypt(com.google.cloud.kms.v1.D /** *
-     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]
+     * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+     * ASYMMETRIC_SIGN, producing a signature that can be verified with the public
+     * key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ */ + public com.google.cloud.kms.v1.AsymmetricSignResponse asymmetricSign(com.google.cloud.kms.v1.AsymmetricSignRequest request) { + return blockingUnaryCall( + getChannel(), getAsymmetricSignMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Decrypts data that was encrypted with a public key retrieved from
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
+     * 
+ */ + public com.google.cloud.kms.v1.AsymmetricDecryptResponse asymmetricDecrypt(com.google.cloud.kms.v1.AsymmetricDecryptRequest request) { + return blockingUnaryCall( + getChannel(), getAsymmetricDecryptMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Returns an error if called on an asymmetric key.
      * 
*/ public com.google.cloud.kms.v1.CryptoKey updateCryptoKeyPrimaryVersion(com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest request) { @@ -1390,7 +1662,7 @@ public com.google.cloud.kms.v1.CryptoKeyVersion destroyCryptoKeyVersion(com.goog /** *
      * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the
-     * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED],
+     * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]
      * state.
      * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state]
      * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED],
@@ -1411,6 +1683,8 @@ public com.google.cloud.kms.v1.CryptoKeyVersion restoreCryptoKeyVersion(com.goog
    * * [KeyRing][google.cloud.kms.v1.KeyRing]
    * * [CryptoKey][google.cloud.kms.v1.CryptoKey]
    * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
+   * If you are using manual gRPC libraries, see
+   * [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc).
    * 
*/ public static final class KeyManagementServiceFutureStub extends io.grpc.stub.AbstractStub { @@ -1496,6 +1770,20 @@ public com.google.common.util.concurrent.ListenableFuture + * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + *
+ */ + public com.google.common.util.concurrent.ListenableFuture getPublicKey( + com.google.cloud.kms.v1.GetPublicKeyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetPublicKeyMethodHelper(), getCallOptions()), request); + } + /** *
      * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
@@ -1510,7 +1798,9 @@ public com.google.common.util.concurrent.ListenableFuture
      * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
-     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required.
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
+     * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]
+     * are required.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture createCryptoKey( @@ -1563,6 +1853,8 @@ public com.google.common.util.concurrent.ListenableFuture * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. *
*/ public com.google.common.util.concurrent.ListenableFuture encrypt( @@ -1573,7 +1865,8 @@ public com.google.common.util.concurrent.ListenableFuture - * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. *
*/ public com.google.common.util.concurrent.ListenableFuture decrypt( @@ -1584,7 +1877,34 @@ public com.google.common.util.concurrent.ListenableFuture - * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + * ASYMMETRIC_SIGN, producing a signature that can be verified with the public + * key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + */ + public com.google.common.util.concurrent.ListenableFuture asymmetricSign( + com.google.cloud.kms.v1.AsymmetricSignRequest request) { + return futureUnaryCall( + getChannel().newCall(getAsymmetricSignMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Decrypts data that was encrypted with a public key retrieved from
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
+     * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture asymmetricDecrypt( + com.google.cloud.kms.v1.AsymmetricDecryptRequest request) { + return futureUnaryCall( + getChannel().newCall(getAsymmetricDecryptMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
+     * Returns an error if called on an asymmetric key.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture updateCryptoKeyPrimaryVersion( @@ -1616,7 +1936,7 @@ public com.google.common.util.concurrent.ListenableFuture * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] * state. * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], @@ -1636,16 +1956,19 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1688,6 +2011,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getCryptoKeyVersion((com.google.cloud.kms.v1.GetCryptoKeyVersionRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_PUBLIC_KEY: + serviceImpl.getPublicKey((com.google.cloud.kms.v1.GetPublicKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_CREATE_KEY_RING: serviceImpl.createKeyRing((com.google.cloud.kms.v1.CreateKeyRingRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -1716,6 +2043,14 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.decrypt((com.google.cloud.kms.v1.DecryptRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_ASYMMETRIC_SIGN: + serviceImpl.asymmetricSign((com.google.cloud.kms.v1.AsymmetricSignRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ASYMMETRIC_DECRYPT: + serviceImpl.asymmetricDecrypt((com.google.cloud.kms.v1.AsymmetricDecryptRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_UPDATE_CRYPTO_KEY_PRIMARY_VERSION: serviceImpl.updateCryptoKeyPrimaryVersion((com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -1795,6 +2130,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetKeyRingMethodHelper()) .addMethod(getGetCryptoKeyMethodHelper()) .addMethod(getGetCryptoKeyVersionMethodHelper()) + .addMethod(getGetPublicKeyMethodHelper()) .addMethod(getCreateKeyRingMethodHelper()) .addMethod(getCreateCryptoKeyMethodHelper()) .addMethod(getCreateCryptoKeyVersionMethodHelper()) @@ -1802,6 +2138,8 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateCryptoKeyVersionMethodHelper()) .addMethod(getEncryptMethodHelper()) .addMethod(getDecryptMethodHelper()) + .addMethod(getAsymmetricSignMethodHelper()) + .addMethod(getAsymmetricDecryptMethodHelper()) .addMethod(getUpdateCryptoKeyPrimaryVersionMethodHelper()) .addMethod(getDestroyCryptoKeyVersionMethodHelper()) .addMethod(getRestoreCryptoKeyVersionMethodHelper()) diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java index 9927bf2348cc..96714cd1e1cb 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminProto.java @@ -197,98 +197,99 @@ public static void registerAllExtensions( "\t\022\026\n\016app_profile_id\030\002 \001(\t\0229\n\013app_profile" + "\030\003 \001(\0132$.google.bigtable.admin.v2.AppPro" + "file\022\027\n\017ignore_warnings\030\004 \001(\010\"$\n\024GetAppP" + - "rofileRequest\022\014\n\004name\030\001 \001(\t\"<\n\026ListAppPr" + - "ofilesRequest\022\016\n\006parent\030\001 \001(\t\022\022\n\npage_to" + - "ken\030\002 \001(\t\"n\n\027ListAppProfilesResponse\022:\n\014" + - "app_profiles\030\001 \003(\0132$.google.bigtable.adm" + - "in.v2.AppProfile\022\027\n\017next_page_token\030\002 \001(" + - "\t\"\236\001\n\027UpdateAppProfileRequest\0229\n\013app_pro" + - "file\030\001 \001(\0132$.google.bigtable.admin.v2.Ap" + - "pProfile\022/\n\013update_mask\030\002 \001(\0132\032.google.p" + - "rotobuf.FieldMask\022\027\n\017ignore_warnings\030\003 \001" + - "(\010\"@\n\027DeleteAppProfileRequest\022\014\n\004name\030\001 " + - "\001(\t\022\027\n\017ignore_warnings\030\002 \001(\010\"\032\n\030UpdateAp" + - "pProfileMetadata2\252\027\n\025BigtableInstanceAdm" + - "in\022\216\001\n\016CreateInstance\022/.google.bigtable." + - "admin.v2.CreateInstanceRequest\032\035.google." + - "longrunning.Operation\",\202\323\344\223\002&\"!/v2/{pare" + - "nt=projects/*}/instances:\001*\022\212\001\n\013GetInsta" + - "nce\022,.google.bigtable.admin.v2.GetInstan" + - "ceRequest\032\".google.bigtable.admin.v2.Ins" + - "tance\")\202\323\344\223\002#\022!/v2/{name=projects/*/inst" + - "ances/*}\022\233\001\n\rListInstances\022..google.bigt" + - "able.admin.v2.ListInstancesRequest\032/.goo" + - "gle.bigtable.admin.v2.ListInstancesRespo" + - "nse\")\202\323\344\223\002#\022!/v2/{parent=projects/*}/ins" + - "tances\022\206\001\n\016UpdateInstance\022\".google.bigta" + - "ble.admin.v2.Instance\032\".google.bigtable." + - "admin.v2.Instance\",\202\323\344\223\002&\032!/v2/{name=pro" + - "jects/*/instances/*}:\001*\022\254\001\n\025PartialUpdat" + - "eInstance\0226.google.bigtable.admin.v2.Par" + - "tialUpdateInstanceRequest\032\035.google.longr" + - "unning.Operation\"<\202\323\344\223\00262*/v2/{instance." + - "name=projects/*/instances/*}:\010instance\022\204" + - "\001\n\016DeleteInstance\022/.google.bigtable.admi" + - "n.v2.DeleteInstanceRequest\032\026.google.prot" + - "obuf.Empty\")\202\323\344\223\002#*!/v2/{name=projects/*" + - "/instances/*}\022\235\001\n\rCreateCluster\022..google" + - ".bigtable.admin.v2.CreateClusterRequest\032" + - "\035.google.longrunning.Operation\"=\202\323\344\223\0027\"," + - "/v2/{parent=projects/*/instances/*}/clus" + - "ters:\007cluster\022\222\001\n\nGetCluster\022+.google.bi" + - "gtable.admin.v2.GetClusterRequest\032!.goog" + - "le.bigtable.admin.v2.Cluster\"4\202\323\344\223\002.\022,/v" + - "2/{name=projects/*/instances/*/clusters/" + - "*}\022\243\001\n\014ListClusters\022-.google.bigtable.ad" + - "min.v2.ListClustersRequest\032..google.bigt" + - "able.admin.v2.ListClustersResponse\"4\202\323\344\223" + - "\002.\022,/v2/{parent=projects/*/instances/*}/" + - "clusters\022\212\001\n\rUpdateCluster\022!.google.bigt" + - "able.admin.v2.Cluster\032\035.google.longrunni" + - "ng.Operation\"7\202\323\344\223\0021\032,/v2/{name=projects" + - "/*/instances/*/clusters/*}:\001*\022\215\001\n\rDelete" + - "Cluster\022..google.bigtable.admin.v2.Delet" + - "eClusterRequest\032\026.google.protobuf.Empty\"" + - "4\202\323\344\223\002.*,/v2/{name=projects/*/instances/" + - "*/clusters/*}\022\261\001\n\020CreateAppProfile\0221.goo" + - "gle.bigtable.admin.v2.CreateAppProfileRe" + - "quest\032$.google.bigtable.admin.v2.AppProf" + - "ile\"D\202\323\344\223\002>\"//v2/{parent=projects/*/inst" + - "ances/*}/appProfiles:\013app_profile\022\236\001\n\rGe" + - "tAppProfile\022..google.bigtable.admin.v2.G" + - "etAppProfileRequest\032$.google.bigtable.ad" + - "min.v2.AppProfile\"7\202\323\344\223\0021\022//v2/{name=pro" + - "jects/*/instances/*/appProfiles/*}\022\257\001\n\017L" + - "istAppProfiles\0220.google.bigtable.admin.v" + - "2.ListAppProfilesRequest\0321.google.bigtab" + - "le.admin.v2.ListAppProfilesResponse\"7\202\323\344" + - "\223\0021\022//v2/{parent=projects/*/instances/*}" + - "/appProfiles\022\266\001\n\020UpdateAppProfile\0221.goog" + - "le.bigtable.admin.v2.UpdateAppProfileReq" + - "uest\032\035.google.longrunning.Operation\"P\202\323\344" + - "\223\002J2;/v2/{app_profile.name=projects/*/in" + - "stances/*/appProfiles/*}:\013app_profile\022\226\001" + - "\n\020DeleteAppProfile\0221.google.bigtable.adm" + - "in.v2.DeleteAppProfileRequest\032\026.google.p" + - "rotobuf.Empty\"7\202\323\344\223\0021*//v2/{name=project" + - "s/*/instances/*/appProfiles/*}\022\210\001\n\014GetIa" + - "mPolicy\022\".google.iam.v1.GetIamPolicyRequ" + - "est\032\025.google.iam.v1.Policy\"=\202\323\344\223\0027\"2/v2/" + - "{resource=projects/*/instances/*}:getIam" + - "Policy:\001*\022\210\001\n\014SetIamPolicy\022\".google.iam." + - "v1.SetIamPolicyRequest\032\025.google.iam.v1.P" + - "olicy\"=\202\323\344\223\0027\"2/v2/{resource=projects/*/" + - "instances/*}:setIamPolicy:\001*\022\256\001\n\022TestIam" + - "Permissions\022(.google.iam.v1.TestIamPermi" + - "ssionsRequest\032).google.iam.v1.TestIamPer" + - "missionsResponse\"C\202\323\344\223\002=\"8/v2/{resource=" + - "projects/*/instances/*}:testIamPermissio" + - "ns:\001*B\275\001\n\034com.google.bigtable.admin.v2B\032" + - "BigtableInstanceAdminProtoP\001Z=google.gol" + - "ang.org/genproto/googleapis/bigtable/adm" + - "in/v2;admin\252\002\036Google.Cloud.Bigtable.Admi" + - "n.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2b\006p" + - "roto3" + "rofileRequest\022\014\n\004name\030\001 \001(\t\"O\n\026ListAppPr" + + "ofilesRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_si" + + "ze\030\003 \001(\005\022\022\n\npage_token\030\002 \001(\t\"\210\001\n\027ListApp" + + "ProfilesResponse\022:\n\014app_profiles\030\001 \003(\0132$" + + ".google.bigtable.admin.v2.AppProfile\022\027\n\017" + + "next_page_token\030\002 \001(\t\022\030\n\020failed_location" + + "s\030\003 \003(\t\"\236\001\n\027UpdateAppProfileRequest\0229\n\013a" + + "pp_profile\030\001 \001(\0132$.google.bigtable.admin" + + ".v2.AppProfile\022/\n\013update_mask\030\002 \001(\0132\032.go" + + "ogle.protobuf.FieldMask\022\027\n\017ignore_warnin" + + "gs\030\003 \001(\010\"@\n\027DeleteAppProfileRequest\022\014\n\004n" + + "ame\030\001 \001(\t\022\027\n\017ignore_warnings\030\002 \001(\010\"\032\n\030Up" + + "dateAppProfileMetadata2\252\027\n\025BigtableInsta" + + "nceAdmin\022\216\001\n\016CreateInstance\022/.google.big" + + "table.admin.v2.CreateInstanceRequest\032\035.g" + + "oogle.longrunning.Operation\",\202\323\344\223\002&\"!/v2" + + "/{parent=projects/*}/instances:\001*\022\212\001\n\013Ge" + + "tInstance\022,.google.bigtable.admin.v2.Get" + + "InstanceRequest\032\".google.bigtable.admin." + + "v2.Instance\")\202\323\344\223\002#\022!/v2/{name=projects/" + + "*/instances/*}\022\233\001\n\rListInstances\022..googl" + + "e.bigtable.admin.v2.ListInstancesRequest" + + "\032/.google.bigtable.admin.v2.ListInstance" + + "sResponse\")\202\323\344\223\002#\022!/v2/{parent=projects/" + + "*}/instances\022\206\001\n\016UpdateInstance\022\".google" + + ".bigtable.admin.v2.Instance\032\".google.big" + + "table.admin.v2.Instance\",\202\323\344\223\002&\032!/v2/{na" + + "me=projects/*/instances/*}:\001*\022\254\001\n\025Partia" + + "lUpdateInstance\0226.google.bigtable.admin." + + "v2.PartialUpdateInstanceRequest\032\035.google" + + ".longrunning.Operation\"<\202\323\344\223\00262*/v2/{ins" + + "tance.name=projects/*/instances/*}:\010inst" + + "ance\022\204\001\n\016DeleteInstance\022/.google.bigtabl" + + "e.admin.v2.DeleteInstanceRequest\032\026.googl" + + "e.protobuf.Empty\")\202\323\344\223\002#*!/v2/{name=proj" + + "ects/*/instances/*}\022\235\001\n\rCreateCluster\022.." + + "google.bigtable.admin.v2.CreateClusterRe" + + "quest\032\035.google.longrunning.Operation\"=\202\323" + + "\344\223\0027\",/v2/{parent=projects/*/instances/*" + + "}/clusters:\007cluster\022\222\001\n\nGetCluster\022+.goo" + + "gle.bigtable.admin.v2.GetClusterRequest\032" + + "!.google.bigtable.admin.v2.Cluster\"4\202\323\344\223" + + "\002.\022,/v2/{name=projects/*/instances/*/clu" + + "sters/*}\022\243\001\n\014ListClusters\022-.google.bigta" + + "ble.admin.v2.ListClustersRequest\032..googl" + + "e.bigtable.admin.v2.ListClustersResponse" + + "\"4\202\323\344\223\002.\022,/v2/{parent=projects/*/instanc" + + "es/*}/clusters\022\212\001\n\rUpdateCluster\022!.googl" + + "e.bigtable.admin.v2.Cluster\032\035.google.lon" + + "grunning.Operation\"7\202\323\344\223\0021\032,/v2/{name=pr" + + "ojects/*/instances/*/clusters/*}:\001*\022\215\001\n\r" + + "DeleteCluster\022..google.bigtable.admin.v2" + + ".DeleteClusterRequest\032\026.google.protobuf." + + "Empty\"4\202\323\344\223\002.*,/v2/{name=projects/*/inst" + + "ances/*/clusters/*}\022\261\001\n\020CreateAppProfile" + + "\0221.google.bigtable.admin.v2.CreateAppPro" + + "fileRequest\032$.google.bigtable.admin.v2.A" + + "ppProfile\"D\202\323\344\223\002>\"//v2/{parent=projects/" + + "*/instances/*}/appProfiles:\013app_profile\022" + + "\236\001\n\rGetAppProfile\022..google.bigtable.admi" + + "n.v2.GetAppProfileRequest\032$.google.bigta" + + "ble.admin.v2.AppProfile\"7\202\323\344\223\0021\022//v2/{na" + + "me=projects/*/instances/*/appProfiles/*}" + + "\022\257\001\n\017ListAppProfiles\0220.google.bigtable.a" + + "dmin.v2.ListAppProfilesRequest\0321.google." + + "bigtable.admin.v2.ListAppProfilesRespons" + + "e\"7\202\323\344\223\0021\022//v2/{parent=projects/*/instan" + + "ces/*}/appProfiles\022\266\001\n\020UpdateAppProfile\022" + + "1.google.bigtable.admin.v2.UpdateAppProf" + + "ileRequest\032\035.google.longrunning.Operatio" + + "n\"P\202\323\344\223\002J2;/v2/{app_profile.name=project" + + "s/*/instances/*/appProfiles/*}:\013app_prof" + + "ile\022\226\001\n\020DeleteAppProfile\0221.google.bigtab" + + "le.admin.v2.DeleteAppProfileRequest\032\026.go" + + "ogle.protobuf.Empty\"7\202\323\344\223\0021*//v2/{name=p" + + "rojects/*/instances/*/appProfiles/*}\022\210\001\n" + + "\014GetIamPolicy\022\".google.iam.v1.GetIamPoli" + + "cyRequest\032\025.google.iam.v1.Policy\"=\202\323\344\223\0027" + + "\"2/v2/{resource=projects/*/instances/*}:" + + "getIamPolicy:\001*\022\210\001\n\014SetIamPolicy\022\".googl" + + "e.iam.v1.SetIamPolicyRequest\032\025.google.ia" + + "m.v1.Policy\"=\202\323\344\223\0027\"2/v2/{resource=proje" + + "cts/*/instances/*}:setIamPolicy:\001*\022\256\001\n\022T" + + "estIamPermissions\022(.google.iam.v1.TestIa" + + "mPermissionsRequest\032).google.iam.v1.Test" + + "IamPermissionsResponse\"C\202\323\344\223\002=\"8/v2/{res" + + "ource=projects/*/instances/*}:testIamPer" + + "missions:\001*B\275\001\n\034com.google.bigtable.admi" + + "n.v2B\032BigtableInstanceAdminProtoP\001Z=goog" + + "le.golang.org/genproto/googleapis/bigtab" + + "le/admin/v2;admin\252\002\036Google.Cloud.Bigtabl" + + "e.Admin.V2\312\002\036Google\\Cloud\\Bigtable\\Admin" + + "\\V2b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -423,13 +424,13 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_ListAppProfilesRequest_descriptor, - new java.lang.String[] { "Parent", "PageToken", }); + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_ListAppProfilesResponse_descriptor, - new java.lang.String[] { "AppProfiles", "NextPageToken", }); + new java.lang.String[] { "AppProfiles", "NextPageToken", "FailedLocations", }); internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_descriptor = getDescriptor().getMessageTypes().get(19); internal_static_google_bigtable_admin_v2_UpdateAppProfileRequest_fieldAccessorTable = new diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java index 66a2c55f77d7..0ab5a18e6173 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableTableAdminProto.java @@ -145,109 +145,110 @@ public static void registerAllExtensions( "snapshot\030\003 \001(\t\"m\n\023DropRowRangeRequest\022\014\n" + "\004name\030\001 \001(\t\022\030\n\016row_key_prefix\030\002 \001(\014H\000\022$\n" + "\032delete_all_data_from_table\030\003 \001(\010H\000B\010\n\006t" + - "arget\"k\n\021ListTablesRequest\022\016\n\006parent\030\001 \001" + + "arget\"~\n\021ListTablesRequest\022\016\n\006parent\030\001 \001" + "(\t\0222\n\004view\030\002 \001(\0162$.google.bigtable.admin" + - ".v2.Table.View\022\022\n\npage_token\030\003 \001(\t\"^\n\022Li" + - "stTablesResponse\022/\n\006tables\030\001 \003(\0132\037.googl" + - "e.bigtable.admin.v2.Table\022\027\n\017next_page_t" + - "oken\030\002 \001(\t\"S\n\017GetTableRequest\022\014\n\004name\030\001 " + - "\001(\t\0222\n\004view\030\002 \001(\0162$.google.bigtable.admi" + - "n.v2.Table.View\"\"\n\022DeleteTableRequest\022\014\n" + - "\004name\030\001 \001(\t\"\256\002\n\033ModifyColumnFamiliesRequ" + - "est\022\014\n\004name\030\001 \001(\t\022Y\n\rmodifications\030\002 \003(\013" + - "2B.google.bigtable.admin.v2.ModifyColumn" + - "FamiliesRequest.Modification\032\245\001\n\014Modific" + - "ation\022\n\n\002id\030\001 \001(\t\0228\n\006create\030\002 \001(\0132&.goog" + - "le.bigtable.admin.v2.ColumnFamilyH\000\0228\n\006u" + - "pdate\030\003 \001(\0132&.google.bigtable.admin.v2.C" + - "olumnFamilyH\000\022\016\n\004drop\030\004 \001(\010H\000B\005\n\003mod\"/\n\037" + - "GenerateConsistencyTokenRequest\022\014\n\004name\030" + - "\001 \001(\t\"=\n GenerateConsistencyTokenRespons" + - "e\022\031\n\021consistency_token\030\001 \001(\t\"B\n\027CheckCon" + - "sistencyRequest\022\014\n\004name\030\001 \001(\t\022\031\n\021consist" + - "ency_token\030\002 \001(\t\".\n\030CheckConsistencyResp" + - "onse\022\022\n\nconsistent\030\001 \001(\010\"\207\001\n\024SnapshotTab" + - "leRequest\022\014\n\004name\030\001 \001(\t\022\017\n\007cluster\030\002 \001(\t" + - "\022\023\n\013snapshot_id\030\003 \001(\t\022&\n\003ttl\030\004 \001(\0132\031.goo" + - "gle.protobuf.Duration\022\023\n\013description\030\005 \001" + - "(\t\"\"\n\022GetSnapshotRequest\022\014\n\004name\030\001 \001(\t\"M" + - "\n\024ListSnapshotsRequest\022\016\n\006parent\030\001 \001(\t\022\021" + - "\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"g\n" + - "\025ListSnapshotsResponse\0225\n\tsnapshots\030\001 \003(" + - "\0132\".google.bigtable.admin.v2.Snapshot\022\027\n" + - "\017next_page_token\030\002 \001(\t\"%\n\025DeleteSnapshot" + - "Request\022\014\n\004name\030\001 \001(\t\"\304\001\n\025SnapshotTableM" + - "etadata\022H\n\020original_request\030\001 \001(\0132..goog" + - "le.bigtable.admin.v2.SnapshotTableReques" + - "t\0220\n\014request_time\030\002 \001(\0132\032.google.protobu" + - "f.Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.googl" + - "e.protobuf.Timestamp\"\330\001\n\037CreateTableFrom" + - "SnapshotMetadata\022R\n\020original_request\030\001 \001" + - "(\01328.google.bigtable.admin.v2.CreateTabl" + - "eFromSnapshotRequest\0220\n\014request_time\030\002 \001" + + ".v2.Table.View\022\021\n\tpage_size\030\004 \001(\005\022\022\n\npag" + + "e_token\030\003 \001(\t\"^\n\022ListTablesResponse\022/\n\006t" + + "ables\030\001 \003(\0132\037.google.bigtable.admin.v2.T" + + "able\022\027\n\017next_page_token\030\002 \001(\t\"S\n\017GetTabl" + + "eRequest\022\014\n\004name\030\001 \001(\t\0222\n\004view\030\002 \001(\0162$.g" + + "oogle.bigtable.admin.v2.Table.View\"\"\n\022De" + + "leteTableRequest\022\014\n\004name\030\001 \001(\t\"\256\002\n\033Modif" + + "yColumnFamiliesRequest\022\014\n\004name\030\001 \001(\t\022Y\n\r" + + "modifications\030\002 \003(\0132B.google.bigtable.ad" + + "min.v2.ModifyColumnFamiliesRequest.Modif" + + "ication\032\245\001\n\014Modification\022\n\n\002id\030\001 \001(\t\0228\n\006" + + "create\030\002 \001(\0132&.google.bigtable.admin.v2." + + "ColumnFamilyH\000\0228\n\006update\030\003 \001(\0132&.google." + + "bigtable.admin.v2.ColumnFamilyH\000\022\016\n\004drop" + + "\030\004 \001(\010H\000B\005\n\003mod\"/\n\037GenerateConsistencyTo" + + "kenRequest\022\014\n\004name\030\001 \001(\t\"=\n GenerateCons" + + "istencyTokenResponse\022\031\n\021consistency_toke" + + "n\030\001 \001(\t\"B\n\027CheckConsistencyRequest\022\014\n\004na" + + "me\030\001 \001(\t\022\031\n\021consistency_token\030\002 \001(\t\".\n\030C" + + "heckConsistencyResponse\022\022\n\nconsistent\030\001 " + + "\001(\010\"\207\001\n\024SnapshotTableRequest\022\014\n\004name\030\001 \001" + + "(\t\022\017\n\007cluster\030\002 \001(\t\022\023\n\013snapshot_id\030\003 \001(\t" + + "\022&\n\003ttl\030\004 \001(\0132\031.google.protobuf.Duration" + + "\022\023\n\013description\030\005 \001(\t\"\"\n\022GetSnapshotRequ" + + "est\022\014\n\004name\030\001 \001(\t\"M\n\024ListSnapshotsReques" + + "t\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"g\n\025ListSnapshotsRespons" + + "e\0225\n\tsnapshots\030\001 \003(\0132\".google.bigtable.a" + + "dmin.v2.Snapshot\022\027\n\017next_page_token\030\002 \001(" + + "\t\"%\n\025DeleteSnapshotRequest\022\014\n\004name\030\001 \001(\t" + + "\"\304\001\n\025SnapshotTableMetadata\022H\n\020original_r" + + "equest\030\001 \001(\0132..google.bigtable.admin.v2." + + "SnapshotTableRequest\0220\n\014request_time\030\002 \001" + "(\0132\032.google.protobuf.Timestamp\022/\n\013finish" + - "_time\030\003 \001(\0132\032.google.protobuf.Timestamp2" + - "\267\021\n\022BigtableTableAdmin\022\223\001\n\013CreateTable\022," + - ".google.bigtable.admin.v2.CreateTableReq" + - "uest\032\037.google.bigtable.admin.v2.Table\"5\202" + - "\323\344\223\002/\"*/v2/{parent=projects/*/instances/" + - "*}/tables:\001*\022\274\001\n\027CreateTableFromSnapshot" + - "\0228.google.bigtable.admin.v2.CreateTableF" + - "romSnapshotRequest\032\035.google.longrunning." + - "Operation\"H\202\323\344\223\002B\"=/v2/{parent=projects/" + - "*/instances/*}/tables:createFromSnapshot" + - ":\001*\022\233\001\n\nListTables\022+.google.bigtable.adm" + - "in.v2.ListTablesRequest\032,.google.bigtabl" + - "e.admin.v2.ListTablesResponse\"2\202\323\344\223\002,\022*/" + - "v2/{parent=projects/*/instances/*}/table" + - "s\022\212\001\n\010GetTable\022).google.bigtable.admin.v" + - "2.GetTableRequest\032\037.google.bigtable.admi" + - "n.v2.Table\"2\202\323\344\223\002,\022*/v2/{name=projects/*" + - "/instances/*/tables/*}\022\207\001\n\013DeleteTable\022," + - ".google.bigtable.admin.v2.DeleteTableReq" + - "uest\032\026.google.protobuf.Empty\"2\202\323\344\223\002,**/v" + - "2/{name=projects/*/instances/*/tables/*}" + - "\022\272\001\n\024ModifyColumnFamilies\0225.google.bigta" + - "ble.admin.v2.ModifyColumnFamiliesRequest" + - "\032\037.google.bigtable.admin.v2.Table\"J\202\323\344\223\002" + - "D\"?/v2/{name=projects/*/instances/*/tabl" + - "es/*}:modifyColumnFamilies:\001*\022\231\001\n\014DropRo" + - "wRange\022-.google.bigtable.admin.v2.DropRo" + - "wRangeRequest\032\026.google.protobuf.Empty\"B\202" + - "\323\344\223\002<\"7/v2/{name=projects/*/instances/*/" + - "tables/*}:dropRowRange:\001*\022\341\001\n\030GenerateCo" + - "nsistencyToken\0229.google.bigtable.admin.v" + - "2.GenerateConsistencyTokenRequest\032:.goog" + + "_time\030\003 \001(\0132\032.google.protobuf.Timestamp\"" + + "\330\001\n\037CreateTableFromSnapshotMetadata\022R\n\020o" + + "riginal_request\030\001 \001(\01328.google.bigtable." + + "admin.v2.CreateTableFromSnapshotRequest\022" + + "0\n\014request_time\030\002 \001(\0132\032.google.protobuf." + + "Timestamp\022/\n\013finish_time\030\003 \001(\0132\032.google." + + "protobuf.Timestamp2\267\021\n\022BigtableTableAdmi" + + "n\022\223\001\n\013CreateTable\022,.google.bigtable.admi" + + "n.v2.CreateTableRequest\032\037.google.bigtabl" + + "e.admin.v2.Table\"5\202\323\344\223\002/\"*/v2/{parent=pr" + + "ojects/*/instances/*}/tables:\001*\022\274\001\n\027Crea" + + "teTableFromSnapshot\0228.google.bigtable.ad" + + "min.v2.CreateTableFromSnapshotRequest\032\035." + + "google.longrunning.Operation\"H\202\323\344\223\002B\"=/v" + + "2/{parent=projects/*/instances/*}/tables" + + ":createFromSnapshot:\001*\022\233\001\n\nListTables\022+." + + "google.bigtable.admin.v2.ListTablesReque" + + "st\032,.google.bigtable.admin.v2.ListTables" + + "Response\"2\202\323\344\223\002,\022*/v2/{parent=projects/*" + + "/instances/*}/tables\022\212\001\n\010GetTable\022).goog" + + "le.bigtable.admin.v2.GetTableRequest\032\037.g" + + "oogle.bigtable.admin.v2.Table\"2\202\323\344\223\002,\022*/" + + "v2/{name=projects/*/instances/*/tables/*" + + "}\022\207\001\n\013DeleteTable\022,.google.bigtable.admi" + + "n.v2.DeleteTableRequest\032\026.google.protobu" + + "f.Empty\"2\202\323\344\223\002,**/v2/{name=projects/*/in" + + "stances/*/tables/*}\022\272\001\n\024ModifyColumnFami" + + "lies\0225.google.bigtable.admin.v2.ModifyCo" + + "lumnFamiliesRequest\032\037.google.bigtable.ad" + + "min.v2.Table\"J\202\323\344\223\002D\"?/v2/{name=projects" + + "/*/instances/*/tables/*}:modifyColumnFam" + + "ilies:\001*\022\231\001\n\014DropRowRange\022-.google.bigta" + + "ble.admin.v2.DropRowRangeRequest\032\026.googl" + + "e.protobuf.Empty\"B\202\323\344\223\002<\"7/v2/{name=proj" + + "ects/*/instances/*/tables/*}:dropRowRang" + + "e:\001*\022\341\001\n\030GenerateConsistencyToken\0229.goog" + "le.bigtable.admin.v2.GenerateConsistency" + - "TokenResponse\"N\202\323\344\223\002H\"C/v2/{name=project" + - "s/*/instances/*/tables/*}:generateConsis" + - "tencyToken:\001*\022\301\001\n\020CheckConsistency\0221.goo" + - "gle.bigtable.admin.v2.CheckConsistencyRe" + - "quest\0322.google.bigtable.admin.v2.CheckCo" + - "nsistencyResponse\"F\202\323\344\223\002@\";/v2/{name=pro" + - "jects/*/instances/*/tables/*}:checkConsi" + - "stency:\001*\022\236\001\n\rSnapshotTable\022..google.big" + - "table.admin.v2.SnapshotTableRequest\032\035.go" + - "ogle.longrunning.Operation\">\202\323\344\223\0028\"3/v2/" + - "{name=projects/*/instances/*/tables/*}:s" + - "napshot:\001*\022\241\001\n\013GetSnapshot\022,.google.bigt" + - "able.admin.v2.GetSnapshotRequest\032\".googl" + - "e.bigtable.admin.v2.Snapshot\"@\202\323\344\223\002:\0228/v" + - "2/{name=projects/*/instances/*/clusters/" + - "*/snapshots/*}\022\262\001\n\rListSnapshots\022..googl" + - "e.bigtable.admin.v2.ListSnapshotsRequest" + - "\032/.google.bigtable.admin.v2.ListSnapshot" + - "sResponse\"@\202\323\344\223\002:\0228/v2/{parent=projects/" + - "*/instances/*/clusters/*}/snapshots\022\233\001\n\016" + - "DeleteSnapshot\022/.google.bigtable.admin.v" + - "2.DeleteSnapshotRequest\032\026.google.protobu" + - "f.Empty\"@\202\323\344\223\002:*8/v2/{name=projects/*/in" + - "stances/*/clusters/*/snapshots/*}B\272\001\n\034co" + - "m.google.bigtable.admin.v2B\027BigtableTabl" + - "eAdminProtoP\001Z=google.golang.org/genprot" + - "o/googleapis/bigtable/admin/v2;admin\252\002\036G" + - "oogle.Cloud.Bigtable.Admin.V2\312\002\036Google\\C" + - "loud\\Bigtable\\Admin\\V2b\006proto3" + "TokenRequest\032:.google.bigtable.admin.v2." + + "GenerateConsistencyTokenResponse\"N\202\323\344\223\002H" + + "\"C/v2/{name=projects/*/instances/*/table" + + "s/*}:generateConsistencyToken:\001*\022\301\001\n\020Che" + + "ckConsistency\0221.google.bigtable.admin.v2" + + ".CheckConsistencyRequest\0322.google.bigtab" + + "le.admin.v2.CheckConsistencyResponse\"F\202\323" + + "\344\223\002@\";/v2/{name=projects/*/instances/*/t" + + "ables/*}:checkConsistency:\001*\022\236\001\n\rSnapsho" + + "tTable\022..google.bigtable.admin.v2.Snapsh" + + "otTableRequest\032\035.google.longrunning.Oper" + + "ation\">\202\323\344\223\0028\"3/v2/{name=projects/*/inst" + + "ances/*/tables/*}:snapshot:\001*\022\241\001\n\013GetSna" + + "pshot\022,.google.bigtable.admin.v2.GetSnap" + + "shotRequest\032\".google.bigtable.admin.v2.S" + + "napshot\"@\202\323\344\223\002:\0228/v2/{name=projects/*/in" + + "stances/*/clusters/*/snapshots/*}\022\262\001\n\rLi" + + "stSnapshots\022..google.bigtable.admin.v2.L" + + "istSnapshotsRequest\032/.google.bigtable.ad" + + "min.v2.ListSnapshotsResponse\"@\202\323\344\223\002:\0228/v" + + "2/{parent=projects/*/instances/*/cluster" + + "s/*}/snapshots\022\233\001\n\016DeleteSnapshot\022/.goog" + + "le.bigtable.admin.v2.DeleteSnapshotReque" + + "st\032\026.google.protobuf.Empty\"@\202\323\344\223\002:*8/v2/" + + "{name=projects/*/instances/*/clusters/*/" + + "snapshots/*}B\272\001\n\034com.google.bigtable.adm" + + "in.v2B\027BigtableTableAdminProtoP\001Z=google" + + ".golang.org/genproto/googleapis/bigtable" + + "/admin/v2;admin\252\002\036Google.Cloud.Bigtable." + + "Admin.V2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V" + + "2b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -296,7 +297,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_bigtable_admin_v2_ListTablesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_ListTablesRequest_descriptor, - new java.lang.String[] { "Parent", "View", "PageToken", }); + new java.lang.String[] { "Parent", "View", "PageSize", "PageToken", }); internal_static_google_bigtable_admin_v2_ListTablesResponse_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_google_bigtable_admin_v2_ListTablesResponse_fieldAccessorTable = new diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java index 8dadd6210911..c17f6fc8de84 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequest.java @@ -289,7 +289,7 @@ public int getClustersCount() { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -313,7 +313,7 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -328,7 +328,7 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -348,7 +348,7 @@ public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1159,7 +1159,7 @@ public int getClustersCount() { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1183,7 +1183,7 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1198,7 +1198,7 @@ public java.util.Map get * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1218,7 +1218,7 @@ public com.google.bigtable.admin.v2.Cluster getClustersOrDefault( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1246,7 +1246,7 @@ public Builder clearClusters() { * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1273,7 +1273,7 @@ public Builder removeClusters( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -1293,7 +1293,7 @@ public Builder putClusters( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java index 58993a670263..cc62009b40d9 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateInstanceRequestOrBuilder.java @@ -83,7 +83,7 @@ public interface CreateInstanceRequestOrBuilder extends * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -95,7 +95,7 @@ public interface CreateInstanceRequestOrBuilder extends * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -114,7 +114,7 @@ boolean containsClusters( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -127,7 +127,7 @@ boolean containsClusters( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; @@ -142,7 +142,7 @@ com.google.bigtable.admin.v2.Cluster getClustersOrDefault( * cluster ID, e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. * Fields marked `OutputOnly` must be left blank. - * Currently exactly one cluster must be specified. + * Currently, at most two clusters can be specified. * * * map<string, .google.bigtable.admin.v2.Cluster> clusters = 4; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java index 851f72b64a7c..2b927cc44487 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequest.java @@ -21,6 +21,7 @@ private ListAppProfilesRequest(com.google.protobuf.GeneratedMessageV3.Builder } private ListAppProfilesRequest() { parent_ = ""; + pageSize_ = 0; pageToken_ = ""; } @@ -60,6 +61,11 @@ private ListAppProfilesRequest( pageToken_ = s; break; } + case 24: { + + pageSize_ = input.readInt32(); + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -99,6 +105,8 @@ private ListAppProfilesRequest( * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -120,6 +128,8 @@ public java.lang.String getParent() { * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -138,6 +148,20 @@ public java.lang.String getParent() { } } + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Maximum number of results per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; private volatile java.lang.Object pageToken_; /** @@ -200,6 +224,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } unknownFields.writeTo(output); } @@ -215,6 +242,10 @@ public int getSerializedSize() { if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -233,6 +264,8 @@ public boolean equals(final java.lang.Object obj) { boolean result = true; result = result && getParent() .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); result = result && getPageToken() .equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); @@ -248,6 +281,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -389,6 +424,8 @@ public Builder clear() { super.clear(); parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; return this; @@ -418,6 +455,7 @@ public com.google.bigtable.admin.v2.ListAppProfilesRequest build() { public com.google.bigtable.admin.v2.ListAppProfilesRequest buildPartial() { com.google.bigtable.admin.v2.ListAppProfilesRequest result = new com.google.bigtable.admin.v2.ListAppProfilesRequest(this); result.parent_ = parent_; + result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; onBuilt(); return result; @@ -471,6 +509,9 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesRequest oth parent_ = other.parent_; onChanged(); } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); @@ -510,6 +551,8 @@ public Builder mergeFrom( * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -531,6 +574,8 @@ public java.lang.String getParent() { * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -553,6 +598,8 @@ public java.lang.String getParent() { * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -572,6 +619,8 @@ public Builder setParent( * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -587,6 +636,8 @@ public Builder clearParent() { * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -603,6 +654,47 @@ public Builder setParentBytes( return this; } + private int pageSize_ ; + /** + *
+     * Maximum number of results per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Maximum number of results per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of results per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + private java.lang.Object pageToken_ = ""; /** *
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java
index e7cd2aa1edd4..931e354a7736 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesRequestOrBuilder.java
@@ -12,6 +12,8 @@ public interface ListAppProfilesRequestOrBuilder extends
    * The unique name of the instance for which a list of app profiles is
    * requested. Values are of the form
    * `projects/<project>/instances/<instance>`.
+   * Use `<instance> = '-'` to list AppProfiles for all Instances in a project,
+   * e.g., `projects/myproject/instances/-`.
    * 
* * string parent = 1; @@ -22,6 +24,8 @@ public interface ListAppProfilesRequestOrBuilder extends * The unique name of the instance for which a list of app profiles is * requested. Values are of the form * `projects/<project>/instances/<instance>`. + * Use `<instance> = '-'` to list AppProfiles for all Instances in a project, + * e.g., `projects/myproject/instances/-`. * * * string parent = 1; @@ -29,6 +33,16 @@ public interface ListAppProfilesRequestOrBuilder extends com.google.protobuf.ByteString getParentBytes(); + /** + *
+   * Maximum number of results per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + /** *
    * The value of `next_page_token` returned by a previous call.
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java
index f321dfd533fe..6c8752eb567d 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponse.java
@@ -22,6 +22,7 @@ private ListAppProfilesResponse(com.google.protobuf.GeneratedMessageV3.Builder
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + public com.google.protobuf.ProtocolStringList + getFailedLocationsList() { + return failedLocations_; + } + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + public com.google.protobuf.ByteString + getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -220,6 +290,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getNextPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } + for (int i = 0; i < failedLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, failedLocations_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -236,6 +309,14 @@ public int getSerializedSize() { if (!getNextPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } + { + int dataSize = 0; + for (int i = 0; i < failedLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(failedLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getFailedLocationsList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -256,6 +337,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getAppProfilesList()); result = result && getNextPageToken() .equals(other.getNextPageToken()); + result = result && getFailedLocationsList() + .equals(other.getFailedLocationsList()); result = result && unknownFields.equals(other.unknownFields); return result; } @@ -273,6 +356,10 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); + if (getFailedLocationsCount() > 0) { + hash = (37 * hash) + FAILED_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFailedLocationsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -419,6 +506,8 @@ public Builder clear() { } nextPageToken_ = ""; + failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -457,6 +546,11 @@ public com.google.bigtable.admin.v2.ListAppProfilesResponse buildPartial() { result.appProfiles_ = appProfilesBuilder_.build(); } result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + failedLocations_ = failedLocations_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.failedLocations_ = failedLocations_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -536,6 +630,16 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListAppProfilesResponse ot nextPageToken_ = other.nextPageToken_; onChanged(); } + if (!other.failedLocations_.isEmpty()) { + if (failedLocations_.isEmpty()) { + failedLocations_ = other.failedLocations_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFailedLocationsIsMutable(); + failedLocations_.addAll(other.failedLocations_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -976,6 +1080,163 @@ public Builder setNextPageTokenBytes( onChanged(); return this; } + + private com.google.protobuf.LazyStringList failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureFailedLocationsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + failedLocations_ = new com.google.protobuf.LazyStringArrayList(failedLocations_); + bitField0_ |= 0x00000004; + } + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public com.google.protobuf.ProtocolStringList + getFailedLocationsList() { + return failedLocations_.getUnmodifiableView(); + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public int getFailedLocationsCount() { + return failedLocations_.size(); + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public java.lang.String getFailedLocations(int index) { + return failedLocations_.get(index); + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public com.google.protobuf.ByteString + getFailedLocationsBytes(int index) { + return failedLocations_.getByteString(index); + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public Builder setFailedLocations( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public Builder addFailedLocations( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + onChanged(); + return this; + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public Builder addAllFailedLocations( + java.lang.Iterable values) { + ensureFailedLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, failedLocations_); + onChanged(); + return this; + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public Builder clearFailedLocations() { + failedLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Locations from which AppProfile information could not be retrieved,
+     * due to an outage or some other transient condition.
+     * AppProfiles from these locations may be missing from `app_profiles`.
+     * Values are of the form `projects/<project>/locations/<zone_id>`
+     * 
+ * + * repeated string failed_locations = 3; + */ + public Builder addFailedLocationsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFailedLocationsIsMutable(); + failedLocations_.add(value); + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java index 729a3946c263..15ce255193ff 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListAppProfilesResponseOrBuilder.java @@ -72,4 +72,51 @@ com.google.bigtable.admin.v2.AppProfileOrBuilder getAppProfilesOrBuilder( */ com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + java.util.List + getFailedLocationsList(); + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + int getFailedLocationsCount(); + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + java.lang.String getFailedLocations(int index); + /** + *
+   * Locations from which AppProfile information could not be retrieved,
+   * due to an outage or some other transient condition.
+   * AppProfiles from these locations may be missing from `app_profiles`.
+   * Values are of the form `projects/<project>/locations/<zone_id>`
+   * 
+ * + * repeated string failed_locations = 3; + */ + com.google.protobuf.ByteString + getFailedLocationsBytes(int index); } diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java index cfaab249c135..21ee4caaf7b8 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequest.java @@ -144,7 +144,7 @@ public java.lang.String getParent() { private volatile java.lang.Object pageToken_; /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; @@ -163,7 +163,7 @@ public java.lang.String getPageToken() { } /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; @@ -613,7 +613,7 @@ public Builder setParentBytes( private java.lang.Object pageToken_ = ""; /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -632,7 +632,7 @@ public java.lang.String getPageToken() { } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -652,7 +652,7 @@ public java.lang.String getPageToken() { } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -669,7 +669,7 @@ public Builder setPageToken( } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -682,7 +682,7 @@ public Builder clearPageToken() { } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java index dc95d5d82fb0..6fd4fe78b2fe 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersRequestOrBuilder.java @@ -33,7 +33,7 @@ public interface ListClustersRequestOrBuilder extends /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; @@ -41,7 +41,7 @@ public interface ListClustersRequestOrBuilder extends java.lang.String getPageToken(); /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java index 2521ddaded8d..aeab0829adc9 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponse.java @@ -175,6 +175,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -189,6 +190,7 @@ public com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -202,6 +204,7 @@ public int getFailedLocationsCount() { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -215,6 +218,7 @@ public java.lang.String getFailedLocations(int index) { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -228,9 +232,7 @@ public java.lang.String getFailedLocations(int index) { private volatile java.lang.Object nextPageToken_; /** *
-   * Set if not all clusters could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; @@ -249,9 +251,7 @@ public java.lang.String getNextPageToken() { } /** *
-   * Set if not all clusters could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; @@ -995,6 +995,7 @@ private void ensureFailedLocationsIsMutable() { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1009,6 +1010,7 @@ private void ensureFailedLocationsIsMutable() { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1022,6 +1024,7 @@ public int getFailedLocationsCount() { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1035,6 +1038,7 @@ public java.lang.String getFailedLocations(int index) { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1049,6 +1053,7 @@ public java.lang.String getFailedLocations(int index) { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1069,6 +1074,7 @@ public Builder setFailedLocations( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1089,6 +1095,7 @@ public Builder addFailedLocations( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1107,6 +1114,7 @@ public Builder addAllFailedLocations( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1123,6 +1131,7 @@ public Builder clearFailedLocations() { * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1142,9 +1151,7 @@ public Builder addFailedLocationsBytes( private java.lang.Object nextPageToken_ = ""; /** *
-     * Set if not all clusters could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1163,9 +1170,7 @@ public java.lang.String getNextPageToken() { } /** *
-     * Set if not all clusters could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1185,9 +1190,7 @@ public java.lang.String getNextPageToken() { } /** *
-     * Set if not all clusters could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1204,9 +1207,7 @@ public Builder setNextPageToken( } /** *
-     * Set if not all clusters could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1219,9 +1220,7 @@ public Builder clearNextPageToken() { } /** *
-     * Set if not all clusters could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java index bc74ad5fb3b7..070196852e71 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListClustersResponseOrBuilder.java @@ -57,6 +57,7 @@ com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -69,6 +70,7 @@ com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -80,6 +82,7 @@ com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -91,6 +94,7 @@ com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( * due to an outage or some other transient condition. * Clusters from these locations may be missing from `clusters`, * or may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -100,9 +104,7 @@ com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( /** *
-   * Set if not all clusters could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; @@ -110,9 +112,7 @@ com.google.bigtable.admin.v2.ClusterOrBuilder getClustersOrBuilder( java.lang.String getNextPageToken(); /** *
-   * Set if not all clusters could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java index 075910a0b59a..e2aefdc9821d 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequest.java @@ -140,7 +140,7 @@ public java.lang.String getParent() { private volatile java.lang.Object pageToken_; /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; @@ -159,7 +159,7 @@ public java.lang.String getPageToken() { } /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; @@ -599,7 +599,7 @@ public Builder setParentBytes( private java.lang.Object pageToken_ = ""; /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -618,7 +618,7 @@ public java.lang.String getPageToken() { } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -638,7 +638,7 @@ public java.lang.String getPageToken() { } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -655,7 +655,7 @@ public Builder setPageToken( } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; @@ -668,7 +668,7 @@ public Builder clearPageToken() { } /** *
-     * The value of `next_page_token` returned by a previous call.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string page_token = 2; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java index e8ca792820a2..83c0fe7809f4 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesRequestOrBuilder.java @@ -29,7 +29,7 @@ public interface ListInstancesRequestOrBuilder extends /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; @@ -37,7 +37,7 @@ public interface ListInstancesRequestOrBuilder extends java.lang.String getPageToken(); /** *
-   * The value of `next_page_token` returned by a previous call.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string page_token = 2; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java index 96675697372f..a1ababaab94d 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponse.java @@ -176,6 +176,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -191,6 +192,7 @@ public com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -205,6 +207,7 @@ public int getFailedLocationsCount() { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -219,6 +222,7 @@ public java.lang.String getFailedLocations(int index) { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -232,9 +236,7 @@ public java.lang.String getFailedLocations(int index) { private volatile java.lang.Object nextPageToken_; /** *
-   * Set if not all instances could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; @@ -253,9 +255,7 @@ public java.lang.String getNextPageToken() { } /** *
-   * Set if not all instances could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; @@ -1000,6 +1000,7 @@ private void ensureFailedLocationsIsMutable() { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1015,6 +1016,7 @@ private void ensureFailedLocationsIsMutable() { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1029,6 +1031,7 @@ public int getFailedLocationsCount() { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1043,6 +1046,7 @@ public java.lang.String getFailedLocations(int index) { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1058,6 +1062,7 @@ public java.lang.String getFailedLocations(int index) { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1079,6 +1084,7 @@ public Builder setFailedLocations( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1100,6 +1106,7 @@ public Builder addFailedLocations( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1119,6 +1126,7 @@ public Builder addAllFailedLocations( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1136,6 +1144,7 @@ public Builder clearFailedLocations() { * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -1155,9 +1164,7 @@ public Builder addFailedLocationsBytes( private java.lang.Object nextPageToken_ = ""; /** *
-     * Set if not all instances could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1176,9 +1183,7 @@ public java.lang.String getNextPageToken() { } /** *
-     * Set if not all instances could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1198,9 +1203,7 @@ public java.lang.String getNextPageToken() { } /** *
-     * Set if not all instances could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1217,9 +1220,7 @@ public Builder setNextPageToken( } /** *
-     * Set if not all instances could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; @@ -1232,9 +1233,7 @@ public Builder clearNextPageToken() { } /** *
-     * Set if not all instances could be returned in a single response.
-     * Pass this value to `page_token` in another request to get the next
-     * page of results.
+     * DEPRECATED: This field is unused and ignored.
      * 
* * string next_page_token = 3; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java index 69e40c4d031f..05de58aa3c59 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListInstancesResponseOrBuilder.java @@ -58,6 +58,7 @@ com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -71,6 +72,7 @@ com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -83,6 +85,7 @@ com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -95,6 +98,7 @@ com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( * Instances whose Clusters are all in one of the failed locations * may be missing from `instances`, and Instances with at least one * Cluster in a failed location may only have partial information returned. + * Values are of the form `projects/<project>/locations/<zone_id>` * * * repeated string failed_locations = 2; @@ -104,9 +108,7 @@ com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( /** *
-   * Set if not all instances could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; @@ -114,9 +116,7 @@ com.google.bigtable.admin.v2.InstanceOrBuilder getInstancesOrBuilder( java.lang.String getNextPageToken(); /** *
-   * Set if not all instances could be returned in a single response.
-   * Pass this value to `page_token` in another request to get the next
-   * page of results.
+   * DEPRECATED: This field is unused and ignored.
    * 
* * string next_page_token = 3; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java index c1d129646f00..1eed20b5ffa3 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequest.java @@ -157,7 +157,8 @@ public java.lang.String getParent() { private int pageSize_; /** *
-   * The maximum number of snapshots to return.
+   * The maximum number of snapshots to return per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
    * 
* * int32 page_size = 2; @@ -666,7 +667,8 @@ public Builder setParentBytes( private int pageSize_ ; /** *
-     * The maximum number of snapshots to return.
+     * The maximum number of snapshots to return per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
      * 
* * int32 page_size = 2; @@ -676,7 +678,8 @@ public int getPageSize() { } /** *
-     * The maximum number of snapshots to return.
+     * The maximum number of snapshots to return per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
      * 
* * int32 page_size = 2; @@ -689,7 +692,8 @@ public Builder setPageSize(int value) { } /** *
-     * The maximum number of snapshots to return.
+     * The maximum number of snapshots to return per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
      * 
* * int32 page_size = 2; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java index a5566f9a2911..fd560f00226b 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListSnapshotsRequestOrBuilder.java @@ -35,7 +35,8 @@ public interface ListSnapshotsRequestOrBuilder extends /** *
-   * The maximum number of snapshots to return.
+   * The maximum number of snapshots to return per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
    * 
* * int32 page_size = 2; diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java index d65cce0fcbf3..09cf9c3c9611 100644 --- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java +++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequest.java @@ -23,6 +23,7 @@ private ListTablesRequest(com.google.protobuf.GeneratedMessageV3.Builder buil private ListTablesRequest() { parent_ = ""; view_ = 0; + pageSize_ = 0; pageToken_ = ""; } @@ -68,6 +69,11 @@ private ListTablesRequest( pageToken_ = s; break; } + case 32: { + + pageSize_ = input.readInt32(); + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -171,6 +177,20 @@ public com.google.bigtable.admin.v2.Table.View getView() { return result == null ? com.google.bigtable.admin.v2.Table.View.UNRECOGNIZED : result; } + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + *
+   * Maximum number of results per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
+   * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; private volatile java.lang.Object pageToken_; /** @@ -236,6 +256,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } unknownFields.writeTo(output); } @@ -255,6 +278,10 @@ public int getSerializedSize() { if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, pageSize_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -274,6 +301,8 @@ public boolean equals(final java.lang.Object obj) { result = result && getParent() .equals(other.getParent()); result = result && view_ == other.view_; + result = result && (getPageSize() + == other.getPageSize()); result = result && getPageToken() .equals(other.getPageToken()); result = result && unknownFields.equals(other.unknownFields); @@ -291,6 +320,8 @@ public int hashCode() { hash = (53 * hash) + getParent().hashCode(); hash = (37 * hash) + VIEW_FIELD_NUMBER; hash = (53 * hash) + view_; + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); @@ -435,6 +466,8 @@ public Builder clear() { view_ = 0; + pageSize_ = 0; + pageToken_ = ""; return this; @@ -465,6 +498,7 @@ public com.google.bigtable.admin.v2.ListTablesRequest buildPartial() { com.google.bigtable.admin.v2.ListTablesRequest result = new com.google.bigtable.admin.v2.ListTablesRequest(this); result.parent_ = parent_; result.view_ = view_; + result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; onBuilt(); return result; @@ -521,6 +555,9 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.ListTablesRequest other) { if (other.view_ != 0) { setViewValue(other.getViewValue()); } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } if (!other.getPageToken().isEmpty()) { pageToken_ = other.pageToken_; onChanged(); @@ -718,6 +755,47 @@ public Builder clearView() { return this; } + private int pageSize_ ; + /** + *
+     * Maximum number of results per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 4; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Maximum number of results per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of results per page.
+     * CURRENTLY UNIMPLEMENTED AND IGNORED.
+     * 
+ * + * int32 page_size = 4; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + private java.lang.Object pageToken_ = ""; /** *
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java
index 5ea6768bf0f1..3f3a5cb665f9 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ListTablesRequestOrBuilder.java
@@ -46,6 +46,16 @@ public interface ListTablesRequestOrBuilder extends
    */
   com.google.bigtable.admin.v2.Table.View getView();
 
+  /**
+   * 
+   * Maximum number of results per page.
+   * CURRENTLY UNIMPLEMENTED AND IGNORED.
+   * 
+ * + * int32 page_size = 4; + */ + int getPageSize(); + /** *
    * The value of `next_page_token` returned by a previous call.
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto
index 25d2c0991ea5..ec992ea0f818 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_instance_admin.proto
@@ -1,4 +1,4 @@
-// Copyright 2018 Google Inc.
+// Copyright 2018 Google LLC.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@
 // 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.
+//
 
 syntax = "proto3";
 
@@ -202,7 +203,7 @@ message CreateInstanceRequest {
   // cluster ID, e.g., just `mycluster` rather than
   // `projects/myproject/instances/myinstance/clusters/mycluster`.
   // Fields marked `OutputOnly` must be left blank.
-  // Currently exactly one cluster must be specified.
+  // Currently, at most two clusters can be specified.
   map clusters = 4;
 }
 
@@ -219,7 +220,7 @@ message ListInstancesRequest {
   // Values are of the form `projects/`.
   string parent = 1;
 
-  // The value of `next_page_token` returned by a previous call.
+  // DEPRECATED: This field is unused and ignored.
   string page_token = 2;
 }
 
@@ -233,11 +234,10 @@ message ListInstancesResponse {
   // Instances whose Clusters are all in one of the failed locations
   // may be missing from `instances`, and Instances with at least one
   // Cluster in a failed location may only have partial information returned.
+  // Values are of the form `projects//locations/`
   repeated string failed_locations = 2;
 
-  // Set if not all instances could be returned in a single response.
-  // Pass this value to `page_token` in another request to get the next
-  // page of results.
+  // DEPRECATED: This field is unused and ignored.
   string next_page_token = 3;
 }
 
@@ -290,7 +290,7 @@ message ListClustersRequest {
   // e.g., `projects/myproject/instances/-`.
   string parent = 1;
 
-  // The value of `next_page_token` returned by a previous call.
+  // DEPRECATED: This field is unused and ignored.
   string page_token = 2;
 }
 
@@ -303,11 +303,10 @@ message ListClustersResponse {
   // due to an outage or some other transient condition.
   // Clusters from these locations may be missing from `clusters`,
   // or may only have partial information returned.
+  // Values are of the form `projects//locations/`
   repeated string failed_locations = 2;
 
-  // Set if not all clusters could be returned in a single response.
-  // Pass this value to `page_token` in another request to get the next
-  // page of results.
+  // DEPRECATED: This field is unused and ignored.
   string next_page_token = 3;
 }
 
@@ -398,8 +397,14 @@ message ListAppProfilesRequest {
   // The unique name of the instance for which a list of app profiles is
   // requested. Values are of the form
   // `projects//instances/`.
+  // Use ` = '-'` to list AppProfiles for all Instances in a project,
+  // e.g., `projects/myproject/instances/-`.
   string parent = 1;
 
+  // Maximum number of results per page.
+  // CURRENTLY UNIMPLEMENTED AND IGNORED.
+  int32 page_size = 3;
+
   // The value of `next_page_token` returned by a previous call.
   string page_token = 2;
 }
@@ -413,6 +418,12 @@ message ListAppProfilesResponse {
   // Pass this value to `page_token` in another request to get the next
   // page of results.
   string next_page_token = 2;
+
+  // Locations from which AppProfile information could not be retrieved,
+  // due to an outage or some other transient condition.
+  // AppProfiles from these locations may be missing from `app_profiles`.
+  // Values are of the form `projects//locations/`
+  repeated string failed_locations = 3;
 }
 
 // Request message for BigtableInstanceAdmin.UpdateAppProfile.
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto
index 650c5b8663d7..2d5bddf302aa 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/bigtable_table_admin.proto
@@ -1,4 +1,4 @@
-// Copyright 2018 Google Inc.
+// Copyright 2018 Google LLC.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@
 // 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.
+//
 
 syntax = "proto3";
 
@@ -272,6 +273,10 @@ message ListTablesRequest {
   // Defaults to `NAME_ONLY` if unspecified; no others are currently supported.
   Table.View view = 2;
 
+  // Maximum number of results per page.
+  // CURRENTLY UNIMPLEMENTED AND IGNORED.
+  int32 page_size = 4;
+
   // The value of `next_page_token` returned by a previous call.
   string page_token = 3;
 }
@@ -445,7 +450,8 @@ message ListSnapshotsRequest {
   // e.g., `projects//instances//clusters/-`.
   string parent = 1;
 
-  // The maximum number of snapshots to return.
+  // The maximum number of snapshots to return per page.
+  // CURRENTLY UNIMPLEMENTED AND IGNORED.
   int32 page_size = 2;
 
   // The value of `next_page_token` returned by a previous call.
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto
index d4c1795b5f5d..0ece12780eb9 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/common.proto
@@ -1,4 +1,4 @@
-// Copyright 2018 Google Inc.
+// Copyright 2018 Google LLC.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@
 // 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.
+//
 
 syntax = "proto3";
 
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto
index 1ee649b02221..bb69b1f66d42 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto
@@ -1,4 +1,4 @@
-// Copyright 2018 Google Inc.
+// Copyright 2018 Google LLC.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@
 // 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.
+//
 
 syntax = "proto3";
 
diff --git a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto
index 95827c217c82..5d4374effc59 100644
--- a/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto
+++ b/google-api-grpc/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto
@@ -1,4 +1,4 @@
-// Copyright 2018 Google Inc.
+// Copyright 2018 Google LLC.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -11,6 +11,7 @@
 // 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.
+//
 
 syntax = "proto3";
 
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequest.java
new file mode 100644
index 000000000000..67e502ddf5db
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequest.java
@@ -0,0 +1,665 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/cloud/kms/v1/service.proto
+
+package com.google.cloud.kms.v1;
+
+/**
+ * 
+ * Request message for [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricDecryptRequest} + */ +public final class AsymmetricDecryptRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.AsymmetricDecryptRequest) + AsymmetricDecryptRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsymmetricDecryptRequest.newBuilder() to construct. + private AsymmetricDecryptRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsymmetricDecryptRequest() { + name_ = ""; + ciphertext_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsymmetricDecryptRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + + ciphertext_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricDecryptRequest.class, com.google.cloud.kms.v1.AsymmetricDecryptRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+   * decryption.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+   * decryption.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CIPHERTEXT_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString ciphertext_; + /** + *
+   * Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public
+   * key using OAEP.
+   * 
+ * + * bytes ciphertext = 3; + */ + public com.google.protobuf.ByteString getCiphertext() { + return ciphertext_; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!ciphertext_.isEmpty()) { + output.writeBytes(3, ciphertext_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!ciphertext_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, ciphertext_); + } + size += unknownFields.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.kms.v1.AsymmetricDecryptRequest)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.AsymmetricDecryptRequest other = (com.google.cloud.kms.v1.AsymmetricDecryptRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getCiphertext() + .equals(other.getCiphertext()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + CIPHERTEXT_FIELD_NUMBER; + hash = (53 * hash) + getCiphertext().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest 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.kms.v1.AsymmetricDecryptRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest 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.kms.v1.AsymmetricDecryptRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest 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.kms.v1.AsymmetricDecryptRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest 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.kms.v1.AsymmetricDecryptRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest 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.kms.v1.AsymmetricDecryptRequest 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; + } + /** + *
+   * Request message for [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricDecryptRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.AsymmetricDecryptRequest) + com.google.cloud.kms.v1.AsymmetricDecryptRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricDecryptRequest.class, com.google.cloud.kms.v1.AsymmetricDecryptRequest.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.AsymmetricDecryptRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + ciphertext_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricDecryptRequest getDefaultInstanceForType() { + return com.google.cloud.kms.v1.AsymmetricDecryptRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricDecryptRequest build() { + com.google.cloud.kms.v1.AsymmetricDecryptRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricDecryptRequest buildPartial() { + com.google.cloud.kms.v1.AsymmetricDecryptRequest result = new com.google.cloud.kms.v1.AsymmetricDecryptRequest(this); + result.name_ = name_; + result.ciphertext_ = ciphertext_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.AsymmetricDecryptRequest) { + return mergeFrom((com.google.cloud.kms.v1.AsymmetricDecryptRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.AsymmetricDecryptRequest other) { + if (other == com.google.cloud.kms.v1.AsymmetricDecryptRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getCiphertext() != com.google.protobuf.ByteString.EMPTY) { + setCiphertext(other.getCiphertext()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.AsymmetricDecryptRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.AsymmetricDecryptRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+     * decryption.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+     * decryption.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+     * decryption.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+     * decryption.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+     * decryption.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString ciphertext_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public
+     * key using OAEP.
+     * 
+ * + * bytes ciphertext = 3; + */ + public com.google.protobuf.ByteString getCiphertext() { + return ciphertext_; + } + /** + *
+     * Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public
+     * key using OAEP.
+     * 
+ * + * bytes ciphertext = 3; + */ + public Builder setCiphertext(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + ciphertext_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public
+     * key using OAEP.
+     * 
+ * + * bytes ciphertext = 3; + */ + public Builder clearCiphertext() { + + ciphertext_ = getDefaultInstance().getCiphertext(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.AsymmetricDecryptRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.AsymmetricDecryptRequest) + private static final com.google.cloud.kms.v1.AsymmetricDecryptRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.AsymmetricDecryptRequest(); + } + + public static com.google.cloud.kms.v1.AsymmetricDecryptRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsymmetricDecryptRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsymmetricDecryptRequest(input, extensionRegistry); + } + }; + + 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.kms.v1.AsymmetricDecryptRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequestOrBuilder.java new file mode 100644 index 000000000000..8881d8f001a2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequestOrBuilder.java @@ -0,0 +1,39 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface AsymmetricDecryptRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.AsymmetricDecryptRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+   * decryption.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
+   * decryption.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public
+   * key using OAEP.
+   * 
+ * + * bytes ciphertext = 3; + */ + com.google.protobuf.ByteString getCiphertext(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponse.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponse.java new file mode 100644 index 000000000000..e0f7e0bad741 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponse.java @@ -0,0 +1,499 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * Response message for [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricDecryptResponse} + */ +public final class AsymmetricDecryptResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.AsymmetricDecryptResponse) + AsymmetricDecryptResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsymmetricDecryptResponse.newBuilder() to construct. + private AsymmetricDecryptResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsymmetricDecryptResponse() { + plaintext_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsymmetricDecryptResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + plaintext_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricDecryptResponse.class, com.google.cloud.kms.v1.AsymmetricDecryptResponse.Builder.class); + } + + public static final int PLAINTEXT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString plaintext_; + /** + *
+   * The decrypted data originally encrypted with the matching public key.
+   * 
+ * + * bytes plaintext = 1; + */ + public com.google.protobuf.ByteString getPlaintext() { + return plaintext_; + } + + 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 (!plaintext_.isEmpty()) { + output.writeBytes(1, plaintext_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!plaintext_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, plaintext_); + } + size += unknownFields.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.kms.v1.AsymmetricDecryptResponse)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.AsymmetricDecryptResponse other = (com.google.cloud.kms.v1.AsymmetricDecryptResponse) obj; + + boolean result = true; + result = result && getPlaintext() + .equals(other.getPlaintext()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PLAINTEXT_FIELD_NUMBER; + hash = (53 * hash) + getPlaintext().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse 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.kms.v1.AsymmetricDecryptResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse 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.kms.v1.AsymmetricDecryptResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse 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.kms.v1.AsymmetricDecryptResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse 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.kms.v1.AsymmetricDecryptResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse 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.kms.v1.AsymmetricDecryptResponse 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; + } + /** + *
+   * Response message for [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricDecryptResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.AsymmetricDecryptResponse) + com.google.cloud.kms.v1.AsymmetricDecryptResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricDecryptResponse.class, com.google.cloud.kms.v1.AsymmetricDecryptResponse.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.AsymmetricDecryptResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + plaintext_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricDecryptResponse getDefaultInstanceForType() { + return com.google.cloud.kms.v1.AsymmetricDecryptResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricDecryptResponse build() { + com.google.cloud.kms.v1.AsymmetricDecryptResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricDecryptResponse buildPartial() { + com.google.cloud.kms.v1.AsymmetricDecryptResponse result = new com.google.cloud.kms.v1.AsymmetricDecryptResponse(this); + result.plaintext_ = plaintext_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.AsymmetricDecryptResponse) { + return mergeFrom((com.google.cloud.kms.v1.AsymmetricDecryptResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.AsymmetricDecryptResponse other) { + if (other == com.google.cloud.kms.v1.AsymmetricDecryptResponse.getDefaultInstance()) return this; + if (other.getPlaintext() != com.google.protobuf.ByteString.EMPTY) { + setPlaintext(other.getPlaintext()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.AsymmetricDecryptResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.AsymmetricDecryptResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString plaintext_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The decrypted data originally encrypted with the matching public key.
+     * 
+ * + * bytes plaintext = 1; + */ + public com.google.protobuf.ByteString getPlaintext() { + return plaintext_; + } + /** + *
+     * The decrypted data originally encrypted with the matching public key.
+     * 
+ * + * bytes plaintext = 1; + */ + public Builder setPlaintext(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + plaintext_ = value; + onChanged(); + return this; + } + /** + *
+     * The decrypted data originally encrypted with the matching public key.
+     * 
+ * + * bytes plaintext = 1; + */ + public Builder clearPlaintext() { + + plaintext_ = getDefaultInstance().getPlaintext(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.AsymmetricDecryptResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.AsymmetricDecryptResponse) + private static final com.google.cloud.kms.v1.AsymmetricDecryptResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.AsymmetricDecryptResponse(); + } + + public static com.google.cloud.kms.v1.AsymmetricDecryptResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsymmetricDecryptResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsymmetricDecryptResponse(input, extensionRegistry); + } + }; + + 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.kms.v1.AsymmetricDecryptResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponseOrBuilder.java new file mode 100644 index 000000000000..dfd91da627c6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponseOrBuilder.java @@ -0,0 +1,18 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface AsymmetricDecryptResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.AsymmetricDecryptResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The decrypted data originally encrypted with the matching public key.
+   * 
+ * + * bytes plaintext = 1; + */ + com.google.protobuf.ByteString getPlaintext(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequest.java new file mode 100644 index 000000000000..e336661e283b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequest.java @@ -0,0 +1,830 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * Request message for [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricSignRequest} + */ +public final class AsymmetricSignRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.AsymmetricSignRequest) + AsymmetricSignRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsymmetricSignRequest.newBuilder() to construct. + private AsymmetricSignRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsymmetricSignRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsymmetricSignRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + com.google.cloud.kms.v1.Digest.Builder subBuilder = null; + if (digest_ != null) { + subBuilder = digest_.toBuilder(); + } + digest_ = input.readMessage(com.google.cloud.kms.v1.Digest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(digest_); + digest_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricSignRequest.class, com.google.cloud.kms.v1.AsymmetricSignRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIGEST_FIELD_NUMBER = 3; + private com.google.cloud.kms.v1.Digest digest_; + /** + *
+   * Required. The digest of the data to sign. The digest must be produced with
+   * the same digest algorithm as specified by the key version's
+   * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+   * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public boolean hasDigest() { + return digest_ != null; + } + /** + *
+   * Required. The digest of the data to sign. The digest must be produced with
+   * the same digest algorithm as specified by the key version's
+   * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+   * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public com.google.cloud.kms.v1.Digest getDigest() { + return digest_ == null ? com.google.cloud.kms.v1.Digest.getDefaultInstance() : digest_; + } + /** + *
+   * Required. The digest of the data to sign. The digest must be produced with
+   * the same digest algorithm as specified by the key version's
+   * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+   * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public com.google.cloud.kms.v1.DigestOrBuilder getDigestOrBuilder() { + return getDigest(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (digest_ != null) { + output.writeMessage(3, getDigest()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (digest_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getDigest()); + } + size += unknownFields.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.kms.v1.AsymmetricSignRequest)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.AsymmetricSignRequest other = (com.google.cloud.kms.v1.AsymmetricSignRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasDigest() == other.hasDigest()); + if (hasDigest()) { + result = result && getDigest() + .equals(other.getDigest()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasDigest()) { + hash = (37 * hash) + DIGEST_FIELD_NUMBER; + hash = (53 * hash) + getDigest().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.AsymmetricSignRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest 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.kms.v1.AsymmetricSignRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest 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.kms.v1.AsymmetricSignRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest 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.kms.v1.AsymmetricSignRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest 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.kms.v1.AsymmetricSignRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricSignRequest 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.kms.v1.AsymmetricSignRequest 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; + } + /** + *
+   * Request message for [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricSignRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.AsymmetricSignRequest) + com.google.cloud.kms.v1.AsymmetricSignRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricSignRequest.class, com.google.cloud.kms.v1.AsymmetricSignRequest.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.AsymmetricSignRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (digestBuilder_ == null) { + digest_ = null; + } else { + digest_ = null; + digestBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricSignRequest getDefaultInstanceForType() { + return com.google.cloud.kms.v1.AsymmetricSignRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricSignRequest build() { + com.google.cloud.kms.v1.AsymmetricSignRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricSignRequest buildPartial() { + com.google.cloud.kms.v1.AsymmetricSignRequest result = new com.google.cloud.kms.v1.AsymmetricSignRequest(this); + result.name_ = name_; + if (digestBuilder_ == null) { + result.digest_ = digest_; + } else { + result.digest_ = digestBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.AsymmetricSignRequest) { + return mergeFrom((com.google.cloud.kms.v1.AsymmetricSignRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.AsymmetricSignRequest other) { + if (other == com.google.cloud.kms.v1.AsymmetricSignRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasDigest()) { + mergeDigest(other.getDigest()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.AsymmetricSignRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.AsymmetricSignRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.cloud.kms.v1.Digest digest_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.Digest, com.google.cloud.kms.v1.Digest.Builder, com.google.cloud.kms.v1.DigestOrBuilder> digestBuilder_; + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public boolean hasDigest() { + return digestBuilder_ != null || digest_ != null; + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public com.google.cloud.kms.v1.Digest getDigest() { + if (digestBuilder_ == null) { + return digest_ == null ? com.google.cloud.kms.v1.Digest.getDefaultInstance() : digest_; + } else { + return digestBuilder_.getMessage(); + } + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public Builder setDigest(com.google.cloud.kms.v1.Digest value) { + if (digestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + digest_ = value; + onChanged(); + } else { + digestBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public Builder setDigest( + com.google.cloud.kms.v1.Digest.Builder builderForValue) { + if (digestBuilder_ == null) { + digest_ = builderForValue.build(); + onChanged(); + } else { + digestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public Builder mergeDigest(com.google.cloud.kms.v1.Digest value) { + if (digestBuilder_ == null) { + if (digest_ != null) { + digest_ = + com.google.cloud.kms.v1.Digest.newBuilder(digest_).mergeFrom(value).buildPartial(); + } else { + digest_ = value; + } + onChanged(); + } else { + digestBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public Builder clearDigest() { + if (digestBuilder_ == null) { + digest_ = null; + onChanged(); + } else { + digest_ = null; + digestBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public com.google.cloud.kms.v1.Digest.Builder getDigestBuilder() { + + onChanged(); + return getDigestFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + public com.google.cloud.kms.v1.DigestOrBuilder getDigestOrBuilder() { + if (digestBuilder_ != null) { + return digestBuilder_.getMessageOrBuilder(); + } else { + return digest_ == null ? + com.google.cloud.kms.v1.Digest.getDefaultInstance() : digest_; + } + } + /** + *
+     * Required. The digest of the data to sign. The digest must be produced with
+     * the same digest algorithm as specified by the key version's
+     * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+     * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.Digest, com.google.cloud.kms.v1.Digest.Builder, com.google.cloud.kms.v1.DigestOrBuilder> + getDigestFieldBuilder() { + if (digestBuilder_ == null) { + digestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.Digest, com.google.cloud.kms.v1.Digest.Builder, com.google.cloud.kms.v1.DigestOrBuilder>( + getDigest(), + getParentForChildren(), + isClean()); + digest_ = null; + } + return digestBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.AsymmetricSignRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.AsymmetricSignRequest) + private static final com.google.cloud.kms.v1.AsymmetricSignRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.AsymmetricSignRequest(); + } + + public static com.google.cloud.kms.v1.AsymmetricSignRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsymmetricSignRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsymmetricSignRequest(input, extensionRegistry); + } + }; + + 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.kms.v1.AsymmetricSignRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequestOrBuilder.java new file mode 100644 index 000000000000..49ce227515df --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface AsymmetricSignRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.AsymmetricSignRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Required. The digest of the data to sign. The digest must be produced with
+   * the same digest algorithm as specified by the key version's
+   * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+   * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + boolean hasDigest(); + /** + *
+   * Required. The digest of the data to sign. The digest must be produced with
+   * the same digest algorithm as specified by the key version's
+   * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+   * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + com.google.cloud.kms.v1.Digest getDigest(); + /** + *
+   * Required. The digest of the data to sign. The digest must be produced with
+   * the same digest algorithm as specified by the key version's
+   * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
+   * 
+ * + * .google.cloud.kms.v1.Digest digest = 3; + */ + com.google.cloud.kms.v1.DigestOrBuilder getDigestOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponse.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponse.java new file mode 100644 index 000000000000..e54e861a7f63 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponse.java @@ -0,0 +1,499 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * Response message for [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricSignResponse} + */ +public final class AsymmetricSignResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.AsymmetricSignResponse) + AsymmetricSignResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AsymmetricSignResponse.newBuilder() to construct. + private AsymmetricSignResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AsymmetricSignResponse() { + signature_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AsymmetricSignResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + signature_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricSignResponse.class, com.google.cloud.kms.v1.AsymmetricSignResponse.Builder.class); + } + + public static final int SIGNATURE_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString signature_; + /** + *
+   * The created signature.
+   * 
+ * + * bytes signature = 1; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + 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 (!signature_.isEmpty()) { + output.writeBytes(1, signature_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!signature_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, signature_); + } + size += unknownFields.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.kms.v1.AsymmetricSignResponse)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.AsymmetricSignResponse other = (com.google.cloud.kms.v1.AsymmetricSignResponse) obj; + + boolean result = true; + result = result && getSignature() + .equals(other.getSignature()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.AsymmetricSignResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse 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.kms.v1.AsymmetricSignResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse 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.kms.v1.AsymmetricSignResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse 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.kms.v1.AsymmetricSignResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse 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.kms.v1.AsymmetricSignResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.AsymmetricSignResponse 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.kms.v1.AsymmetricSignResponse 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; + } + /** + *
+   * Response message for [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.AsymmetricSignResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.AsymmetricSignResponse) + com.google.cloud.kms.v1.AsymmetricSignResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.AsymmetricSignResponse.class, com.google.cloud.kms.v1.AsymmetricSignResponse.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.AsymmetricSignResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + signature_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_AsymmetricSignResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricSignResponse getDefaultInstanceForType() { + return com.google.cloud.kms.v1.AsymmetricSignResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricSignResponse build() { + com.google.cloud.kms.v1.AsymmetricSignResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.AsymmetricSignResponse buildPartial() { + com.google.cloud.kms.v1.AsymmetricSignResponse result = new com.google.cloud.kms.v1.AsymmetricSignResponse(this); + result.signature_ = signature_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.AsymmetricSignResponse) { + return mergeFrom((com.google.cloud.kms.v1.AsymmetricSignResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.AsymmetricSignResponse other) { + if (other == com.google.cloud.kms.v1.AsymmetricSignResponse.getDefaultInstance()) return this; + if (other.getSignature() != com.google.protobuf.ByteString.EMPTY) { + setSignature(other.getSignature()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.AsymmetricSignResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.AsymmetricSignResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The created signature.
+     * 
+ * + * bytes signature = 1; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + *
+     * The created signature.
+     * 
+ * + * bytes signature = 1; + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + signature_ = value; + onChanged(); + return this; + } + /** + *
+     * The created signature.
+     * 
+ * + * bytes signature = 1; + */ + public Builder clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.AsymmetricSignResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.AsymmetricSignResponse) + private static final com.google.cloud.kms.v1.AsymmetricSignResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.AsymmetricSignResponse(); + } + + public static com.google.cloud.kms.v1.AsymmetricSignResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AsymmetricSignResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AsymmetricSignResponse(input, extensionRegistry); + } + }; + + 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.kms.v1.AsymmetricSignResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponseOrBuilder.java new file mode 100644 index 000000000000..e7509b3f7d3e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponseOrBuilder.java @@ -0,0 +1,18 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface AsymmetricSignResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.AsymmetricSignResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The created signature.
+   * 
+ * + * bytes signature = 1; + */ + com.google.protobuf.ByteString getSignature(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java index 794c14754e76..94c6e36f6205 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java @@ -117,10 +117,10 @@ private CryptoKey( break; } case 82: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { labels_ = com.google.protobuf.MapField.newMapField( LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000040; + mutable_bitField0_ |= 0x00000080; } com.google.protobuf.MapEntry labels__ = input.readMessage( @@ -129,6 +129,19 @@ private CryptoKey( labels__.getKey(), labels__.getValue()); break; } + case 90: { + com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder subBuilder = null; + if (versionTemplate_ != null) { + subBuilder = versionTemplate_.toBuilder(); + } + versionTemplate_ = input.readMessage(com.google.cloud.kms.v1.CryptoKeyVersionTemplate.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(versionTemplate_); + versionTemplate_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -175,9 +188,9 @@ protected com.google.protobuf.MapField internalGetMapField( /** *
-   * [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] describes the capabilities of a [CryptoKey][google.cloud.kms.v1.CryptoKey]. Two
-   * keys with the same purpose may use different underlying algorithms, but
-   * must support the same set of operations.
+   * [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] describes the cryptographic capabilities of a
+   * [CryptoKey][google.cloud.kms.v1.CryptoKey]. A given key can only be used for the operations allowed by
+   * its purpose.
    * 
* * Protobuf enum {@code google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose} @@ -202,6 +215,26 @@ public enum CryptoKeyPurpose * ENCRYPT_DECRYPT = 1; */ ENCRYPT_DECRYPT(1), + /** + *
+     * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with
+     * [AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign] and
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ * + * ASYMMETRIC_SIGN = 5; + */ + ASYMMETRIC_SIGN(5), + /** + *
+     * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with
+     * [AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt] and
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ * + * ASYMMETRIC_DECRYPT = 6; + */ + ASYMMETRIC_DECRYPT(6), UNRECOGNIZED(-1), ; @@ -223,6 +256,26 @@ public enum CryptoKeyPurpose * ENCRYPT_DECRYPT = 1; */ public static final int ENCRYPT_DECRYPT_VALUE = 1; + /** + *
+     * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with
+     * [AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign] and
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ * + * ASYMMETRIC_SIGN = 5; + */ + public static final int ASYMMETRIC_SIGN_VALUE = 5; + /** + *
+     * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with
+     * [AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt] and
+     * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+     * 
+ * + * ASYMMETRIC_DECRYPT = 6; + */ + public static final int ASYMMETRIC_DECRYPT_VALUE = 6; public final int getNumber() { @@ -245,6 +298,8 @@ public static CryptoKeyPurpose forNumber(int value) { switch (value) { case 0: return CRYPTO_KEY_PURPOSE_UNSPECIFIED; case 1: return ENCRYPT_DECRYPT; + case 5: return ASYMMETRIC_SIGN; + case 6: return ASYMMETRIC_DECRYPT; default: return null; } } @@ -387,6 +442,9 @@ public java.lang.String getName() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. *
* * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -401,6 +459,9 @@ public boolean hasPrimary() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. *
* * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -415,6 +476,9 @@ public com.google.cloud.kms.v1.CryptoKeyVersion getPrimary() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -427,8 +491,7 @@ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getPrimaryOrBuilder() { private int purpose_; /** *
-   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-   * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
    * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -438,8 +501,7 @@ public int getPurposeValue() { } /** *
-   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-   * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
    * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -494,6 +556,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -510,6 +575,9 @@ public boolean hasNextRotationTime() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -526,6 +594,9 @@ public com.google.protobuf.Timestamp getNextRotationTime() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -540,6 +611,9 @@ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -552,6 +626,9 @@ public boolean hasRotationPeriod() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -567,6 +644,9 @@ public com.google.protobuf.Duration getRotationPeriod() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -578,6 +658,48 @@ public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() { return com.google.protobuf.Duration.getDefaultInstance(); } + public static final int VERSION_TEMPLATE_FIELD_NUMBER = 11; + private com.google.cloud.kms.v1.CryptoKeyVersionTemplate versionTemplate_; + /** + *
+   * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+   * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * auto-rotation are controlled by this template.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public boolean hasVersionTemplate() { + return versionTemplate_ != null; + } + /** + *
+   * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+   * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * auto-rotation are controlled by this template.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public com.google.cloud.kms.v1.CryptoKeyVersionTemplate getVersionTemplate() { + return versionTemplate_ == null ? com.google.cloud.kms.v1.CryptoKeyVersionTemplate.getDefaultInstance() : versionTemplate_; + } + /** + *
+   * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+   * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * auto-rotation are controlled by this template.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder getVersionTemplateOrBuilder() { + return getVersionTemplate(); + } + public static final int LABELS_FIELD_NUMBER = 10; private static final class LabelsDefaultEntryHolder { static final com.google.protobuf.MapEntry< @@ -712,6 +834,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 10); + if (versionTemplate_ != null) { + output.writeMessage(11, getVersionTemplate()); + } unknownFields.writeTo(output); } @@ -754,6 +879,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(10, labels__); } + if (versionTemplate_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getVersionTemplate()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -788,6 +917,11 @@ public boolean equals(final java.lang.Object obj) { result = result && getNextRotationTime() .equals(other.getNextRotationTime()); } + result = result && (hasVersionTemplate() == other.hasVersionTemplate()); + if (hasVersionTemplate()) { + result = result && getVersionTemplate() + .equals(other.getVersionTemplate()); + } result = result && internalGetLabels().equals( other.internalGetLabels()); result = result && getRotationScheduleCase().equals( @@ -828,6 +962,10 @@ public int hashCode() { hash = (37 * hash) + NEXT_ROTATION_TIME_FIELD_NUMBER; hash = (53 * hash) + getNextRotationTime().hashCode(); } + if (hasVersionTemplate()) { + hash = (37 * hash) + VERSION_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getVersionTemplate().hashCode(); + } if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); @@ -1024,6 +1162,12 @@ public Builder clear() { nextRotationTime_ = null; nextRotationTimeBuilder_ = null; } + if (versionTemplateBuilder_ == null) { + versionTemplate_ = null; + } else { + versionTemplate_ = null; + versionTemplateBuilder_ = null; + } internalGetMutableLabels().clear(); rotationScheduleCase_ = 0; rotationSchedule_ = null; @@ -1079,6 +1223,11 @@ public com.google.cloud.kms.v1.CryptoKey buildPartial() { result.rotationSchedule_ = rotationPeriodBuilder_.build(); } } + if (versionTemplateBuilder_ == null) { + result.versionTemplate_ = versionTemplate_; + } else { + result.versionTemplate_ = versionTemplateBuilder_.build(); + } result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.bitField0_ = to_bitField0_; @@ -1147,6 +1296,9 @@ public Builder mergeFrom(com.google.cloud.kms.v1.CryptoKey other) { if (other.hasNextRotationTime()) { mergeNextRotationTime(other.getNextRotationTime()); } + if (other.hasVersionTemplate()) { + mergeVersionTemplate(other.getVersionTemplate()); + } internalGetMutableLabels().mergeFrom( other.internalGetLabels()); switch (other.getRotationScheduleCase()) { @@ -1307,6 +1459,9 @@ public Builder setNameBytes( * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1321,6 +1476,9 @@ public boolean hasPrimary() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1339,6 +1497,9 @@ public com.google.cloud.kms.v1.CryptoKeyVersion getPrimary() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1363,6 +1524,9 @@ public Builder setPrimary(com.google.cloud.kms.v1.CryptoKeyVersion value) { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1385,6 +1549,9 @@ public Builder setPrimary( * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1411,6 +1578,9 @@ public Builder mergePrimary(com.google.cloud.kms.v1.CryptoKeyVersion value) { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1433,6 +1603,9 @@ public Builder clearPrimary() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1449,6 +1622,9 @@ public com.google.cloud.kms.v1.CryptoKeyVersion.Builder getPrimaryBuilder() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1468,6 +1644,9 @@ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getPrimaryOrBuilder() { * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -1489,8 +1668,7 @@ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getPrimaryOrBuilder() { private int purpose_ = 0; /** *
-     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-     * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
      * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -1500,8 +1678,7 @@ public int getPurposeValue() { } /** *
-     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-     * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
      * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -1513,8 +1690,7 @@ public Builder setPurposeValue(int value) { } /** *
-     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-     * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
      * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -1526,8 +1702,7 @@ public com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose getPurpose() { } /** *
-     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-     * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
      * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -1543,8 +1718,7 @@ public Builder setPurpose(com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose val } /** *
-     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-     * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
      * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -1721,6 +1895,9 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1737,6 +1914,9 @@ public boolean hasNextRotationTime() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1757,6 +1937,9 @@ public com.google.protobuf.Timestamp getNextRotationTime() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1783,6 +1966,9 @@ public Builder setNextRotationTime(com.google.protobuf.Timestamp value) { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1807,6 +1993,9 @@ public Builder setNextRotationTime( * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1835,6 +2024,9 @@ public Builder mergeNextRotationTime(com.google.protobuf.Timestamp value) { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1859,6 +2051,9 @@ public Builder clearNextRotationTime() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1877,6 +2072,9 @@ public com.google.protobuf.Timestamp.Builder getNextRotationTimeBuilder() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1898,6 +2096,9 @@ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -1923,6 +2124,9 @@ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -1935,6 +2139,9 @@ public boolean hasRotationPeriod() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -1957,6 +2164,9 @@ public com.google.protobuf.Duration getRotationPeriod() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -1979,6 +2189,9 @@ public Builder setRotationPeriod(com.google.protobuf.Duration value) { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -1999,6 +2212,9 @@ public Builder setRotationPeriod( * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -2027,6 +2243,9 @@ public Builder mergeRotationPeriod(com.google.protobuf.Duration value) { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -2052,6 +2271,9 @@ public Builder clearRotationPeriod() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -2064,6 +2286,9 @@ public com.google.protobuf.Duration.Builder getRotationPeriodBuilder() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -2083,6 +2308,9 @@ public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() { * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -2106,6 +2334,186 @@ public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() { return rotationPeriodBuilder_; } + private com.google.cloud.kms.v1.CryptoKeyVersionTemplate versionTemplate_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.CryptoKeyVersionTemplate, com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder, com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder> versionTemplateBuilder_; + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public boolean hasVersionTemplate() { + return versionTemplateBuilder_ != null || versionTemplate_ != null; + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public com.google.cloud.kms.v1.CryptoKeyVersionTemplate getVersionTemplate() { + if (versionTemplateBuilder_ == null) { + return versionTemplate_ == null ? com.google.cloud.kms.v1.CryptoKeyVersionTemplate.getDefaultInstance() : versionTemplate_; + } else { + return versionTemplateBuilder_.getMessage(); + } + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public Builder setVersionTemplate(com.google.cloud.kms.v1.CryptoKeyVersionTemplate value) { + if (versionTemplateBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + versionTemplate_ = value; + onChanged(); + } else { + versionTemplateBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public Builder setVersionTemplate( + com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder builderForValue) { + if (versionTemplateBuilder_ == null) { + versionTemplate_ = builderForValue.build(); + onChanged(); + } else { + versionTemplateBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public Builder mergeVersionTemplate(com.google.cloud.kms.v1.CryptoKeyVersionTemplate value) { + if (versionTemplateBuilder_ == null) { + if (versionTemplate_ != null) { + versionTemplate_ = + com.google.cloud.kms.v1.CryptoKeyVersionTemplate.newBuilder(versionTemplate_).mergeFrom(value).buildPartial(); + } else { + versionTemplate_ = value; + } + onChanged(); + } else { + versionTemplateBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public Builder clearVersionTemplate() { + if (versionTemplateBuilder_ == null) { + versionTemplate_ = null; + onChanged(); + } else { + versionTemplate_ = null; + versionTemplateBuilder_ = null; + } + + return this; + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder getVersionTemplateBuilder() { + + onChanged(); + return getVersionTemplateFieldBuilder().getBuilder(); + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + public com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder getVersionTemplateOrBuilder() { + if (versionTemplateBuilder_ != null) { + return versionTemplateBuilder_.getMessageOrBuilder(); + } else { + return versionTemplate_ == null ? + com.google.cloud.kms.v1.CryptoKeyVersionTemplate.getDefaultInstance() : versionTemplate_; + } + } + /** + *
+     * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+     * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+     * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+     * auto-rotation are controlled by this template.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.CryptoKeyVersionTemplate, com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder, com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder> + getVersionTemplateFieldBuilder() { + if (versionTemplateBuilder_ == null) { + versionTemplateBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.CryptoKeyVersionTemplate, com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder, com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder>( + getVersionTemplate(), + getParentForChildren(), + isClean()); + versionTemplate_ = null; + } + return versionTemplateBuilder_; + } + private com.google.protobuf.MapField< java.lang.String, java.lang.String> labels_; private com.google.protobuf.MapField diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyOrBuilder.java index 7af24d0cdfee..354e84e5179d 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyOrBuilder.java @@ -34,6 +34,9 @@ public interface CryptoKeyOrBuilder extends * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -46,6 +49,9 @@ public interface CryptoKeyOrBuilder extends * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -58,6 +64,9 @@ public interface CryptoKeyOrBuilder extends * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + * All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + * primary. For other keys, this field will be omitted. * * * .google.cloud.kms.v1.CryptoKeyVersion primary = 2; @@ -66,8 +75,7 @@ public interface CryptoKeyOrBuilder extends /** *
-   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-   * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
    * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -75,8 +83,7 @@ public interface CryptoKeyOrBuilder extends int getPurposeValue(); /** *
-   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable
-   * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
    * 
* * .google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3; @@ -117,6 +124,9 @@ public interface CryptoKeyOrBuilder extends * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -131,6 +141,9 @@ public interface CryptoKeyOrBuilder extends * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -145,6 +158,9 @@ public interface CryptoKeyOrBuilder extends * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Timestamp next_rotation_time = 7; @@ -156,6 +172,9 @@ public interface CryptoKeyOrBuilder extends * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -166,6 +185,9 @@ public interface CryptoKeyOrBuilder extends * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; @@ -176,12 +198,49 @@ public interface CryptoKeyOrBuilder extends * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service * automatically rotates a key. Must be at least one day. * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + * Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + * automatic rotation. For other keys, this field must be omitted. * * * .google.protobuf.Duration rotation_period = 8; */ com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder(); + /** + *
+   * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+   * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * auto-rotation are controlled by this template.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + boolean hasVersionTemplate(); + /** + *
+   * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+   * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * auto-rotation are controlled by this template.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + com.google.cloud.kms.v1.CryptoKeyVersionTemplate getVersionTemplate(); + /** + *
+   * A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances.
+   * The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * auto-rotation are controlled by this template.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersionTemplate version_template = 11; + */ + com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder getVersionTemplateOrBuilder(); + /** *
    * Labels with user-defined metadata. For more information, see
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersion.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersion.java
index 8dd63fd67926..6a3263f99db0 100644
--- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersion.java
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersion.java
@@ -7,13 +7,12 @@
  * 
  * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents an individual cryptographic key, and the
  * associated key material.
- * It can be used for cryptographic operations either directly, or via its
- * parent [CryptoKey][google.cloud.kms.v1.CryptoKey], in which case the server will choose the appropriate
- * version for the operation.
+ * An [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] version can be
+ * used for cryptographic operations.
  * For security reasons, the raw cryptographic key material represented by a
  * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] can never be viewed or exported. It can only be used to
- * encrypt or decrypt data when an authorized user or application invokes Cloud
- * KMS.
+ * encrypt, decrypt, or sign data when an authorized user or application invokes
+ * Cloud KMS.
  * 
* * Protobuf type {@code google.cloud.kms.v1.CryptoKeyVersion} @@ -30,6 +29,8 @@ private CryptoKeyVersion(com.google.protobuf.GeneratedMessageV3.Builder build private CryptoKeyVersion() { name_ = ""; state_ = 0; + protectionLevel_ = 0; + algorithm_ = 0; } @java.lang.Override @@ -107,6 +108,44 @@ private CryptoKeyVersion( break; } + case 56: { + int rawValue = input.readEnum(); + + protectionLevel_ = rawValue; + break; + } + case 66: { + com.google.cloud.kms.v1.KeyOperationAttestation.Builder subBuilder = null; + if (attestation_ != null) { + subBuilder = attestation_.toBuilder(); + } + attestation_ = input.readMessage(com.google.cloud.kms.v1.KeyOperationAttestation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attestation_); + attestation_ = subBuilder.buildPartial(); + } + + break; + } + case 80: { + int rawValue = input.readEnum(); + + algorithm_ = rawValue; + break; + } + case 90: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (generateTime_ != null) { + subBuilder = generateTime_.toBuilder(); + } + generateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(generateTime_); + generateTime_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -139,6 +178,333 @@ private CryptoKeyVersion( com.google.cloud.kms.v1.CryptoKeyVersion.class, com.google.cloud.kms.v1.CryptoKeyVersion.Builder.class); } + /** + *
+   * The algorithm of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], indicating what
+   * parameters must be used for each cryptographic operation.
+   * The
+   * [GOOGLE_SYMMETRIC_ENCRYPTION][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.GOOGLE_SYMMETRIC_ENCRYPTION]
+   * algorithm is usable with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+   * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * Algorithms beginning with "RSA_SIGN_" are usable with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+   * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN].
+   * The fields in the name after "RSA_SIGN_" correspond to the following
+   * parameters: padding algorithm, modulus bit length, and digest algorithm.
+   * For PSS, the salt length used is equal to the length of digest
+   * algorithm. For example,
+   * [RSA_SIGN_PSS_2048_SHA256][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256]
+   * will use PSS with a salt length of 256 bits or 32 bytes.
+   * Algorithms beginning with "RSA_DECRYPT_" are usable with
+   * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+   * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
+   * The fields in the name after "RSA_DECRYPT_" correspond to the following
+   * parameters: padding algorithm, modulus bit length, and digest algorithm.
+   * Algorithms beginning with "EC_SIGN_" are usable with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
+   * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN].
+   * The fields in the name after "EC_SIGN_" correspond to the following
+   * parameters: elliptic curve, digest algorithm.
+   * 
+ * + * Protobuf enum {@code google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm} + */ + public enum CryptoKeyVersionAlgorithm + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Not specified.
+     * 
+ * + * CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; + */ + CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED(0), + /** + *
+     * Creates symmetric encryption keys.
+     * 
+ * + * GOOGLE_SYMMETRIC_ENCRYPTION = 1; + */ + GOOGLE_SYMMETRIC_ENCRYPTION(1), + /** + *
+     * RSASSA-PSS 2048 bit key with a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PSS_2048_SHA256 = 2; + */ + RSA_SIGN_PSS_2048_SHA256(2), + /** + *
+     * RSASSA-PSS 3072 bit key with a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PSS_3072_SHA256 = 3; + */ + RSA_SIGN_PSS_3072_SHA256(3), + /** + *
+     * RSASSA-PSS 4096 bit key with a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PSS_4096_SHA256 = 4; + */ + RSA_SIGN_PSS_4096_SHA256(4), + /** + *
+     * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PKCS1_2048_SHA256 = 5; + */ + RSA_SIGN_PKCS1_2048_SHA256(5), + /** + *
+     * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PKCS1_3072_SHA256 = 6; + */ + RSA_SIGN_PKCS1_3072_SHA256(6), + /** + *
+     * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PKCS1_4096_SHA256 = 7; + */ + RSA_SIGN_PKCS1_4096_SHA256(7), + /** + *
+     * RSAES-OAEP 2048 bit key with a SHA256 digest.
+     * 
+ * + * RSA_DECRYPT_OAEP_2048_SHA256 = 8; + */ + RSA_DECRYPT_OAEP_2048_SHA256(8), + /** + *
+     * RSAES-OAEP 3072 bit key with a SHA256 digest.
+     * 
+ * + * RSA_DECRYPT_OAEP_3072_SHA256 = 9; + */ + RSA_DECRYPT_OAEP_3072_SHA256(9), + /** + *
+     * RSAES-OAEP 4096 bit key with a SHA256 digest.
+     * 
+ * + * RSA_DECRYPT_OAEP_4096_SHA256 = 10; + */ + RSA_DECRYPT_OAEP_4096_SHA256(10), + /** + *
+     * ECDSA on the NIST P-256 curve with a SHA256 digest.
+     * 
+ * + * EC_SIGN_P256_SHA256 = 12; + */ + EC_SIGN_P256_SHA256(12), + /** + *
+     * ECDSA on the NIST P-384 curve with a SHA384 digest.
+     * 
+ * + * EC_SIGN_P384_SHA384 = 13; + */ + EC_SIGN_P384_SHA384(13), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Not specified.
+     * 
+ * + * CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; + */ + public static final int CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED_VALUE = 0; + /** + *
+     * Creates symmetric encryption keys.
+     * 
+ * + * GOOGLE_SYMMETRIC_ENCRYPTION = 1; + */ + public static final int GOOGLE_SYMMETRIC_ENCRYPTION_VALUE = 1; + /** + *
+     * RSASSA-PSS 2048 bit key with a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PSS_2048_SHA256 = 2; + */ + public static final int RSA_SIGN_PSS_2048_SHA256_VALUE = 2; + /** + *
+     * RSASSA-PSS 3072 bit key with a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PSS_3072_SHA256 = 3; + */ + public static final int RSA_SIGN_PSS_3072_SHA256_VALUE = 3; + /** + *
+     * RSASSA-PSS 4096 bit key with a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PSS_4096_SHA256 = 4; + */ + public static final int RSA_SIGN_PSS_4096_SHA256_VALUE = 4; + /** + *
+     * RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PKCS1_2048_SHA256 = 5; + */ + public static final int RSA_SIGN_PKCS1_2048_SHA256_VALUE = 5; + /** + *
+     * RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PKCS1_3072_SHA256 = 6; + */ + public static final int RSA_SIGN_PKCS1_3072_SHA256_VALUE = 6; + /** + *
+     * RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest.
+     * 
+ * + * RSA_SIGN_PKCS1_4096_SHA256 = 7; + */ + public static final int RSA_SIGN_PKCS1_4096_SHA256_VALUE = 7; + /** + *
+     * RSAES-OAEP 2048 bit key with a SHA256 digest.
+     * 
+ * + * RSA_DECRYPT_OAEP_2048_SHA256 = 8; + */ + public static final int RSA_DECRYPT_OAEP_2048_SHA256_VALUE = 8; + /** + *
+     * RSAES-OAEP 3072 bit key with a SHA256 digest.
+     * 
+ * + * RSA_DECRYPT_OAEP_3072_SHA256 = 9; + */ + public static final int RSA_DECRYPT_OAEP_3072_SHA256_VALUE = 9; + /** + *
+     * RSAES-OAEP 4096 bit key with a SHA256 digest.
+     * 
+ * + * RSA_DECRYPT_OAEP_4096_SHA256 = 10; + */ + public static final int RSA_DECRYPT_OAEP_4096_SHA256_VALUE = 10; + /** + *
+     * ECDSA on the NIST P-256 curve with a SHA256 digest.
+     * 
+ * + * EC_SIGN_P256_SHA256 = 12; + */ + public static final int EC_SIGN_P256_SHA256_VALUE = 12; + /** + *
+     * ECDSA on the NIST P-384 curve with a SHA384 digest.
+     * 
+ * + * EC_SIGN_P384_SHA384 = 13; + */ + public static final int EC_SIGN_P384_SHA384_VALUE = 13; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CryptoKeyVersionAlgorithm valueOf(int value) { + return forNumber(value); + } + + public static CryptoKeyVersionAlgorithm forNumber(int value) { + switch (value) { + case 0: return CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED; + case 1: return GOOGLE_SYMMETRIC_ENCRYPTION; + case 2: return RSA_SIGN_PSS_2048_SHA256; + case 3: return RSA_SIGN_PSS_3072_SHA256; + case 4: return RSA_SIGN_PSS_4096_SHA256; + case 5: return RSA_SIGN_PKCS1_2048_SHA256; + case 6: return RSA_SIGN_PKCS1_3072_SHA256; + case 7: return RSA_SIGN_PKCS1_4096_SHA256; + case 8: return RSA_DECRYPT_OAEP_2048_SHA256; + case 9: return RSA_DECRYPT_OAEP_3072_SHA256; + case 10: return RSA_DECRYPT_OAEP_4096_SHA256; + case 12: return EC_SIGN_P256_SHA256; + case 13: return EC_SIGN_P384_SHA384; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CryptoKeyVersionAlgorithm> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CryptoKeyVersionAlgorithm findValueByNumber(int number) { + return CryptoKeyVersionAlgorithm.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + 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.kms.v1.CryptoKeyVersion.getDescriptor().getEnumTypes().get(0); + } + + private static final CryptoKeyVersionAlgorithm[] VALUES = values(); + + public static CryptoKeyVersionAlgorithm 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 CryptoKeyVersionAlgorithm(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm) + } + /** *
    * The state of a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], indicating if it can be used.
@@ -158,8 +524,17 @@ public enum CryptoKeyVersionState
     CRYPTO_KEY_VERSION_STATE_UNSPECIFIED(0),
     /**
      * 
-     * This version may be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and
-     * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] requests.
+     * This version is still being generated. It may not be used, enabled,
+     * disabled, or destroyed yet. Cloud KMS will automatically mark this
+     * version [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] as soon as the version is ready.
+     * 
+ * + * PENDING_GENERATION = 5; + */ + PENDING_GENERATION(5), + /** + *
+     * This version may be used for cryptographic operations.
      * 
* * ENABLED = 1; @@ -207,8 +582,17 @@ public enum CryptoKeyVersionState public static final int CRYPTO_KEY_VERSION_STATE_UNSPECIFIED_VALUE = 0; /** *
-     * This version may be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and
-     * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] requests.
+     * This version is still being generated. It may not be used, enabled,
+     * disabled, or destroyed yet. Cloud KMS will automatically mark this
+     * version [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] as soon as the version is ready.
+     * 
+ * + * PENDING_GENERATION = 5; + */ + public static final int PENDING_GENERATION_VALUE = 5; + /** + *
+     * This version may be used for cryptographic operations.
      * 
* * ENABLED = 1; @@ -264,6 +648,7 @@ public static CryptoKeyVersionState valueOf(int value) { public static CryptoKeyVersionState forNumber(int value) { switch (value) { case 0: return CRYPTO_KEY_VERSION_STATE_UNSPECIFIED; + case 5: return PENDING_GENERATION; case 1: return ENABLED; case 2: return DISABLED; case 3: return DESTROYED; @@ -294,7 +679,7 @@ public CryptoKeyVersionState findValueByNumber(int number) { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return com.google.cloud.kms.v1.CryptoKeyVersion.getDescriptor().getEnumTypes().get(0); + return com.google.cloud.kms.v1.CryptoKeyVersion.getDescriptor().getEnumTypes().get(1); } private static final CryptoKeyVersionState[] VALUES = values(); @@ -320,6 +705,131 @@ private CryptoKeyVersionState(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState) } + /** + *
+   * A view for [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]s. Controls the level of detail returned
+   * for [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] in
+   * [KeyManagementService.ListCryptoKeyVersions][google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions] and
+   * [KeyManagementService.ListCryptoKeys][google.cloud.kms.v1.KeyManagementService.ListCryptoKeys].
+   * 
+ * + * Protobuf enum {@code google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView} + */ + public enum CryptoKeyVersionView + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Default view for each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Does not include
+     * the [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation] field.
+     * 
+ * + * CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; + */ + CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED(0), + /** + *
+     * Provides all fields in each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], including the
+     * [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation].
+     * 
+ * + * FULL = 1; + */ + FULL(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Default view for each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Does not include
+     * the [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation] field.
+     * 
+ * + * CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; + */ + public static final int CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED_VALUE = 0; + /** + *
+     * Provides all fields in each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], including the
+     * [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation].
+     * 
+ * + * FULL = 1; + */ + public static final int FULL_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static CryptoKeyVersionView valueOf(int value) { + return forNumber(value); + } + + public static CryptoKeyVersionView forNumber(int value) { + switch (value) { + case 0: return CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED; + case 1: return FULL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + CryptoKeyVersionView> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public CryptoKeyVersionView findValueByNumber(int number) { + return CryptoKeyVersionView.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + 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.kms.v1.CryptoKeyVersion.getDescriptor().getEnumTypes().get(2); + } + + private static final CryptoKeyVersionView[] VALUES = values(); + + public static CryptoKeyVersionView 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 CryptoKeyVersionView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView) + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -364,29 +874,125 @@ public java.lang.String getName() { } } - public static final int STATE_FIELD_NUMBER = 3; - private int state_; + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + *
+   * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.valueOf(state_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.UNRECOGNIZED : result; + } + + public static final int PROTECTION_LEVEL_FIELD_NUMBER = 7; + private int protectionLevel_; + /** + *
+   * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+   * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + public int getProtectionLevelValue() { + return protectionLevel_; + } + /** + *
+   * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+   * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + public com.google.cloud.kms.v1.ProtectionLevel getProtectionLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.ProtectionLevel result = com.google.cloud.kms.v1.ProtectionLevel.valueOf(protectionLevel_); + return result == null ? com.google.cloud.kms.v1.ProtectionLevel.UNRECOGNIZED : result; + } + + public static final int ALGORITHM_FIELD_NUMBER = 10; + private int algorithm_; + /** + *
+   * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+   * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; + */ + public int getAlgorithmValue() { + return algorithm_; + } + /** + *
+   * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+   * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.valueOf(algorithm_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.UNRECOGNIZED : result; + } + + public static final int ATTESTATION_FIELD_NUMBER = 8; + private com.google.cloud.kms.v1.KeyOperationAttestation attestation_; /** *
-   * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * Output only. Statement that was generated and signed by the HSM at key
+   * creation time. Use this statement to verify attributes of the key as stored
+   * on the HSM, independently of Google. Only provided for key versions with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
    * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public int getStateValue() { - return state_; + public boolean hasAttestation() { + return attestation_ != null; } /** *
-   * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * Output only. Statement that was generated and signed by the HSM at key
+   * creation time. Use this statement to verify attributes of the key as stored
+   * on the HSM, independently of Google. Only provided for key versions with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
    * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState() { - @SuppressWarnings("deprecation") - com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.valueOf(state_); - return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.UNRECOGNIZED : result; + public com.google.cloud.kms.v1.KeyOperationAttestation getAttestation() { + return attestation_ == null ? com.google.cloud.kms.v1.KeyOperationAttestation.getDefaultInstance() : attestation_; + } + /** + *
+   * Output only. Statement that was generated and signed by the HSM at key
+   * creation time. Use this statement to verify attributes of the key as stored
+   * on the HSM, independently of Google. Only provided for key versions with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + public com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder getAttestationOrBuilder() { + return getAttestation(); } public static final int CREATE_TIME_FIELD_NUMBER = 4; @@ -422,6 +1028,42 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return getCreateTime(); } + public static final int GENERATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp generateTime_; + /** + *
+   * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+   * generated.
+   * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public boolean hasGenerateTime() { + return generateTime_ != null; + } + /** + *
+   * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+   * generated.
+   * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public com.google.protobuf.Timestamp getGenerateTime() { + return generateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : generateTime_; + } + /** + *
+   * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+   * generated.
+   * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getGenerateTimeOrBuilder() { + return getGenerateTime(); + } + public static final int DESTROY_TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp destroyTime_; /** @@ -529,6 +1171,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (destroyEventTime_ != null) { output.writeMessage(6, getDestroyEventTime()); } + if (protectionLevel_ != com.google.cloud.kms.v1.ProtectionLevel.PROTECTION_LEVEL_UNSPECIFIED.getNumber()) { + output.writeEnum(7, protectionLevel_); + } + if (attestation_ != null) { + output.writeMessage(8, getAttestation()); + } + if (algorithm_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED.getNumber()) { + output.writeEnum(10, algorithm_); + } + if (generateTime_ != null) { + output.writeMessage(11, getGenerateTime()); + } unknownFields.writeTo(output); } @@ -557,6 +1211,22 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, getDestroyEventTime()); } + if (protectionLevel_ != com.google.cloud.kms.v1.ProtectionLevel.PROTECTION_LEVEL_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, protectionLevel_); + } + if (attestation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getAttestation()); + } + if (algorithm_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(10, algorithm_); + } + if (generateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, getGenerateTime()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -576,11 +1246,23 @@ public boolean equals(final java.lang.Object obj) { result = result && getName() .equals(other.getName()); result = result && state_ == other.state_; + result = result && protectionLevel_ == other.protectionLevel_; + result = result && algorithm_ == other.algorithm_; + result = result && (hasAttestation() == other.hasAttestation()); + if (hasAttestation()) { + result = result && getAttestation() + .equals(other.getAttestation()); + } result = result && (hasCreateTime() == other.hasCreateTime()); if (hasCreateTime()) { result = result && getCreateTime() .equals(other.getCreateTime()); } + result = result && (hasGenerateTime() == other.hasGenerateTime()); + if (hasGenerateTime()) { + result = result && getGenerateTime() + .equals(other.getGenerateTime()); + } result = result && (hasDestroyTime() == other.hasDestroyTime()); if (hasDestroyTime()) { result = result && getDestroyTime() @@ -606,10 +1288,22 @@ public int hashCode() { hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; + hash = (37 * hash) + PROTECTION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + protectionLevel_; + hash = (37 * hash) + ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + algorithm_; + if (hasAttestation()) { + hash = (37 * hash) + ATTESTATION_FIELD_NUMBER; + hash = (53 * hash) + getAttestation().hashCode(); + } if (hasCreateTime()) { hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; hash = (53 * hash) + getCreateTime().hashCode(); } + if (hasGenerateTime()) { + hash = (37 * hash) + GENERATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getGenerateTime().hashCode(); + } if (hasDestroyTime()) { hash = (37 * hash) + DESTROY_TIME_FIELD_NUMBER; hash = (53 * hash) + getDestroyTime().hashCode(); @@ -717,13 +1411,12 @@ protected Builder newBuilderForType( *
    * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents an individual cryptographic key, and the
    * associated key material.
-   * It can be used for cryptographic operations either directly, or via its
-   * parent [CryptoKey][google.cloud.kms.v1.CryptoKey], in which case the server will choose the appropriate
-   * version for the operation.
+   * An [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] version can be
+   * used for cryptographic operations.
    * For security reasons, the raw cryptographic key material represented by a
    * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] can never be viewed or exported. It can only be used to
-   * encrypt or decrypt data when an authorized user or application invokes Cloud
-   * KMS.
+   * encrypt, decrypt, or sign data when an authorized user or application invokes
+   * Cloud KMS.
    * 
* * Protobuf type {@code google.cloud.kms.v1.CryptoKeyVersion} @@ -767,12 +1460,28 @@ public Builder clear() { state_ = 0; + protectionLevel_ = 0; + + algorithm_ = 0; + + if (attestationBuilder_ == null) { + attestation_ = null; + } else { + attestation_ = null; + attestationBuilder_ = null; + } if (createTimeBuilder_ == null) { createTime_ = null; } else { createTime_ = null; createTimeBuilder_ = null; } + if (generateTimeBuilder_ == null) { + generateTime_ = null; + } else { + generateTime_ = null; + generateTimeBuilder_ = null; + } if (destroyTimeBuilder_ == null) { destroyTime_ = null; } else { @@ -813,11 +1522,23 @@ public com.google.cloud.kms.v1.CryptoKeyVersion buildPartial() { com.google.cloud.kms.v1.CryptoKeyVersion result = new com.google.cloud.kms.v1.CryptoKeyVersion(this); result.name_ = name_; result.state_ = state_; + result.protectionLevel_ = protectionLevel_; + result.algorithm_ = algorithm_; + if (attestationBuilder_ == null) { + result.attestation_ = attestation_; + } else { + result.attestation_ = attestationBuilder_.build(); + } if (createTimeBuilder_ == null) { result.createTime_ = createTime_; } else { result.createTime_ = createTimeBuilder_.build(); } + if (generateTimeBuilder_ == null) { + result.generateTime_ = generateTime_; + } else { + result.generateTime_ = generateTimeBuilder_.build(); + } if (destroyTimeBuilder_ == null) { result.destroyTime_ = destroyTime_; } else { @@ -883,9 +1604,21 @@ public Builder mergeFrom(com.google.cloud.kms.v1.CryptoKeyVersion other) { if (other.state_ != 0) { setStateValue(other.getStateValue()); } + if (other.protectionLevel_ != 0) { + setProtectionLevelValue(other.getProtectionLevelValue()); + } + if (other.algorithm_ != 0) { + setAlgorithmValue(other.getAlgorithmValue()); + } + if (other.hasAttestation()) { + mergeAttestation(other.getAttestation()); + } if (other.hasCreateTime()) { mergeCreateTime(other.getCreateTime()); } + if (other.hasGenerateTime()) { + mergeGenerateTime(other.getGenerateTime()); + } if (other.hasDestroyTime()) { mergeDestroyTime(other.getDestroyTime()); } @@ -920,164 +1653,484 @@ public Builder mergeFrom( } return this; } - - private java.lang.Object name_ = ""; + + private java.lang.Object name_ = ""; + /** + *
+     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + *
+     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.valueOf(state_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.UNRECOGNIZED : result; + } + /** + *
+     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public Builder setState(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private int protectionLevel_ = 0; + /** + *
+     * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+     * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + public int getProtectionLevelValue() { + return protectionLevel_; + } + /** + *
+     * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+     * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + public Builder setProtectionLevelValue(int value) { + protectionLevel_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+     * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + public com.google.cloud.kms.v1.ProtectionLevel getProtectionLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.ProtectionLevel result = com.google.cloud.kms.v1.ProtectionLevel.valueOf(protectionLevel_); + return result == null ? com.google.cloud.kms.v1.ProtectionLevel.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+     * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + public Builder setProtectionLevel(com.google.cloud.kms.v1.ProtectionLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + protectionLevel_ = value.getNumber(); + onChanged(); + return this; + } /** *
-     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
-     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+     * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
      * 
* - * string name = 1; + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public Builder clearProtectionLevel() { + + protectionLevel_ = 0; + onChanged(); + return this; } + + private int algorithm_ = 0; /** *
-     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
-     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
      * 
* - * string name = 1; + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getAlgorithmValue() { + return algorithm_; } /** *
-     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
-     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
      * 
* - * string name = 1; + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; + public Builder setAlgorithmValue(int value) { + algorithm_ = value; onChanged(); return this; } /** *
-     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
-     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
      * 
* - * string name = 1; + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; */ - public Builder clearName() { + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.valueOf(algorithm_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; + */ + public Builder setAlgorithm(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm value) { + if (value == null) { + throw new NullPointerException(); + } - name_ = getDefaultInstance().getName(); + algorithm_ = value.getNumber(); onChanged(); return this; } /** *
-     * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format
-     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
+     * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+     * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
      * 
* - * string name = 1; + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public Builder clearAlgorithm() { - name_ = value; + algorithm_ = 0; onChanged(); return this; } - private int state_ = 0; + private com.google.cloud.kms.v1.KeyOperationAttestation attestation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.KeyOperationAttestation, com.google.cloud.kms.v1.KeyOperationAttestation.Builder, com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder> attestationBuilder_; /** *
-     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
      * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public int getStateValue() { - return state_; + public boolean hasAttestation() { + return attestationBuilder_ != null || attestation_ != null; } /** *
-     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
      * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public Builder setStateValue(int value) { - state_ = value; - onChanged(); + public com.google.cloud.kms.v1.KeyOperationAttestation getAttestation() { + if (attestationBuilder_ == null) { + return attestation_ == null ? com.google.cloud.kms.v1.KeyOperationAttestation.getDefaultInstance() : attestation_; + } else { + return attestationBuilder_.getMessage(); + } + } + /** + *
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + public Builder setAttestation(com.google.cloud.kms.v1.KeyOperationAttestation value) { + if (attestationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attestation_ = value; + onChanged(); + } else { + attestationBuilder_.setMessage(value); + } + return this; } /** *
-     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
      * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState() { - @SuppressWarnings("deprecation") - com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.valueOf(state_); - return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.UNRECOGNIZED : result; + public Builder setAttestation( + com.google.cloud.kms.v1.KeyOperationAttestation.Builder builderForValue) { + if (attestationBuilder_ == null) { + attestation_ = builderForValue.build(); + onChanged(); + } else { + attestationBuilder_.setMessage(builderForValue.build()); + } + + return this; } /** *
-     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
      * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public Builder setState(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeAttestation(com.google.cloud.kms.v1.KeyOperationAttestation value) { + if (attestationBuilder_ == null) { + if (attestation_ != null) { + attestation_ = + com.google.cloud.kms.v1.KeyOperationAttestation.newBuilder(attestation_).mergeFrom(value).buildPartial(); + } else { + attestation_ = value; + } + onChanged(); + } else { + attestationBuilder_.mergeFrom(value); } - - state_ = value.getNumber(); - onChanged(); + return this; } /** *
-     * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
      * 
* - * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3; + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; */ - public Builder clearState() { + public Builder clearAttestation() { + if (attestationBuilder_ == null) { + attestation_ = null; + onChanged(); + } else { + attestation_ = null; + attestationBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + public com.google.cloud.kms.v1.KeyOperationAttestation.Builder getAttestationBuilder() { - state_ = 0; onChanged(); - return this; + return getAttestationFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + public com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder getAttestationOrBuilder() { + if (attestationBuilder_ != null) { + return attestationBuilder_.getMessageOrBuilder(); + } else { + return attestation_ == null ? + com.google.cloud.kms.v1.KeyOperationAttestation.getDefaultInstance() : attestation_; + } + } + /** + *
+     * Output only. Statement that was generated and signed by the HSM at key
+     * creation time. Use this statement to verify attributes of the key as stored
+     * on the HSM, independently of Google. Only provided for key versions with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.KeyOperationAttestation, com.google.cloud.kms.v1.KeyOperationAttestation.Builder, com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder> + getAttestationFieldBuilder() { + if (attestationBuilder_ == null) { + attestationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.kms.v1.KeyOperationAttestation, com.google.cloud.kms.v1.KeyOperationAttestation.Builder, com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder>( + getAttestation(), + getParentForChildren(), + isClean()); + attestation_ = null; + } + return attestationBuilder_; } private com.google.protobuf.Timestamp createTime_ = null; @@ -1233,6 +2286,168 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { return createTimeBuilder_; } + private com.google.protobuf.Timestamp generateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> generateTimeBuilder_; + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public boolean hasGenerateTime() { + return generateTimeBuilder_ != null || generateTime_ != null; + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public com.google.protobuf.Timestamp getGenerateTime() { + if (generateTimeBuilder_ == null) { + return generateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : generateTime_; + } else { + return generateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public Builder setGenerateTime(com.google.protobuf.Timestamp value) { + if (generateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + generateTime_ = value; + onChanged(); + } else { + generateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public Builder setGenerateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (generateTimeBuilder_ == null) { + generateTime_ = builderForValue.build(); + onChanged(); + } else { + generateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public Builder mergeGenerateTime(com.google.protobuf.Timestamp value) { + if (generateTimeBuilder_ == null) { + if (generateTime_ != null) { + generateTime_ = + com.google.protobuf.Timestamp.newBuilder(generateTime_).mergeFrom(value).buildPartial(); + } else { + generateTime_ = value; + } + onChanged(); + } else { + generateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public Builder clearGenerateTime() { + if (generateTimeBuilder_ == null) { + generateTime_ = null; + onChanged(); + } else { + generateTime_ = null; + generateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public com.google.protobuf.Timestamp.Builder getGenerateTimeBuilder() { + + onChanged(); + return getGenerateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getGenerateTimeOrBuilder() { + if (generateTimeBuilder_ != null) { + return generateTimeBuilder_.getMessageOrBuilder(); + } else { + return generateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : generateTime_; + } + } + /** + *
+     * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+     * generated.
+     * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getGenerateTimeFieldBuilder() { + if (generateTimeBuilder_ == null) { + generateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getGenerateTime(), + getParentForChildren(), + isClean()); + generateTime_ = null; + } + return generateTimeBuilder_; + } + private com.google.protobuf.Timestamp destroyTime_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> destroyTimeBuilder_; diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionOrBuilder.java index 15d97f920607..02269a2ed683 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionOrBuilder.java @@ -44,6 +44,78 @@ public interface CryptoKeyVersionOrBuilder extends */ com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState(); + /** + *
+   * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+   * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + int getProtectionLevelValue(); + /** + *
+   * Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are
+   * performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 7; + */ + com.google.cloud.kms.v1.ProtectionLevel getProtectionLevel(); + + /** + *
+   * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+   * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; + */ + int getAlgorithmValue(); + /** + *
+   * Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this
+   * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 10; + */ + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm(); + + /** + *
+   * Output only. Statement that was generated and signed by the HSM at key
+   * creation time. Use this statement to verify attributes of the key as stored
+   * on the HSM, independently of Google. Only provided for key versions with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + boolean hasAttestation(); + /** + *
+   * Output only. Statement that was generated and signed by the HSM at key
+   * creation time. Use this statement to verify attributes of the key as stored
+   * on the HSM, independently of Google. Only provided for key versions with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + com.google.cloud.kms.v1.KeyOperationAttestation getAttestation(); + /** + *
+   * Output only. Statement that was generated and signed by the HSM at key
+   * creation time. Use this statement to verify attributes of the key as stored
+   * on the HSM, independently of Google. Only provided for key versions with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation attestation = 8; + */ + com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder getAttestationOrBuilder(); + /** *
    * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created.
@@ -69,6 +141,34 @@ public interface CryptoKeyVersionOrBuilder extends
    */
   com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();
 
+  /**
+   * 
+   * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+   * generated.
+   * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + boolean hasGenerateTime(); + /** + *
+   * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+   * generated.
+   * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + com.google.protobuf.Timestamp getGenerateTime(); + /** + *
+   * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was
+   * generated.
+   * 
+ * + * .google.protobuf.Timestamp generate_time = 11; + */ + com.google.protobuf.TimestampOrBuilder getGenerateTimeOrBuilder(); + /** *
    * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionTemplate.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionTemplate.java
new file mode 100644
index 000000000000..338753895967
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionTemplate.java
@@ -0,0 +1,689 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/cloud/kms/v1/resources.proto
+
+package com.google.cloud.kms.v1;
+
+/**
+ * 
+ * A [CryptoKeyVersionTemplate][google.cloud.kms.v1.CryptoKeyVersionTemplate] specifies the properties to use when creating
+ * a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], either manually with
+ * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+ * automatically as a result of auto-rotation.
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.CryptoKeyVersionTemplate} + */ +public final class CryptoKeyVersionTemplate extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CryptoKeyVersionTemplate) + CryptoKeyVersionTemplateOrBuilder { +private static final long serialVersionUID = 0L; + // Use CryptoKeyVersionTemplate.newBuilder() to construct. + private CryptoKeyVersionTemplate(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CryptoKeyVersionTemplate() { + protectionLevel_ = 0; + algorithm_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CryptoKeyVersionTemplate( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + protectionLevel_ = rawValue; + break; + } + case 24: { + int rawValue = input.readEnum(); + + algorithm_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.CryptoKeyVersionTemplate.class, com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder.class); + } + + public static final int PROTECTION_LEVEL_FIELD_NUMBER = 1; + private int protectionLevel_; + /** + *
+   * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+   * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public int getProtectionLevelValue() { + return protectionLevel_; + } + /** + *
+   * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+   * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public com.google.cloud.kms.v1.ProtectionLevel getProtectionLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.ProtectionLevel result = com.google.cloud.kms.v1.ProtectionLevel.valueOf(protectionLevel_); + return result == null ? com.google.cloud.kms.v1.ProtectionLevel.UNRECOGNIZED : result; + } + + public static final int ALGORITHM_FIELD_NUMBER = 3; + private int algorithm_; + /** + *
+   * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+   * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+   * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+   * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+   * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public int getAlgorithmValue() { + return algorithm_; + } + /** + *
+   * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+   * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+   * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+   * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+   * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.valueOf(algorithm_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.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 (protectionLevel_ != com.google.cloud.kms.v1.ProtectionLevel.PROTECTION_LEVEL_UNSPECIFIED.getNumber()) { + output.writeEnum(1, protectionLevel_); + } + if (algorithm_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED.getNumber()) { + output.writeEnum(3, algorithm_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (protectionLevel_ != com.google.cloud.kms.v1.ProtectionLevel.PROTECTION_LEVEL_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, protectionLevel_); + } + if (algorithm_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, algorithm_); + } + size += unknownFields.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.kms.v1.CryptoKeyVersionTemplate)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.CryptoKeyVersionTemplate other = (com.google.cloud.kms.v1.CryptoKeyVersionTemplate) obj; + + boolean result = true; + result = result && protectionLevel_ == other.protectionLevel_; + result = result && algorithm_ == other.algorithm_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROTECTION_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + protectionLevel_; + hash = (37 * hash) + ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + algorithm_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate 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.kms.v1.CryptoKeyVersionTemplate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate 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.kms.v1.CryptoKeyVersionTemplate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate 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.kms.v1.CryptoKeyVersionTemplate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate 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.kms.v1.CryptoKeyVersionTemplate parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate 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.kms.v1.CryptoKeyVersionTemplate 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; + } + /** + *
+   * A [CryptoKeyVersionTemplate][google.cloud.kms.v1.CryptoKeyVersionTemplate] specifies the properties to use when creating
+   * a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], either manually with
+   * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or
+   * automatically as a result of auto-rotation.
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.CryptoKeyVersionTemplate} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.CryptoKeyVersionTemplate) + com.google.cloud.kms.v1.CryptoKeyVersionTemplateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.CryptoKeyVersionTemplate.class, com.google.cloud.kms.v1.CryptoKeyVersionTemplate.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.CryptoKeyVersionTemplate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + protectionLevel_ = 0; + + algorithm_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.CryptoKeyVersionTemplate getDefaultInstanceForType() { + return com.google.cloud.kms.v1.CryptoKeyVersionTemplate.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.CryptoKeyVersionTemplate build() { + com.google.cloud.kms.v1.CryptoKeyVersionTemplate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.CryptoKeyVersionTemplate buildPartial() { + com.google.cloud.kms.v1.CryptoKeyVersionTemplate result = new com.google.cloud.kms.v1.CryptoKeyVersionTemplate(this); + result.protectionLevel_ = protectionLevel_; + result.algorithm_ = algorithm_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.CryptoKeyVersionTemplate) { + return mergeFrom((com.google.cloud.kms.v1.CryptoKeyVersionTemplate)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.CryptoKeyVersionTemplate other) { + if (other == com.google.cloud.kms.v1.CryptoKeyVersionTemplate.getDefaultInstance()) return this; + if (other.protectionLevel_ != 0) { + setProtectionLevelValue(other.getProtectionLevelValue()); + } + if (other.algorithm_ != 0) { + setAlgorithmValue(other.getAlgorithmValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.CryptoKeyVersionTemplate parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.CryptoKeyVersionTemplate) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int protectionLevel_ = 0; + /** + *
+     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+     * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public int getProtectionLevelValue() { + return protectionLevel_; + } + /** + *
+     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+     * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public Builder setProtectionLevelValue(int value) { + protectionLevel_ = value; + onChanged(); + return this; + } + /** + *
+     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+     * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public com.google.cloud.kms.v1.ProtectionLevel getProtectionLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.ProtectionLevel result = com.google.cloud.kms.v1.ProtectionLevel.valueOf(protectionLevel_); + return result == null ? com.google.cloud.kms.v1.ProtectionLevel.UNRECOGNIZED : result; + } + /** + *
+     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+     * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public Builder setProtectionLevel(com.google.cloud.kms.v1.ProtectionLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + protectionLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+     * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+     * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + public Builder clearProtectionLevel() { + + protectionLevel_ = 0; + onChanged(); + return this; + } + + private int algorithm_ = 0; + /** + *
+     * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+     * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+     * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public int getAlgorithmValue() { + return algorithm_; + } + /** + *
+     * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+     * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+     * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public Builder setAlgorithmValue(int value) { + algorithm_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+     * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+     * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.valueOf(algorithm_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.UNRECOGNIZED : result; + } + /** + *
+     * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+     * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+     * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public Builder setAlgorithm(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm value) { + if (value == null) { + throw new NullPointerException(); + } + + algorithm_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+     * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+     * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+     * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+     * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + public Builder clearAlgorithm() { + + algorithm_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.CryptoKeyVersionTemplate) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.CryptoKeyVersionTemplate) + private static final com.google.cloud.kms.v1.CryptoKeyVersionTemplate DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.CryptoKeyVersionTemplate(); + } + + public static com.google.cloud.kms.v1.CryptoKeyVersionTemplate getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CryptoKeyVersionTemplate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CryptoKeyVersionTemplate(input, extensionRegistry); + } + }; + + 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.kms.v1.CryptoKeyVersionTemplate getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionTemplateOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionTemplateOrBuilder.java new file mode 100644 index 000000000000..a1a6ff1d4e16 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyVersionTemplateOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/resources.proto + +package com.google.cloud.kms.v1; + +public interface CryptoKeyVersionTemplateOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.CryptoKeyVersionTemplate) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+   * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + int getProtectionLevelValue(); + /** + *
+   * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on
+   * this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE].
+   * 
+ * + * .google.cloud.kms.v1.ProtectionLevel protection_level = 1; + */ + com.google.cloud.kms.v1.ProtectionLevel getProtectionLevel(); + + /** + *
+   * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+   * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+   * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+   * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+   * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + int getAlgorithmValue(); + /** + *
+   * Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use
+   * when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template.
+   * For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both
+   * this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is
+   * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; + */ + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/Digest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/Digest.java new file mode 100644 index 000000000000..c4c97b9c45de --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/Digest.java @@ -0,0 +1,763 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * A [Digest][google.cloud.kms.v1.Digest] holds a cryptographic message digest.
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.Digest} + */ +public final class Digest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.Digest) + DigestOrBuilder { +private static final long serialVersionUID = 0L; + // Use Digest.newBuilder() to construct. + private Digest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Digest() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Digest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + digestCase_ = 1; + digest_ = input.readBytes(); + break; + } + case 18: { + digestCase_ = 2; + digest_ = input.readBytes(); + break; + } + case 26: { + digestCase_ = 3; + digest_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_Digest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_Digest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.Digest.class, com.google.cloud.kms.v1.Digest.Builder.class); + } + + private int digestCase_ = 0; + private java.lang.Object digest_; + public enum DigestCase + implements com.google.protobuf.Internal.EnumLite { + SHA256(1), + SHA384(2), + SHA512(3), + DIGEST_NOT_SET(0); + private final int value; + private DigestCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DigestCase valueOf(int value) { + return forNumber(value); + } + + public static DigestCase forNumber(int value) { + switch (value) { + case 1: return SHA256; + case 2: return SHA384; + case 3: return SHA512; + case 0: return DIGEST_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public DigestCase + getDigestCase() { + return DigestCase.forNumber( + digestCase_); + } + + public static final int SHA256_FIELD_NUMBER = 1; + /** + *
+   * A message digest produced with the SHA-256 algorithm.
+   * 
+ * + * bytes sha256 = 1; + */ + public com.google.protobuf.ByteString getSha256() { + if (digestCase_ == 1) { + return (com.google.protobuf.ByteString) digest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int SHA384_FIELD_NUMBER = 2; + /** + *
+   * A message digest produced with the SHA-384 algorithm.
+   * 
+ * + * bytes sha384 = 2; + */ + public com.google.protobuf.ByteString getSha384() { + if (digestCase_ == 2) { + return (com.google.protobuf.ByteString) digest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int SHA512_FIELD_NUMBER = 3; + /** + *
+   * A message digest produced with the SHA-512 algorithm.
+   * 
+ * + * bytes sha512 = 3; + */ + public com.google.protobuf.ByteString getSha512() { + if (digestCase_ == 3) { + return (com.google.protobuf.ByteString) digest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + 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 (digestCase_ == 1) { + output.writeBytes( + 1, (com.google.protobuf.ByteString) digest_); + } + if (digestCase_ == 2) { + output.writeBytes( + 2, (com.google.protobuf.ByteString) digest_); + } + if (digestCase_ == 3) { + output.writeBytes( + 3, (com.google.protobuf.ByteString) digest_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (digestCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 1, (com.google.protobuf.ByteString) digest_); + } + if (digestCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 2, (com.google.protobuf.ByteString) digest_); + } + if (digestCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 3, (com.google.protobuf.ByteString) digest_); + } + size += unknownFields.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.kms.v1.Digest)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.Digest other = (com.google.cloud.kms.v1.Digest) obj; + + boolean result = true; + result = result && getDigestCase().equals( + other.getDigestCase()); + if (!result) return false; + switch (digestCase_) { + case 1: + result = result && getSha256() + .equals(other.getSha256()); + break; + case 2: + result = result && getSha384() + .equals(other.getSha384()); + break; + case 3: + result = result && getSha512() + .equals(other.getSha512()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (digestCase_) { + case 1: + hash = (37 * hash) + SHA256_FIELD_NUMBER; + hash = (53 * hash) + getSha256().hashCode(); + break; + case 2: + hash = (37 * hash) + SHA384_FIELD_NUMBER; + hash = (53 * hash) + getSha384().hashCode(); + break; + case 3: + hash = (37 * hash) + SHA512_FIELD_NUMBER; + hash = (53 * hash) + getSha512().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.Digest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.Digest 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.kms.v1.Digest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.Digest 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.kms.v1.Digest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.Digest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.Digest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.Digest 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.kms.v1.Digest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.Digest 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.kms.v1.Digest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.Digest 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.kms.v1.Digest 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; + } + /** + *
+   * A [Digest][google.cloud.kms.v1.Digest] holds a cryptographic message digest.
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.Digest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.Digest) + com.google.cloud.kms.v1.DigestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_Digest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_Digest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.Digest.class, com.google.cloud.kms.v1.Digest.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.Digest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + digestCase_ = 0; + digest_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_Digest_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.Digest getDefaultInstanceForType() { + return com.google.cloud.kms.v1.Digest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.Digest build() { + com.google.cloud.kms.v1.Digest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.Digest buildPartial() { + com.google.cloud.kms.v1.Digest result = new com.google.cloud.kms.v1.Digest(this); + if (digestCase_ == 1) { + result.digest_ = digest_; + } + if (digestCase_ == 2) { + result.digest_ = digest_; + } + if (digestCase_ == 3) { + result.digest_ = digest_; + } + result.digestCase_ = digestCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.Digest) { + return mergeFrom((com.google.cloud.kms.v1.Digest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.Digest other) { + if (other == com.google.cloud.kms.v1.Digest.getDefaultInstance()) return this; + switch (other.getDigestCase()) { + case SHA256: { + setSha256(other.getSha256()); + break; + } + case SHA384: { + setSha384(other.getSha384()); + break; + } + case SHA512: { + setSha512(other.getSha512()); + break; + } + case DIGEST_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.Digest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.Digest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int digestCase_ = 0; + private java.lang.Object digest_; + public DigestCase + getDigestCase() { + return DigestCase.forNumber( + digestCase_); + } + + public Builder clearDigest() { + digestCase_ = 0; + digest_ = null; + onChanged(); + return this; + } + + + /** + *
+     * A message digest produced with the SHA-256 algorithm.
+     * 
+ * + * bytes sha256 = 1; + */ + public com.google.protobuf.ByteString getSha256() { + if (digestCase_ == 1) { + return (com.google.protobuf.ByteString) digest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * A message digest produced with the SHA-256 algorithm.
+     * 
+ * + * bytes sha256 = 1; + */ + public Builder setSha256(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + digestCase_ = 1; + digest_ = value; + onChanged(); + return this; + } + /** + *
+     * A message digest produced with the SHA-256 algorithm.
+     * 
+ * + * bytes sha256 = 1; + */ + public Builder clearSha256() { + if (digestCase_ == 1) { + digestCase_ = 0; + digest_ = null; + onChanged(); + } + return this; + } + + /** + *
+     * A message digest produced with the SHA-384 algorithm.
+     * 
+ * + * bytes sha384 = 2; + */ + public com.google.protobuf.ByteString getSha384() { + if (digestCase_ == 2) { + return (com.google.protobuf.ByteString) digest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * A message digest produced with the SHA-384 algorithm.
+     * 
+ * + * bytes sha384 = 2; + */ + public Builder setSha384(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + digestCase_ = 2; + digest_ = value; + onChanged(); + return this; + } + /** + *
+     * A message digest produced with the SHA-384 algorithm.
+     * 
+ * + * bytes sha384 = 2; + */ + public Builder clearSha384() { + if (digestCase_ == 2) { + digestCase_ = 0; + digest_ = null; + onChanged(); + } + return this; + } + + /** + *
+     * A message digest produced with the SHA-512 algorithm.
+     * 
+ * + * bytes sha512 = 3; + */ + public com.google.protobuf.ByteString getSha512() { + if (digestCase_ == 3) { + return (com.google.protobuf.ByteString) digest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * A message digest produced with the SHA-512 algorithm.
+     * 
+ * + * bytes sha512 = 3; + */ + public Builder setSha512(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + digestCase_ = 3; + digest_ = value; + onChanged(); + return this; + } + /** + *
+     * A message digest produced with the SHA-512 algorithm.
+     * 
+ * + * bytes sha512 = 3; + */ + public Builder clearSha512() { + if (digestCase_ == 3) { + digestCase_ = 0; + digest_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.Digest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.Digest) + private static final com.google.cloud.kms.v1.Digest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.Digest(); + } + + public static com.google.cloud.kms.v1.Digest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Digest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Digest(input, extensionRegistry); + } + }; + + 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.kms.v1.Digest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DigestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DigestOrBuilder.java new file mode 100644 index 000000000000..15fc745262ee --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DigestOrBuilder.java @@ -0,0 +1,38 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface DigestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.Digest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A message digest produced with the SHA-256 algorithm.
+   * 
+ * + * bytes sha256 = 1; + */ + com.google.protobuf.ByteString getSha256(); + + /** + *
+   * A message digest produced with the SHA-384 algorithm.
+   * 
+ * + * bytes sha384 = 2; + */ + com.google.protobuf.ByteString getSha384(); + + /** + *
+   * A message digest produced with the SHA-512 algorithm.
+   * 
+ * + * bytes sha512 = 3; + */ + com.google.protobuf.ByteString getSha512(); + + public com.google.cloud.kms.v1.Digest.DigestCase getDigestCase(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequest.java index b6a8a6c4b51a..9975ed19c1c5 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequest.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequest.java @@ -150,6 +150,12 @@ public java.lang.String getName() { /** *
    * Required. The data to encrypt. Must be no larger than 64KiB.
+   * The maximum size depends on the key version's
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+   * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger
+   * than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+   * plaintext and additional_authenticated_data fields must be no larger than
+   * 8KiB.
    * 
* * bytes plaintext = 2; @@ -163,8 +169,13 @@ public com.google.protobuf.ByteString getPlaintext() { /** *
    * Optional data that, if specified, must also be provided during decryption
-   * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].  Must be no
-   * larger than 64KiB.
+   * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
+   * The maximum size depends on the key version's
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+   * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than
+   * 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+   * plaintext and additional_authenticated_data fields must be no larger than
+   * 8KiB.
    * 
* * bytes additional_authenticated_data = 3; @@ -622,6 +633,12 @@ public Builder setNameBytes( /** *
      * Required. The data to encrypt. Must be no larger than 64KiB.
+     * The maximum size depends on the key version's
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger
+     * than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+     * plaintext and additional_authenticated_data fields must be no larger than
+     * 8KiB.
      * 
* * bytes plaintext = 2; @@ -632,6 +649,12 @@ public com.google.protobuf.ByteString getPlaintext() { /** *
      * Required. The data to encrypt. Must be no larger than 64KiB.
+     * The maximum size depends on the key version's
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger
+     * than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+     * plaintext and additional_authenticated_data fields must be no larger than
+     * 8KiB.
      * 
* * bytes plaintext = 2; @@ -648,6 +671,12 @@ public Builder setPlaintext(com.google.protobuf.ByteString value) { /** *
      * Required. The data to encrypt. Must be no larger than 64KiB.
+     * The maximum size depends on the key version's
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger
+     * than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+     * plaintext and additional_authenticated_data fields must be no larger than
+     * 8KiB.
      * 
* * bytes plaintext = 2; @@ -663,8 +692,13 @@ public Builder clearPlaintext() { /** *
      * Optional data that, if specified, must also be provided during decryption
-     * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].  Must be no
-     * larger than 64KiB.
+     * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
+     * The maximum size depends on the key version's
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than
+     * 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+     * plaintext and additional_authenticated_data fields must be no larger than
+     * 8KiB.
      * 
* * bytes additional_authenticated_data = 3; @@ -675,8 +709,13 @@ public com.google.protobuf.ByteString getAdditionalAuthenticatedData() { /** *
      * Optional data that, if specified, must also be provided during decryption
-     * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].  Must be no
-     * larger than 64KiB.
+     * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
+     * The maximum size depends on the key version's
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than
+     * 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+     * plaintext and additional_authenticated_data fields must be no larger than
+     * 8KiB.
      * 
* * bytes additional_authenticated_data = 3; @@ -693,8 +732,13 @@ public Builder setAdditionalAuthenticatedData(com.google.protobuf.ByteString val /** *
      * Optional data that, if specified, must also be provided during decryption
-     * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].  Must be no
-     * larger than 64KiB.
+     * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
+     * The maximum size depends on the key version's
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+     * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than
+     * 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+     * plaintext and additional_authenticated_data fields must be no larger than
+     * 8KiB.
      * 
* * bytes additional_authenticated_data = 3; diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequestOrBuilder.java index 22e3c758b5c2..aed92c3e7487 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequestOrBuilder.java @@ -34,6 +34,12 @@ public interface EncryptRequestOrBuilder extends /** *
    * Required. The data to encrypt. Must be no larger than 64KiB.
+   * The maximum size depends on the key version's
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+   * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger
+   * than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+   * plaintext and additional_authenticated_data fields must be no larger than
+   * 8KiB.
    * 
* * bytes plaintext = 2; @@ -43,8 +49,13 @@ public interface EncryptRequestOrBuilder extends /** *
    * Optional data that, if specified, must also be provided during decryption
-   * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].  Must be no
-   * larger than 64KiB.
+   * through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
+   * The maximum size depends on the key version's
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For
+   * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than
+   * 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the
+   * plaintext and additional_authenticated_data fields must be no larger than
+   * 8KiB.
    * 
* * bytes additional_authenticated_data = 3; diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/GetPublicKeyRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/GetPublicKeyRequest.java new file mode 100644 index 000000000000..27a6d1838877 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/GetPublicKeyRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * Request message for [KeyManagementService.GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.GetPublicKeyRequest} + */ +public final class GetPublicKeyRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.GetPublicKeyRequest) + GetPublicKeyRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetPublicKeyRequest.newBuilder() to construct. + private GetPublicKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetPublicKeyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetPublicKeyRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_GetPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_GetPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.GetPublicKeyRequest.class, com.google.cloud.kms.v1.GetPublicKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+   * get.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+   * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+   * get.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.kms.v1.GetPublicKeyRequest)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.GetPublicKeyRequest other = (com.google.cloud.kms.v1.GetPublicKeyRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.GetPublicKeyRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest 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.kms.v1.GetPublicKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest 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.kms.v1.GetPublicKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest 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.kms.v1.GetPublicKeyRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest 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.kms.v1.GetPublicKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.GetPublicKeyRequest 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.kms.v1.GetPublicKeyRequest 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; + } + /** + *
+   * Request message for [KeyManagementService.GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.GetPublicKeyRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.GetPublicKeyRequest) + com.google.cloud.kms.v1.GetPublicKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_GetPublicKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_GetPublicKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.GetPublicKeyRequest.class, com.google.cloud.kms.v1.GetPublicKeyRequest.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.GetPublicKeyRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_GetPublicKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.GetPublicKeyRequest getDefaultInstanceForType() { + return com.google.cloud.kms.v1.GetPublicKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.GetPublicKeyRequest build() { + com.google.cloud.kms.v1.GetPublicKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.GetPublicKeyRequest buildPartial() { + com.google.cloud.kms.v1.GetPublicKeyRequest result = new com.google.cloud.kms.v1.GetPublicKeyRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.GetPublicKeyRequest) { + return mergeFrom((com.google.cloud.kms.v1.GetPublicKeyRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.GetPublicKeyRequest other) { + if (other == com.google.cloud.kms.v1.GetPublicKeyRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.GetPublicKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.GetPublicKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+     * get.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+     * get.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+     * get.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+     * get.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+     * get.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.GetPublicKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.GetPublicKeyRequest) + private static final com.google.cloud.kms.v1.GetPublicKeyRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.GetPublicKeyRequest(); + } + + public static com.google.cloud.kms.v1.GetPublicKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPublicKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetPublicKeyRequest(input, extensionRegistry); + } + }; + + 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.kms.v1.GetPublicKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/GetPublicKeyRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/GetPublicKeyRequestOrBuilder.java new file mode 100644 index 000000000000..9f9e10784a8d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/GetPublicKeyRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface GetPublicKeyRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.GetPublicKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+   * get.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to
+   * get.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyOperationAttestation.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyOperationAttestation.java new file mode 100644 index 000000000000..3c04c08a79bb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyOperationAttestation.java @@ -0,0 +1,728 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/resources.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * Contains an HSM-generated attestation about a key operation.
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.KeyOperationAttestation} + */ +public final class KeyOperationAttestation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.KeyOperationAttestation) + KeyOperationAttestationOrBuilder { +private static final long serialVersionUID = 0L; + // Use KeyOperationAttestation.newBuilder() to construct. + private KeyOperationAttestation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private KeyOperationAttestation() { + format_ = 0; + content_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private KeyOperationAttestation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 32: { + int rawValue = input.readEnum(); + + format_ = rawValue; + break; + } + case 42: { + + content_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_KeyOperationAttestation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_KeyOperationAttestation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.KeyOperationAttestation.class, com.google.cloud.kms.v1.KeyOperationAttestation.Builder.class); + } + + /** + *
+   * Attestion formats provided by the HSM.
+   * 
+ * + * Protobuf enum {@code google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat} + */ + public enum AttestationFormat + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ATTESTATION_FORMAT_UNSPECIFIED = 0; + */ + ATTESTATION_FORMAT_UNSPECIFIED(0), + /** + *
+     * Cavium HSM attestation compressed with gzip. Note that this format is
+     * defined by Cavium and subject to change at any time.
+     * 
+ * + * CAVIUM_V1_COMPRESSED = 3; + */ + CAVIUM_V1_COMPRESSED(3), + UNRECOGNIZED(-1), + ; + + /** + * ATTESTATION_FORMAT_UNSPECIFIED = 0; + */ + public static final int ATTESTATION_FORMAT_UNSPECIFIED_VALUE = 0; + /** + *
+     * Cavium HSM attestation compressed with gzip. Note that this format is
+     * defined by Cavium and subject to change at any time.
+     * 
+ * + * CAVIUM_V1_COMPRESSED = 3; + */ + public static final int CAVIUM_V1_COMPRESSED_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; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AttestationFormat valueOf(int value) { + return forNumber(value); + } + + public static AttestationFormat forNumber(int value) { + switch (value) { + case 0: return ATTESTATION_FORMAT_UNSPECIFIED; + case 3: return CAVIUM_V1_COMPRESSED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AttestationFormat> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AttestationFormat findValueByNumber(int number) { + return AttestationFormat.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + 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.kms.v1.KeyOperationAttestation.getDescriptor().getEnumTypes().get(0); + } + + private static final AttestationFormat[] VALUES = values(); + + public static AttestationFormat 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 AttestationFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat) + } + + public static final int FORMAT_FIELD_NUMBER = 4; + private int format_; + /** + *
+   * Output only. The format of the attestation data.
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public int getFormatValue() { + return format_; + } + /** + *
+   * Output only. The format of the attestation data.
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat getFormat() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat result = com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat.valueOf(format_); + return result == null ? com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat.UNRECOGNIZED : result; + } + + public static final int CONTENT_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString content_; + /** + *
+   * Output only. The attestation data provided by the HSM when the key
+   * operation was performed.
+   * 
+ * + * bytes content = 5; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + + 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 (format_ != com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat.ATTESTATION_FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(4, format_); + } + if (!content_.isEmpty()) { + output.writeBytes(5, content_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (format_ != com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat.ATTESTATION_FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, format_); + } + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, content_); + } + size += unknownFields.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.kms.v1.KeyOperationAttestation)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.KeyOperationAttestation other = (com.google.cloud.kms.v1.KeyOperationAttestation) obj; + + boolean result = true; + result = result && format_ == other.format_; + result = result && getContent() + .equals(other.getContent()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.KeyOperationAttestation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation 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.kms.v1.KeyOperationAttestation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation 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.kms.v1.KeyOperationAttestation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation 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.kms.v1.KeyOperationAttestation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation 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.kms.v1.KeyOperationAttestation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.KeyOperationAttestation 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.kms.v1.KeyOperationAttestation 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; + } + /** + *
+   * Contains an HSM-generated attestation about a key operation.
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.KeyOperationAttestation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.KeyOperationAttestation) + com.google.cloud.kms.v1.KeyOperationAttestationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_KeyOperationAttestation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_KeyOperationAttestation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.KeyOperationAttestation.class, com.google.cloud.kms.v1.KeyOperationAttestation.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.KeyOperationAttestation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + format_ = 0; + + content_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_KeyOperationAttestation_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.KeyOperationAttestation getDefaultInstanceForType() { + return com.google.cloud.kms.v1.KeyOperationAttestation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.KeyOperationAttestation build() { + com.google.cloud.kms.v1.KeyOperationAttestation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.KeyOperationAttestation buildPartial() { + com.google.cloud.kms.v1.KeyOperationAttestation result = new com.google.cloud.kms.v1.KeyOperationAttestation(this); + result.format_ = format_; + result.content_ = content_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.KeyOperationAttestation) { + return mergeFrom((com.google.cloud.kms.v1.KeyOperationAttestation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.KeyOperationAttestation other) { + if (other == com.google.cloud.kms.v1.KeyOperationAttestation.getDefaultInstance()) return this; + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.KeyOperationAttestation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.KeyOperationAttestation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int format_ = 0; + /** + *
+     * Output only. The format of the attestation data.
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public int getFormatValue() { + return format_; + } + /** + *
+     * Output only. The format of the attestation data.
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public Builder setFormatValue(int value) { + format_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The format of the attestation data.
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat getFormat() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat result = com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat.valueOf(format_); + return result == null ? com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The format of the attestation data.
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public Builder setFormat(com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat value) { + if (value == null) { + throw new NullPointerException(); + } + + format_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. The format of the attestation data.
+     * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + public Builder clearFormat() { + + format_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * Output only. The attestation data provided by the HSM when the key
+     * operation was performed.
+     * 
+ * + * bytes content = 5; + */ + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + *
+     * Output only. The attestation data provided by the HSM when the key
+     * operation was performed.
+     * 
+ * + * bytes content = 5; + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The attestation data provided by the HSM when the key
+     * operation was performed.
+     * 
+ * + * bytes content = 5; + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.KeyOperationAttestation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.KeyOperationAttestation) + private static final com.google.cloud.kms.v1.KeyOperationAttestation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.KeyOperationAttestation(); + } + + public static com.google.cloud.kms.v1.KeyOperationAttestation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public KeyOperationAttestation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new KeyOperationAttestation(input, extensionRegistry); + } + }; + + 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.kms.v1.KeyOperationAttestation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyOperationAttestationOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyOperationAttestationOrBuilder.java new file mode 100644 index 000000000000..e24814438b26 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KeyOperationAttestationOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/resources.proto + +package com.google.cloud.kms.v1; + +public interface KeyOperationAttestationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.KeyOperationAttestation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. The format of the attestation data.
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + int getFormatValue(); + /** + *
+   * Output only. The format of the attestation data.
+   * 
+ * + * .google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4; + */ + com.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat getFormat(); + + /** + *
+   * Output only. The attestation data provided by the HSM when the key
+   * operation was performed.
+   * 
+ * + * bytes content = 5; + */ + com.google.protobuf.ByteString getContent(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsProto.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsProto.java index eebfe668bc7f..aa4c2cd54af4 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsProto.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsProto.java @@ -59,6 +59,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_kms_v1_GetCryptoKeyVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_GetPublicKeyRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_GetPublicKeyRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor; static final @@ -94,6 +99,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_kms_v1_DecryptRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_AsymmetricSignRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_AsymmetricSignRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_kms_v1_DecryptResponse_descriptor; static final @@ -104,6 +119,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_kms_v1_EncryptResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_AsymmetricSignResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_AsymmetricSignResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_kms_v1_UpdateCryptoKeyPrimaryVersionRequest_descriptor; static final @@ -119,6 +144,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_kms_v1_RestoreCryptoKeyVersionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_Digest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_Digest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_LocationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_LocationMetadata_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -135,130 +170,160 @@ public static void registerAllExtensions( "oogle/protobuf/struct.proto\032\036google/prot" + "obuf/wrappers.proto\"L\n\023ListKeyRingsReque" + "st\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n" + - "\npage_token\030\003 \001(\t\"N\n\025ListCryptoKeysReque" + - "st\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n" + - "\npage_token\030\003 \001(\t\"U\n\034ListCryptoKeyVersio" + - "nsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002" + - " \001(\005\022\022\n\npage_token\030\003 \001(\t\"t\n\024ListKeyRings" + - "Response\022/\n\tkey_rings\030\001 \003(\0132\034.google.clo" + - "ud.kms.v1.KeyRing\022\027\n\017next_page_token\030\002 \001" + - "(\t\022\022\n\ntotal_size\030\003 \001(\005\"z\n\026ListCryptoKeys" + - "Response\0223\n\013crypto_keys\030\001 \003(\0132\036.google.c" + - "loud.kms.v1.CryptoKey\022\027\n\017next_page_token" + - "\030\002 \001(\t\022\022\n\ntotal_size\030\003 \001(\005\"\220\001\n\035ListCrypt" + - "oKeyVersionsResponse\022B\n\023crypto_key_versi" + - "ons\030\001 \003(\0132%.google.cloud.kms.v1.CryptoKe" + - "yVersion\022\027\n\017next_page_token\030\002 \001(\t\022\022\n\ntot" + - "al_size\030\003 \001(\005\"!\n\021GetKeyRingRequest\022\014\n\004na" + - "me\030\001 \001(\t\"#\n\023GetCryptoKeyRequest\022\014\n\004name\030" + - "\001 \001(\t\"*\n\032GetCryptoKeyVersionRequest\022\014\n\004n" + - "ame\030\001 \001(\t\"k\n\024CreateKeyRingRequest\022\016\n\006par" + - "ent\030\001 \001(\t\022\023\n\013key_ring_id\030\002 \001(\t\022.\n\010key_ri" + - "ng\030\003 \001(\0132\034.google.cloud.kms.v1.KeyRing\"s" + - "\n\026CreateCryptoKeyRequest\022\016\n\006parent\030\001 \001(\t" + - "\022\025\n\rcrypto_key_id\030\002 \001(\t\0222\n\ncrypto_key\030\003 " + - "\001(\0132\036.google.cloud.kms.v1.CryptoKey\"r\n\035C" + - "reateCryptoKeyVersionRequest\022\016\n\006parent\030\001" + - " \001(\t\022A\n\022crypto_key_version\030\002 \001(\0132%.googl" + - "e.cloud.kms.v1.CryptoKeyVersion\"}\n\026Updat" + - "eCryptoKeyRequest\0222\n\ncrypto_key\030\001 \001(\0132\036." + - "google.cloud.kms.v1.CryptoKey\022/\n\013update_" + - "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"\223" + - "\001\n\035UpdateCryptoKeyVersionRequest\022A\n\022cryp" + - "to_key_version\030\001 \001(\0132%.google.cloud.kms." + - "v1.CryptoKeyVersion\022/\n\013update_mask\030\002 \001(\013" + - "2\032.google.protobuf.FieldMask\"X\n\016EncryptR" + - "equest\022\014\n\004name\030\001 \001(\t\022\021\n\tplaintext\030\002 \001(\014\022" + - "%\n\035additional_authenticated_data\030\003 \001(\014\"Y" + - "\n\016DecryptRequest\022\014\n\004name\030\001 \001(\t\022\022\n\ncipher" + - "text\030\002 \001(\014\022%\n\035additional_authenticated_d" + - "ata\030\003 \001(\014\"$\n\017DecryptResponse\022\021\n\tplaintex" + - "t\030\001 \001(\014\"3\n\017EncryptResponse\022\014\n\004name\030\001 \001(\t" + - "\022\022\n\nciphertext\030\002 \001(\014\"S\n$UpdateCryptoKeyP" + - "rimaryVersionRequest\022\014\n\004name\030\001 \001(\t\022\035\n\025cr" + - "ypto_key_version_id\030\002 \001(\t\".\n\036DestroyCryp" + - "toKeyVersionRequest\022\014\n\004name\030\001 \001(\t\".\n\036Res" + - "toreCryptoKeyVersionRequest\022\014\n\004name\030\001 \001(" + - "\t2\333\027\n\024KeyManagementService\022\231\001\n\014ListKeyRi" + - "ngs\022(.google.cloud.kms.v1.ListKeyRingsRe" + - "quest\032).google.cloud.kms.v1.ListKeyRings" + - "Response\"4\202\323\344\223\002.\022,/v1/{parent=projects/*" + - "/locations/*}/keyRings\022\254\001\n\016ListCryptoKey" + - "s\022*.google.cloud.kms.v1.ListCryptoKeysRe" + - "quest\032+.google.cloud.kms.v1.ListCryptoKe" + - "ysResponse\"A\202\323\344\223\002;\0229/v1/{parent=projects" + - "/*/locations/*/keyRings/*}/cryptoKeys\022\325\001" + - "\n\025ListCryptoKeyVersions\0221.google.cloud.k" + - "ms.v1.ListCryptoKeyVersionsRequest\0322.goo" + - "gle.cloud.kms.v1.ListCryptoKeyVersionsRe" + - "sponse\"U\202\323\344\223\002O\022M/v1/{parent=projects/*/l" + - "ocations/*/keyRings/*/cryptoKeys/*}/cryp" + - "toKeyVersions\022\210\001\n\nGetKeyRing\022&.google.cl" + - "oud.kms.v1.GetKeyRingRequest\032\034.google.cl" + - "oud.kms.v1.KeyRing\"4\202\323\344\223\002.\022,/v1/{name=pr" + - "ojects/*/locations/*/keyRings/*}\022\233\001\n\014Get" + - "CryptoKey\022(.google.cloud.kms.v1.GetCrypt" + - "oKeyRequest\032\036.google.cloud.kms.v1.Crypto" + - "Key\"A\202\323\344\223\002;\0229/v1/{name=projects/*/locati" + - "ons/*/keyRings/*/cryptoKeys/*}\022\304\001\n\023GetCr" + - "yptoKeyVersion\022/.google.cloud.kms.v1.Get" + - "CryptoKeyVersionRequest\032%.google.cloud.k" + - "ms.v1.CryptoKeyVersion\"U\202\323\344\223\002O\022M/v1/{nam" + - "e=projects/*/locations/*/keyRings/*/cryp" + - "toKeys/*/cryptoKeyVersions/*}\022\230\001\n\rCreate" + - "KeyRing\022).google.cloud.kms.v1.CreateKeyR" + - "ingRequest\032\034.google.cloud.kms.v1.KeyRing" + - "\">\202\323\344\223\0028\",/v1/{parent=projects/*/locatio" + - "ns/*}/keyRings:\010key_ring\022\255\001\n\017CreateCrypt" + - "oKey\022+.google.cloud.kms.v1.CreateCryptoK" + - "eyRequest\032\036.google.cloud.kms.v1.CryptoKe" + - "y\"M\202\323\344\223\002G\"9/v1/{parent=projects/*/locati" + - "ons/*/keyRings/*}/cryptoKeys:\ncrypto_key" + - "\022\336\001\n\026CreateCryptoKeyVersion\0222.google.clo" + - "ud.kms.v1.CreateCryptoKeyVersionRequest\032" + - "%.google.cloud.kms.v1.CryptoKeyVersion\"i" + - "\202\323\344\223\002c\"M/v1/{parent=projects/*/locations" + - "/*/keyRings/*/cryptoKeys/*}/cryptoKeyVer" + - "sions:\022crypto_key_version\022\270\001\n\017UpdateCryp" + - "toKey\022+.google.cloud.kms.v1.UpdateCrypto" + - "KeyRequest\032\036.google.cloud.kms.v1.CryptoK" + - "ey\"X\202\323\344\223\002R2D/v1/{crypto_key.name=project" + - "s/*/locations/*/keyRings/*/cryptoKeys/*}" + - ":\ncrypto_key\022\361\001\n\026UpdateCryptoKeyVersion\022" + - "2.google.cloud.kms.v1.UpdateCryptoKeyVer" + - "sionRequest\032%.google.cloud.kms.v1.Crypto" + - "KeyVersion\"|\202\323\344\223\002v2`/v1/{crypto_key_vers" + - "ion.name=projects/*/locations/*/keyRings" + - "/*/cryptoKeys/*/cryptoKeyVersions/*}:\022cr" + - "ypto_key_version\022\243\001\n\007Encrypt\022#.google.cl" + - "oud.kms.v1.EncryptRequest\032$.google.cloud" + - ".kms.v1.EncryptResponse\"M\202\323\344\223\002G\"B/v1/{na" + - "me=projects/*/locations/*/keyRings/*/cry" + - "ptoKeys/**}:encrypt:\001*\022\242\001\n\007Decrypt\022#.goo" + - "gle.cloud.kms.v1.DecryptRequest\032$.google" + - ".cloud.kms.v1.DecryptResponse\"L\202\323\344\223\002F\"A/" + - "v1/{name=projects/*/locations/*/keyRings" + - "/*/cryptoKeys/*}:decrypt:\001*\022\325\001\n\035UpdateCr" + - "yptoKeyPrimaryVersion\0229.google.cloud.kms" + - ".v1.UpdateCryptoKeyPrimaryVersionRequest" + - "\032\036.google.cloud.kms.v1.CryptoKey\"Y\202\323\344\223\002S" + - "\"N/v1/{name=projects/*/locations/*/keyRi" + - "ngs/*/cryptoKeys/*}:updatePrimaryVersion" + - ":\001*\022\327\001\n\027DestroyCryptoKeyVersion\0223.google" + - ".cloud.kms.v1.DestroyCryptoKeyVersionReq" + - "uest\032%.google.cloud.kms.v1.CryptoKeyVers" + - "ion\"`\202\323\344\223\002Z\"U/v1/{name=projects/*/locati" + - "ons/*/keyRings/*/cryptoKeys/*/cryptoKeyV" + - "ersions/*}:destroy:\001*\022\327\001\n\027RestoreCryptoK" + - "eyVersion\0223.google.cloud.kms.v1.RestoreC" + - "ryptoKeyVersionRequest\032%.google.cloud.km" + - "s.v1.CryptoKeyVersion\"`\202\323\344\223\002Z\"U/v1/{name" + - "=projects/*/locations/*/keyRings/*/crypt" + - "oKeys/*/cryptoKeyVersions/*}:restore:\001*B" + - "\214\001\n\027com.google.cloud.kms.v1B\010KmsProtoP\001Z" + - "6google.golang.org/genproto/googleapis/c" + - "loud/kms/v1;kms\370\001\001\252\002\023Google.Cloud.Kms.V1" + - "\312\002\023Google\\Cloud\\Kms\\V1b\006proto3" + "\npage_token\030\003 \001(\t\"\240\001\n\025ListCryptoKeysRequ" + + "est\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022" + + "\n\npage_token\030\003 \001(\t\022P\n\014version_view\030\004 \001(\016" + + "2:.google.cloud.kms.v1.CryptoKeyVersion." + + "CryptoKeyVersionView\"\237\001\n\034ListCryptoKeyVe" + + "rsionsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_si" + + "ze\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022H\n\004view\030\004 \001" + + "(\0162:.google.cloud.kms.v1.CryptoKeyVersio" + + "n.CryptoKeyVersionView\"t\n\024ListKeyRingsRe" + + "sponse\022/\n\tkey_rings\030\001 \003(\0132\034.google.cloud" + + ".kms.v1.KeyRing\022\027\n\017next_page_token\030\002 \001(\t" + + "\022\022\n\ntotal_size\030\003 \001(\005\"z\n\026ListCryptoKeysRe" + + "sponse\0223\n\013crypto_keys\030\001 \003(\0132\036.google.clo" + + "ud.kms.v1.CryptoKey\022\027\n\017next_page_token\030\002" + + " \001(\t\022\022\n\ntotal_size\030\003 \001(\005\"\220\001\n\035ListCryptoK" + + "eyVersionsResponse\022B\n\023crypto_key_version" + + "s\030\001 \003(\0132%.google.cloud.kms.v1.CryptoKeyV" + + "ersion\022\027\n\017next_page_token\030\002 \001(\t\022\022\n\ntotal" + + "_size\030\003 \001(\005\"!\n\021GetKeyRingRequest\022\014\n\004name" + + "\030\001 \001(\t\"#\n\023GetCryptoKeyRequest\022\014\n\004name\030\001 " + + "\001(\t\"*\n\032GetCryptoKeyVersionRequest\022\014\n\004nam" + + "e\030\001 \001(\t\"#\n\023GetPublicKeyRequest\022\014\n\004name\030\001" + + " \001(\t\"k\n\024CreateKeyRingRequest\022\016\n\006parent\030\001" + + " \001(\t\022\023\n\013key_ring_id\030\002 \001(\t\022.\n\010key_ring\030\003 " + + "\001(\0132\034.google.cloud.kms.v1.KeyRing\"s\n\026Cre" + + "ateCryptoKeyRequest\022\016\n\006parent\030\001 \001(\t\022\025\n\rc" + + "rypto_key_id\030\002 \001(\t\0222\n\ncrypto_key\030\003 \001(\0132\036" + + ".google.cloud.kms.v1.CryptoKey\"r\n\035Create" + + "CryptoKeyVersionRequest\022\016\n\006parent\030\001 \001(\t\022" + + "A\n\022crypto_key_version\030\002 \001(\0132%.google.clo" + + "ud.kms.v1.CryptoKeyVersion\"}\n\026UpdateCryp" + + "toKeyRequest\0222\n\ncrypto_key\030\001 \001(\0132\036.googl" + + "e.cloud.kms.v1.CryptoKey\022/\n\013update_mask\030" + + "\002 \001(\0132\032.google.protobuf.FieldMask\"\223\001\n\035Up" + + "dateCryptoKeyVersionRequest\022A\n\022crypto_ke" + + "y_version\030\001 \001(\0132%.google.cloud.kms.v1.Cr" + + "yptoKeyVersion\022/\n\013update_mask\030\002 \001(\0132\032.go" + + "ogle.protobuf.FieldMask\"X\n\016EncryptReques" + + "t\022\014\n\004name\030\001 \001(\t\022\021\n\tplaintext\030\002 \001(\014\022%\n\035ad" + + "ditional_authenticated_data\030\003 \001(\014\"Y\n\016Dec" + + "ryptRequest\022\014\n\004name\030\001 \001(\t\022\022\n\nciphertext\030" + + "\002 \001(\014\022%\n\035additional_authenticated_data\030\003" + + " \001(\014\"R\n\025AsymmetricSignRequest\022\014\n\004name\030\001 " + + "\001(\t\022+\n\006digest\030\003 \001(\0132\033.google.cloud.kms.v" + + "1.Digest\"<\n\030AsymmetricDecryptRequest\022\014\n\004" + + "name\030\001 \001(\t\022\022\n\nciphertext\030\003 \001(\014\"$\n\017Decryp" + + "tResponse\022\021\n\tplaintext\030\001 \001(\014\"3\n\017EncryptR" + + "esponse\022\014\n\004name\030\001 \001(\t\022\022\n\nciphertext\030\002 \001(" + + "\014\"+\n\026AsymmetricSignResponse\022\021\n\tsignature" + + "\030\001 \001(\014\".\n\031AsymmetricDecryptResponse\022\021\n\tp" + + "laintext\030\001 \001(\014\"S\n$UpdateCryptoKeyPrimary" + + "VersionRequest\022\014\n\004name\030\001 \001(\t\022\035\n\025crypto_k" + + "ey_version_id\030\002 \001(\t\".\n\036DestroyCryptoKeyV" + + "ersionRequest\022\014\n\004name\030\001 \001(\t\".\n\036RestoreCr" + + "yptoKeyVersionRequest\022\014\n\004name\030\001 \001(\t\"H\n\006D" + + "igest\022\020\n\006sha256\030\001 \001(\014H\000\022\020\n\006sha384\030\002 \001(\014H" + + "\000\022\020\n\006sha512\030\003 \001(\014H\000B\010\n\006digest\")\n\020Locatio" + + "nMetadata\022\025\n\rhsm_available\030\001 \001(\0102\315\034\n\024Key" + + "ManagementService\022\231\001\n\014ListKeyRings\022(.goo" + + "gle.cloud.kms.v1.ListKeyRingsRequest\032).g" + + "oogle.cloud.kms.v1.ListKeyRingsResponse\"" + + "4\202\323\344\223\002.\022,/v1/{parent=projects/*/location" + + "s/*}/keyRings\022\254\001\n\016ListCryptoKeys\022*.googl" + + "e.cloud.kms.v1.ListCryptoKeysRequest\032+.g" + + "oogle.cloud.kms.v1.ListCryptoKeysRespons" + + "e\"A\202\323\344\223\002;\0229/v1/{parent=projects/*/locati" + + "ons/*/keyRings/*}/cryptoKeys\022\325\001\n\025ListCry" + + "ptoKeyVersions\0221.google.cloud.kms.v1.Lis" + + "tCryptoKeyVersionsRequest\0322.google.cloud" + + ".kms.v1.ListCryptoKeyVersionsResponse\"U\202" + + "\323\344\223\002O\022M/v1/{parent=projects/*/locations/" + + "*/keyRings/*/cryptoKeys/*}/cryptoKeyVers" + + "ions\022\210\001\n\nGetKeyRing\022&.google.cloud.kms.v" + + "1.GetKeyRingRequest\032\034.google.cloud.kms.v" + + "1.KeyRing\"4\202\323\344\223\002.\022,/v1/{name=projects/*/" + + "locations/*/keyRings/*}\022\233\001\n\014GetCryptoKey" + + "\022(.google.cloud.kms.v1.GetCryptoKeyReque" + + "st\032\036.google.cloud.kms.v1.CryptoKey\"A\202\323\344\223" + + "\002;\0229/v1/{name=projects/*/locations/*/key" + + "Rings/*/cryptoKeys/*}\022\304\001\n\023GetCryptoKeyVe" + + "rsion\022/.google.cloud.kms.v1.GetCryptoKey" + + "VersionRequest\032%.google.cloud.kms.v1.Cry" + + "ptoKeyVersion\"U\202\323\344\223\002O\022M/v1/{name=project" + + "s/*/locations/*/keyRings/*/cryptoKeys/*/" + + "cryptoKeyVersions/*}\022\271\001\n\014GetPublicKey\022(." + + "google.cloud.kms.v1.GetPublicKeyRequest\032" + + "\036.google.cloud.kms.v1.PublicKey\"_\202\323\344\223\002Y\022" + + "W/v1/{name=projects/*/locations/*/keyRin" + + "gs/*/cryptoKeys/*/cryptoKeyVersions/*}/p" + + "ublicKey\022\230\001\n\rCreateKeyRing\022).google.clou" + + "d.kms.v1.CreateKeyRingRequest\032\034.google.c" + + "loud.kms.v1.KeyRing\">\202\323\344\223\0028\",/v1/{parent" + + "=projects/*/locations/*}/keyRings:\010key_r" + + "ing\022\255\001\n\017CreateCryptoKey\022+.google.cloud.k" + + "ms.v1.CreateCryptoKeyRequest\032\036.google.cl" + + "oud.kms.v1.CryptoKey\"M\202\323\344\223\002G\"9/v1/{paren" + + "t=projects/*/locations/*/keyRings/*}/cry" + + "ptoKeys:\ncrypto_key\022\336\001\n\026CreateCryptoKeyV" + + "ersion\0222.google.cloud.kms.v1.CreateCrypt" + + "oKeyVersionRequest\032%.google.cloud.kms.v1" + + ".CryptoKeyVersion\"i\202\323\344\223\002c\"M/v1/{parent=p" + + "rojects/*/locations/*/keyRings/*/cryptoK" + + "eys/*}/cryptoKeyVersions:\022crypto_key_ver" + + "sion\022\270\001\n\017UpdateCryptoKey\022+.google.cloud." + + "kms.v1.UpdateCryptoKeyRequest\032\036.google.c" + + "loud.kms.v1.CryptoKey\"X\202\323\344\223\002R2D/v1/{cryp" + + "to_key.name=projects/*/locations/*/keyRi" + + "ngs/*/cryptoKeys/*}:\ncrypto_key\022\361\001\n\026Upda" + + "teCryptoKeyVersion\0222.google.cloud.kms.v1" + + ".UpdateCryptoKeyVersionRequest\032%.google." + + "cloud.kms.v1.CryptoKeyVersion\"|\202\323\344\223\002v2`/" + + "v1/{crypto_key_version.name=projects/*/l" + + "ocations/*/keyRings/*/cryptoKeys/*/crypt" + + "oKeyVersions/*}:\022crypto_key_version\022\243\001\n\007" + + "Encrypt\022#.google.cloud.kms.v1.EncryptReq" + + "uest\032$.google.cloud.kms.v1.EncryptRespon" + + "se\"M\202\323\344\223\002G\"B/v1/{name=projects/*/locatio" + + "ns/*/keyRings/*/cryptoKeys/**}:encrypt:\001" + + "*\022\242\001\n\007Decrypt\022#.google.cloud.kms.v1.Decr" + + "yptRequest\032$.google.cloud.kms.v1.Decrypt" + + "Response\"L\202\323\344\223\002F\"A/v1/{name=projects/*/l" + + "ocations/*/keyRings/*/cryptoKeys/*}:decr" + + "ypt:\001*\022\322\001\n\016AsymmetricSign\022*.google.cloud" + + ".kms.v1.AsymmetricSignRequest\032+.google.c" + + "loud.kms.v1.AsymmetricSignResponse\"g\202\323\344\223" + + "\002a\"\\/v1/{name=projects/*/locations/*/key" + + "Rings/*/cryptoKeys/*/cryptoKeyVersions/*" + + "}:asymmetricSign:\001*\022\336\001\n\021AsymmetricDecryp" + + "t\022-.google.cloud.kms.v1.AsymmetricDecryp" + + "tRequest\032..google.cloud.kms.v1.Asymmetri" + + "cDecryptResponse\"j\202\323\344\223\002d\"_/v1/{name=proj" + + "ects/*/locations/*/keyRings/*/cryptoKeys" + + "/*/cryptoKeyVersions/*}:asymmetricDecryp" + + "t:\001*\022\325\001\n\035UpdateCryptoKeyPrimaryVersion\0229" + + ".google.cloud.kms.v1.UpdateCryptoKeyPrim" + + "aryVersionRequest\032\036.google.cloud.kms.v1." + + "CryptoKey\"Y\202\323\344\223\002S\"N/v1/{name=projects/*/" + + "locations/*/keyRings/*/cryptoKeys/*}:upd" + + "atePrimaryVersion:\001*\022\327\001\n\027DestroyCryptoKe" + + "yVersion\0223.google.cloud.kms.v1.DestroyCr" + + "yptoKeyVersionRequest\032%.google.cloud.kms" + + ".v1.CryptoKeyVersion\"`\202\323\344\223\002Z\"U/v1/{name=" + + "projects/*/locations/*/keyRings/*/crypto" + + "Keys/*/cryptoKeyVersions/*}:destroy:\001*\022\327" + + "\001\n\027RestoreCryptoKeyVersion\0223.google.clou" + + "d.kms.v1.RestoreCryptoKeyVersionRequest\032" + + "%.google.cloud.kms.v1.CryptoKeyVersion\"`" + + "\202\323\344\223\002Z\"U/v1/{name=projects/*/locations/*" + + "/keyRings/*/cryptoKeys/*/cryptoKeyVersio" + + "ns/*}:restore:\001*B\214\001\n\027com.google.cloud.km" + + "s.v1B\010KmsProtoP\001Z6google.golang.org/genp" + + "roto/googleapis/cloud/kms/v1;kms\370\001\001\252\002\023Go" + + "ogle.Cloud.Kms.V1\312\002\023Google\\Cloud\\Kms\\V1b" + + "\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -288,13 +353,13 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_cloud_kms_v1_ListCryptoKeysRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_ListCryptoKeysRequest_descriptor, - new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + new java.lang.String[] { "Parent", "PageSize", "PageToken", "VersionView", }); internal_static_google_cloud_kms_v1_ListCryptoKeyVersionsRequest_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_google_cloud_kms_v1_ListCryptoKeyVersionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_ListCryptoKeyVersionsRequest_descriptor, - new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + new java.lang.String[] { "Parent", "PageSize", "PageToken", "View", }); internal_static_google_cloud_kms_v1_ListKeyRingsResponse_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_google_cloud_kms_v1_ListKeyRingsResponse_fieldAccessorTable = new @@ -331,78 +396,120 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_GetCryptoKeyVersionRequest_descriptor, new java.lang.String[] { "Name", }); - internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor = + internal_static_google_cloud_kms_v1_GetPublicKeyRequest_descriptor = getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_kms_v1_GetPublicKeyRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_GetPublicKeyRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor = + getDescriptor().getMessageTypes().get(10); internal_static_google_cloud_kms_v1_CreateKeyRingRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor, new java.lang.String[] { "Parent", "KeyRingId", "KeyRing", }); internal_static_google_cloud_kms_v1_CreateCryptoKeyRequest_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_google_cloud_kms_v1_CreateCryptoKeyRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_CreateCryptoKeyRequest_descriptor, new java.lang.String[] { "Parent", "CryptoKeyId", "CryptoKey", }); internal_static_google_cloud_kms_v1_CreateCryptoKeyVersionRequest_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_kms_v1_CreateCryptoKeyVersionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_CreateCryptoKeyVersionRequest_descriptor, new java.lang.String[] { "Parent", "CryptoKeyVersion", }); internal_static_google_cloud_kms_v1_UpdateCryptoKeyRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_kms_v1_UpdateCryptoKeyRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_UpdateCryptoKeyRequest_descriptor, new java.lang.String[] { "CryptoKey", "UpdateMask", }); internal_static_google_cloud_kms_v1_UpdateCryptoKeyVersionRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_kms_v1_UpdateCryptoKeyVersionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_UpdateCryptoKeyVersionRequest_descriptor, new java.lang.String[] { "CryptoKeyVersion", "UpdateMask", }); internal_static_google_cloud_kms_v1_EncryptRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_kms_v1_EncryptRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_EncryptRequest_descriptor, new java.lang.String[] { "Name", "Plaintext", "AdditionalAuthenticatedData", }); internal_static_google_cloud_kms_v1_DecryptRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_kms_v1_DecryptRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_DecryptRequest_descriptor, new java.lang.String[] { "Name", "Ciphertext", "AdditionalAuthenticatedData", }); + internal_static_google_cloud_kms_v1_AsymmetricSignRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_kms_v1_AsymmetricSignRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_AsymmetricSignRequest_descriptor, + new java.lang.String[] { "Name", "Digest", }); + internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_AsymmetricDecryptRequest_descriptor, + new java.lang.String[] { "Name", "Ciphertext", }); internal_static_google_cloud_kms_v1_DecryptResponse_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_kms_v1_DecryptResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_DecryptResponse_descriptor, new java.lang.String[] { "Plaintext", }); internal_static_google_cloud_kms_v1_EncryptResponse_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_kms_v1_EncryptResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_EncryptResponse_descriptor, new java.lang.String[] { "Name", "Ciphertext", }); + internal_static_google_cloud_kms_v1_AsymmetricSignResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_kms_v1_AsymmetricSignResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_AsymmetricSignResponse_descriptor, + new java.lang.String[] { "Signature", }); + internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_AsymmetricDecryptResponse_descriptor, + new java.lang.String[] { "Plaintext", }); internal_static_google_cloud_kms_v1_UpdateCryptoKeyPrimaryVersionRequest_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_kms_v1_UpdateCryptoKeyPrimaryVersionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_UpdateCryptoKeyPrimaryVersionRequest_descriptor, new java.lang.String[] { "Name", "CryptoKeyVersionId", }); internal_static_google_cloud_kms_v1_DestroyCryptoKeyVersionRequest_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(24); internal_static_google_cloud_kms_v1_DestroyCryptoKeyVersionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_DestroyCryptoKeyVersionRequest_descriptor, new java.lang.String[] { "Name", }); internal_static_google_cloud_kms_v1_RestoreCryptoKeyVersionRequest_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_kms_v1_RestoreCryptoKeyVersionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_RestoreCryptoKeyVersionRequest_descriptor, new java.lang.String[] { "Name", }); + internal_static_google_cloud_kms_v1_Digest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_cloud_kms_v1_Digest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_Digest_descriptor, + new java.lang.String[] { "Sha256", "Sha384", "Sha512", "Digest", }); + internal_static_google_cloud_kms_v1_LocationMetadata_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_cloud_kms_v1_LocationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_LocationMetadata_descriptor, + new java.lang.String[] { "HsmAvailable", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.AnnotationsProto.http); diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsResourcesProto.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsResourcesProto.java index 63cac2096708..e925a50ad431 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsResourcesProto.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsResourcesProto.java @@ -29,11 +29,26 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_kms_v1_CryptoKey_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_KeyOperationAttestation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_KeyOperationAttestation_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_kms_v1_CryptoKeyVersion_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_kms_v1_CryptoKeyVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_kms_v1_PublicKey_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_kms_v1_PublicKey_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -48,7 +63,7 @@ public static void registerAllExtensions( "ns.proto\032\036google/protobuf/duration.proto" + "\032\037google/protobuf/timestamp.proto\"H\n\007Key" + "Ring\022\014\n\004name\030\001 \001(\t\022/\n\013create_time\030\002 \001(\0132" + - "\032.google.protobuf.Timestamp\"\377\003\n\tCryptoKe" + + "\032.google.protobuf.Timestamp\"\365\004\n\tCryptoKe" + "y\022\014\n\004name\030\001 \001(\t\0226\n\007primary\030\002 \001(\0132%.googl" + "e.cloud.kms.v1.CryptoKeyVersion\022@\n\007purpo" + "se\030\003 \001(\0162/.google.cloud.kms.v1.CryptoKey" + @@ -56,26 +71,64 @@ public static void registerAllExtensions( ".google.protobuf.Timestamp\0226\n\022next_rotat" + "ion_time\030\007 \001(\0132\032.google.protobuf.Timesta" + "mp\0224\n\017rotation_period\030\010 \001(\0132\031.google.pro" + - "tobuf.DurationH\000\022:\n\006labels\030\n \003(\0132*.googl" + - "e.cloud.kms.v1.CryptoKey.LabelsEntry\032-\n\013" + - "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + - "\0028\001\"K\n\020CryptoKeyPurpose\022\"\n\036CRYPTO_KEY_PU" + - "RPOSE_UNSPECIFIED\020\000\022\023\n\017ENCRYPT_DECRYPT\020\001" + - "B\023\n\021rotation_schedule\"\214\003\n\020CryptoKeyVersi" + - "on\022\014\n\004name\030\001 \001(\t\022J\n\005state\030\003 \001(\0162;.google" + - ".cloud.kms.v1.CryptoKeyVersion.CryptoKey" + - "VersionState\022/\n\013create_time\030\004 \001(\0132\032.goog" + - "le.protobuf.Timestamp\0220\n\014destroy_time\030\005 " + - "\001(\0132\032.google.protobuf.Timestamp\0226\n\022destr" + - "oy_event_time\030\006 \001(\0132\032.google.protobuf.Ti" + - "mestamp\"\202\001\n\025CryptoKeyVersionState\022(\n$CRY" + - "PTO_KEY_VERSION_STATE_UNSPECIFIED\020\000\022\013\n\007E" + + "tobuf.DurationH\000\022G\n\020version_template\030\013 \001" + + "(\0132-.google.cloud.kms.v1.CryptoKeyVersio" + + "nTemplate\022:\n\006labels\030\n \003(\0132*.google.cloud" + + ".kms.v1.CryptoKey.LabelsEntry\032-\n\013LabelsE" + + "ntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"x\n\020" + + "CryptoKeyPurpose\022\"\n\036CRYPTO_KEY_PURPOSE_U" + + "NSPECIFIED\020\000\022\023\n\017ENCRYPT_DECRYPT\020\001\022\023\n\017ASY" + + "MMETRIC_SIGN\020\005\022\026\n\022ASYMMETRIC_DECRYPT\020\006B\023" + + "\n\021rotation_schedule\"\256\001\n\030CryptoKeyVersion" + + "Template\022>\n\020protection_level\030\001 \001(\0162$.goo" + + "gle.cloud.kms.v1.ProtectionLevel\022R\n\talgo" + + "rithm\030\003 \001(\0162?.google.cloud.kms.v1.Crypto" + + "KeyVersion.CryptoKeyVersionAlgorithm\"\315\001\n" + + "\027KeyOperationAttestation\022N\n\006format\030\004 \001(\016" + + "2>.google.cloud.kms.v1.KeyOperationAttes" + + "tation.AttestationFormat\022\017\n\007content\030\005 \001(" + + "\014\"Q\n\021AttestationFormat\022\"\n\036ATTESTATION_FO" + + "RMAT_UNSPECIFIED\020\000\022\030\n\024CAVIUM_V1_COMPRESS" + + "ED\020\003\"\270\t\n\020CryptoKeyVersion\022\014\n\004name\030\001 \001(\t\022" + + "J\n\005state\030\003 \001(\0162;.google.cloud.kms.v1.Cry" + + "ptoKeyVersion.CryptoKeyVersionState\022>\n\020p" + + "rotection_level\030\007 \001(\0162$.google.cloud.kms" + + ".v1.ProtectionLevel\022R\n\talgorithm\030\n \001(\0162?" + + ".google.cloud.kms.v1.CryptoKeyVersion.Cr" + + "yptoKeyVersionAlgorithm\022A\n\013attestation\030\010" + + " \001(\0132,.google.cloud.kms.v1.KeyOperationA" + + "ttestation\022/\n\013create_time\030\004 \001(\0132\032.google" + + ".protobuf.Timestamp\0221\n\rgenerate_time\030\013 \001" + + "(\0132\032.google.protobuf.Timestamp\0220\n\014destro" + + "y_time\030\005 \001(\0132\032.google.protobuf.Timestamp" + + "\0226\n\022destroy_event_time\030\006 \001(\0132\032.google.pr" + + "otobuf.Timestamp\"\274\003\n\031CryptoKeyVersionAlg" + + "orithm\022,\n(CRYPTO_KEY_VERSION_ALGORITHM_U" + + "NSPECIFIED\020\000\022\037\n\033GOOGLE_SYMMETRIC_ENCRYPT" + + "ION\020\001\022\034\n\030RSA_SIGN_PSS_2048_SHA256\020\002\022\034\n\030R" + + "SA_SIGN_PSS_3072_SHA256\020\003\022\034\n\030RSA_SIGN_PS" + + "S_4096_SHA256\020\004\022\036\n\032RSA_SIGN_PKCS1_2048_S" + + "HA256\020\005\022\036\n\032RSA_SIGN_PKCS1_3072_SHA256\020\006\022" + + "\036\n\032RSA_SIGN_PKCS1_4096_SHA256\020\007\022 \n\034RSA_D" + + "ECRYPT_OAEP_2048_SHA256\020\010\022 \n\034RSA_DECRYPT" + + "_OAEP_3072_SHA256\020\t\022 \n\034RSA_DECRYPT_OAEP_" + + "4096_SHA256\020\n\022\027\n\023EC_SIGN_P256_SHA256\020\014\022\027" + + "\n\023EC_SIGN_P384_SHA384\020\r\"\232\001\n\025CryptoKeyVer" + + "sionState\022(\n$CRYPTO_KEY_VERSION_STATE_UN" + + "SPECIFIED\020\000\022\026\n\022PENDING_GENERATION\020\005\022\013\n\007E" + "NABLED\020\001\022\014\n\010DISABLED\020\002\022\r\n\tDESTROYED\020\003\022\025\n" + - "\021DESTROY_SCHEDULED\020\004B\225\001\n\027com.google.clou" + - "d.kms.v1B\021KmsResourcesProtoP\001Z6google.go" + - "lang.org/genproto/googleapis/cloud/kms/v" + - "1;kms\370\001\001\252\002\023Google.Cloud.Kms.V1\312\002\023Google\\" + - "Cloud\\Kms\\V1b\006proto3" + "\021DESTROY_SCHEDULED\020\004\"I\n\024CryptoKeyVersion" + + "View\022\'\n#CRYPTO_KEY_VERSION_VIEW_UNSPECIF" + + "IED\020\000\022\010\n\004FULL\020\001\"l\n\tPublicKey\022\013\n\003pem\030\001 \001(" + + "\t\022R\n\talgorithm\030\002 \001(\0162?.google.cloud.kms." + + "v1.CryptoKeyVersion.CryptoKeyVersionAlgo" + + "rithm*J\n\017ProtectionLevel\022 \n\034PROTECTION_L" + + "EVEL_UNSPECIFIED\020\000\022\014\n\010SOFTWARE\020\001\022\007\n\003HSM\020" + + "\002B\225\001\n\027com.google.cloud.kms.v1B\021KmsResour" + + "cesProtoP\001Z6google.golang.org/genproto/g" + + "oogleapis/cloud/kms/v1;kms\370\001\001\252\002\023Google.C" + + "loud.Kms.V1\312\002\023Google\\Cloud\\Kms\\V1b\006proto" + + "3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -103,19 +156,37 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_cloud_kms_v1_CryptoKey_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_CryptoKey_descriptor, - new java.lang.String[] { "Name", "Primary", "Purpose", "CreateTime", "NextRotationTime", "RotationPeriod", "Labels", "RotationSchedule", }); + new java.lang.String[] { "Name", "Primary", "Purpose", "CreateTime", "NextRotationTime", "RotationPeriod", "VersionTemplate", "Labels", "RotationSchedule", }); internal_static_google_cloud_kms_v1_CryptoKey_LabelsEntry_descriptor = internal_static_google_cloud_kms_v1_CryptoKey_descriptor.getNestedTypes().get(0); internal_static_google_cloud_kms_v1_CryptoKey_LabelsEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_CryptoKey_LabelsEntry_descriptor, new java.lang.String[] { "Key", "Value", }); - internal_static_google_cloud_kms_v1_CryptoKeyVersion_descriptor = + internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_CryptoKeyVersionTemplate_descriptor, + new java.lang.String[] { "ProtectionLevel", "Algorithm", }); + internal_static_google_cloud_kms_v1_KeyOperationAttestation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_kms_v1_KeyOperationAttestation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_KeyOperationAttestation_descriptor, + new java.lang.String[] { "Format", "Content", }); + internal_static_google_cloud_kms_v1_CryptoKeyVersion_descriptor = + getDescriptor().getMessageTypes().get(4); internal_static_google_cloud_kms_v1_CryptoKeyVersion_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_kms_v1_CryptoKeyVersion_descriptor, - new java.lang.String[] { "Name", "State", "CreateTime", "DestroyTime", "DestroyEventTime", }); + new java.lang.String[] { "Name", "State", "ProtectionLevel", "Algorithm", "Attestation", "CreateTime", "GenerateTime", "DestroyTime", "DestroyEventTime", }); + internal_static_google_cloud_kms_v1_PublicKey_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_kms_v1_PublicKey_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_kms_v1_PublicKey_descriptor, + new java.lang.String[] { "Pem", "Algorithm", }); com.google.api.AnnotationsProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequest.java index b6545ef308a6..85f10e47839f 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequest.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequest.java @@ -23,6 +23,7 @@ private ListCryptoKeyVersionsRequest() { parent_ = ""; pageSize_ = 0; pageToken_ = ""; + view_ = 0; } @java.lang.Override @@ -66,6 +67,12 @@ private ListCryptoKeyVersionsRequest( pageToken_ = s; break; } + case 32: { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -203,6 +210,31 @@ public java.lang.String getPageToken() { } } + public static final int VIEW_FIELD_NUMBER = 4; + private int view_; + /** + *
+   * The fields to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public int getViewValue() { + return view_; + } + /** + *
+   * The fields to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.valueOf(view_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -226,6 +258,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } + if (view_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(4, view_); + } unknownFields.writeTo(output); } @@ -245,6 +280,10 @@ public int getSerializedSize() { if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } + if (view_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, view_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -267,6 +306,7 @@ public boolean equals(final java.lang.Object obj) { == other.getPageSize()); result = result && getPageToken() .equals(other.getPageToken()); + result = result && view_ == other.view_; result = result && unknownFields.equals(other.unknownFields); return result; } @@ -284,6 +324,8 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -427,6 +469,8 @@ public Builder clear() { pageToken_ = ""; + view_ = 0; + return this; } @@ -456,6 +500,7 @@ public com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest buildPartial() { result.parent_ = parent_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; + result.view_ = view_; onBuilt(); return result; } @@ -515,6 +560,9 @@ public Builder mergeFrom(com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest ot pageToken_ = other.pageToken_; onChanged(); } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -781,6 +829,71 @@ public Builder setPageTokenBytes( onChanged(); return this; } + + private int view_ = 0; + /** + *
+     * The fields to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public int getViewValue() { + return view_; + } + /** + *
+     * The fields to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public Builder setViewValue(int value) { + view_ = value; + onChanged(); + return this; + } + /** + *
+     * The fields to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.valueOf(view_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.UNRECOGNIZED : result; + } + /** + *
+     * The fields to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public Builder setView(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The fields to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequestOrBuilder.java index cfe7fa7952f5..e31286f8b246 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeyVersionsRequestOrBuilder.java @@ -59,4 +59,21 @@ public interface ListCryptoKeyVersionsRequestOrBuilder extends */ com.google.protobuf.ByteString getPageTokenBytes(); + + /** + *
+   * The fields to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + int getViewValue(); + /** + *
+   * The fields to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView view = 4; + */ + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView getView(); } diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequest.java index 1424dffd0719..83093a2e4893 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequest.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequest.java @@ -23,6 +23,7 @@ private ListCryptoKeysRequest() { parent_ = ""; pageSize_ = 0; pageToken_ = ""; + versionView_ = 0; } @java.lang.Override @@ -66,6 +67,12 @@ private ListCryptoKeysRequest( pageToken_ = s; break; } + case 32: { + int rawValue = input.readEnum(); + + versionView_ = rawValue; + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -202,6 +209,31 @@ public java.lang.String getPageToken() { } } + public static final int VERSION_VIEW_FIELD_NUMBER = 4; + private int versionView_; + /** + *
+   * The fields of the primary version to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public int getVersionViewValue() { + return versionView_; + } + /** + *
+   * The fields of the primary version to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView getVersionView() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.valueOf(versionView_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -225,6 +257,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (!getPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); } + if (versionView_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(4, versionView_); + } unknownFields.writeTo(output); } @@ -244,6 +279,10 @@ public int getSerializedSize() { if (!getPageTokenBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); } + if (versionView_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, versionView_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -266,6 +305,7 @@ public boolean equals(final java.lang.Object obj) { == other.getPageSize()); result = result && getPageToken() .equals(other.getPageToken()); + result = result && versionView_ == other.versionView_; result = result && unknownFields.equals(other.unknownFields); return result; } @@ -283,6 +323,8 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + VERSION_VIEW_FIELD_NUMBER; + hash = (53 * hash) + versionView_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -426,6 +468,8 @@ public Builder clear() { pageToken_ = ""; + versionView_ = 0; + return this; } @@ -455,6 +499,7 @@ public com.google.cloud.kms.v1.ListCryptoKeysRequest buildPartial() { result.parent_ = parent_; result.pageSize_ = pageSize_; result.pageToken_ = pageToken_; + result.versionView_ = versionView_; onBuilt(); return result; } @@ -514,6 +559,9 @@ public Builder mergeFrom(com.google.cloud.kms.v1.ListCryptoKeysRequest other) { pageToken_ = other.pageToken_; onChanged(); } + if (other.versionView_ != 0) { + setVersionViewValue(other.getVersionViewValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -777,6 +825,71 @@ public Builder setPageTokenBytes( onChanged(); return this; } + + private int versionView_ = 0; + /** + *
+     * The fields of the primary version to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public int getVersionViewValue() { + return versionView_; + } + /** + *
+     * The fields of the primary version to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public Builder setVersionViewValue(int value) { + versionView_ = value; + onChanged(); + return this; + } + /** + *
+     * The fields of the primary version to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView getVersionView() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.valueOf(versionView_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView.UNRECOGNIZED : result; + } + /** + *
+     * The fields of the primary version to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public Builder setVersionView(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView value) { + if (value == null) { + throw new NullPointerException(); + } + + versionView_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The fields of the primary version to include in the response.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + public Builder clearVersionView() { + + versionView_ = 0; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequestOrBuilder.java index 7825247f1017..3ca97d03e914 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ListCryptoKeysRequestOrBuilder.java @@ -58,4 +58,21 @@ public interface ListCryptoKeysRequestOrBuilder extends */ com.google.protobuf.ByteString getPageTokenBytes(); + + /** + *
+   * The fields of the primary version to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + int getVersionViewValue(); + /** + *
+   * The fields of the primary version to include in the response.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView version_view = 4; + */ + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionView getVersionView(); } diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/LocationMetadata.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/LocationMetadata.java new file mode 100644 index 000000000000..aaba89f81fb1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/LocationMetadata.java @@ -0,0 +1,505 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * Cloud KMS metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.LocationMetadata} + */ +public final class LocationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.LocationMetadata) + LocationMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use LocationMetadata.newBuilder() to construct. + private LocationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LocationMetadata() { + hsmAvailable_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LocationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + hsmAvailable_ = input.readBool(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.LocationMetadata.class, com.google.cloud.kms.v1.LocationMetadata.Builder.class); + } + + public static final int HSM_AVAILABLE_FIELD_NUMBER = 1; + private boolean hsmAvailable_; + /** + *
+   * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
+   * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location.
+   * 
+ * + * bool hsm_available = 1; + */ + public boolean getHsmAvailable() { + return hsmAvailable_; + } + + 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 (hsmAvailable_ != false) { + output.writeBool(1, hsmAvailable_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (hsmAvailable_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, hsmAvailable_); + } + size += unknownFields.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.kms.v1.LocationMetadata)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.LocationMetadata other = (com.google.cloud.kms.v1.LocationMetadata) obj; + + boolean result = true; + result = result && (getHsmAvailable() + == other.getHsmAvailable()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HSM_AVAILABLE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getHsmAvailable()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.LocationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.LocationMetadata 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.kms.v1.LocationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.LocationMetadata 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.kms.v1.LocationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.LocationMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.LocationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.LocationMetadata 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.kms.v1.LocationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.LocationMetadata 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.kms.v1.LocationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.LocationMetadata 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.kms.v1.LocationMetadata 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; + } + /** + *
+   * Cloud KMS metadata for the given [google.cloud.location.Location][google.cloud.location.Location].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.LocationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.LocationMetadata) + com.google.cloud.kms.v1.LocationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.LocationMetadata.class, com.google.cloud.kms.v1.LocationMetadata.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.LocationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + hsmAvailable_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.LocationMetadata getDefaultInstanceForType() { + return com.google.cloud.kms.v1.LocationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.LocationMetadata build() { + com.google.cloud.kms.v1.LocationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.LocationMetadata buildPartial() { + com.google.cloud.kms.v1.LocationMetadata result = new com.google.cloud.kms.v1.LocationMetadata(this); + result.hsmAvailable_ = hsmAvailable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.LocationMetadata) { + return mergeFrom((com.google.cloud.kms.v1.LocationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.LocationMetadata other) { + if (other == com.google.cloud.kms.v1.LocationMetadata.getDefaultInstance()) return this; + if (other.getHsmAvailable() != false) { + setHsmAvailable(other.getHsmAvailable()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.LocationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.LocationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean hsmAvailable_ ; + /** + *
+     * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
+     * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location.
+     * 
+ * + * bool hsm_available = 1; + */ + public boolean getHsmAvailable() { + return hsmAvailable_; + } + /** + *
+     * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
+     * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location.
+     * 
+ * + * bool hsm_available = 1; + */ + public Builder setHsmAvailable(boolean value) { + + hsmAvailable_ = value; + onChanged(); + return this; + } + /** + *
+     * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
+     * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
+     * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location.
+     * 
+ * + * bool hsm_available = 1; + */ + public Builder clearHsmAvailable() { + + hsmAvailable_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.LocationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.LocationMetadata) + private static final com.google.cloud.kms.v1.LocationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.LocationMetadata(); + } + + public static com.google.cloud.kms.v1.LocationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocationMetadata(input, extensionRegistry); + } + }; + + 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.kms.v1.LocationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/LocationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/LocationMetadataOrBuilder.java new file mode 100644 index 000000000000..d78a8df0b759 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/LocationMetadataOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/service.proto + +package com.google.cloud.kms.v1; + +public interface LocationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.LocationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
+   * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
+   * [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location.
+   * 
+ * + * bool hsm_available = 1; + */ + boolean getHsmAvailable(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ProtectionLevel.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ProtectionLevel.java new file mode 100644 index 000000000000..f731415291e2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/ProtectionLevel.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/resources.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] specifies how cryptographic operations are performed.
+ * 
+ * + * Protobuf enum {@code google.cloud.kms.v1.ProtectionLevel} + */ +public enum ProtectionLevel + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Not specified.
+   * 
+ * + * PROTECTION_LEVEL_UNSPECIFIED = 0; + */ + PROTECTION_LEVEL_UNSPECIFIED(0), + /** + *
+   * Crypto operations are performed in software.
+   * 
+ * + * SOFTWARE = 1; + */ + SOFTWARE(1), + /** + *
+   * Crypto operations are performed in a Hardware Security Module.
+   * 
+ * + * HSM = 2; + */ + HSM(2), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Not specified.
+   * 
+ * + * PROTECTION_LEVEL_UNSPECIFIED = 0; + */ + public static final int PROTECTION_LEVEL_UNSPECIFIED_VALUE = 0; + /** + *
+   * Crypto operations are performed in software.
+   * 
+ * + * SOFTWARE = 1; + */ + public static final int SOFTWARE_VALUE = 1; + /** + *
+   * Crypto operations are performed in a Hardware Security Module.
+   * 
+ * + * HSM = 2; + */ + public static final int HSM_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ProtectionLevel valueOf(int value) { + return forNumber(value); + } + + public static ProtectionLevel forNumber(int value) { + switch (value) { + case 0: return PROTECTION_LEVEL_UNSPECIFIED; + case 1: return SOFTWARE; + case 2: return HSM; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ProtectionLevel> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ProtectionLevel findValueByNumber(int number) { + return ProtectionLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + 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.kms.v1.KmsResourcesProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ProtectionLevel[] VALUES = values(); + + public static ProtectionLevel 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 ProtectionLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.kms.v1.ProtectionLevel) +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKey.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKey.java new file mode 100644 index 000000000000..f7d239c35688 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKey.java @@ -0,0 +1,727 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/resources.proto + +package com.google.cloud.kms.v1; + +/** + *
+ * The public key for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Obtained via
+ * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+ * 
+ * + * Protobuf type {@code google.cloud.kms.v1.PublicKey} + */ +public final class PublicKey extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.PublicKey) + PublicKeyOrBuilder { +private static final long serialVersionUID = 0L; + // Use PublicKey.newBuilder() to construct. + private PublicKey(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PublicKey() { + pem_ = ""; + algorithm_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PublicKey( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + pem_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + algorithm_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_PublicKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_PublicKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.PublicKey.class, com.google.cloud.kms.v1.PublicKey.Builder.class); + } + + public static final int PEM_FIELD_NUMBER = 1; + private volatile java.lang.Object pem_; + /** + *
+   * The public key, encoded in PEM format. For more information, see the
+   * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+   * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+   * [Textual Encoding of Subject Public Key Info]
+   * (https://tools.ietf.org/html/rfc7468#section-13).
+   * 
+ * + * string pem = 1; + */ + public java.lang.String getPem() { + java.lang.Object ref = pem_; + 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(); + pem_ = s; + return s; + } + } + /** + *
+   * The public key, encoded in PEM format. For more information, see the
+   * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+   * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+   * [Textual Encoding of Subject Public Key Info]
+   * (https://tools.ietf.org/html/rfc7468#section-13).
+   * 
+ * + * string pem = 1; + */ + public com.google.protobuf.ByteString + getPemBytes() { + java.lang.Object ref = pem_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALGORITHM_FIELD_NUMBER = 2; + private int algorithm_; + /** + *
+   * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+   * with this key.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public int getAlgorithmValue() { + return algorithm_; + } + /** + *
+   * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+   * with this key.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.valueOf(algorithm_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.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 (!getPemBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pem_); + } + if (algorithm_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED.getNumber()) { + output.writeEnum(2, algorithm_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPemBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pem_); + } + if (algorithm_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, algorithm_); + } + size += unknownFields.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.kms.v1.PublicKey)) { + return super.equals(obj); + } + com.google.cloud.kms.v1.PublicKey other = (com.google.cloud.kms.v1.PublicKey) obj; + + boolean result = true; + result = result && getPem() + .equals(other.getPem()); + result = result && algorithm_ == other.algorithm_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PEM_FIELD_NUMBER; + hash = (53 * hash) + getPem().hashCode(); + hash = (37 * hash) + ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + algorithm_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.kms.v1.PublicKey parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.PublicKey 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.kms.v1.PublicKey parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.PublicKey parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.PublicKey parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.kms.v1.PublicKey parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.kms.v1.PublicKey parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.PublicKey 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.kms.v1.PublicKey parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.PublicKey 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.kms.v1.PublicKey parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.kms.v1.PublicKey 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.kms.v1.PublicKey prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The public key for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Obtained via
+   * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
+   * 
+ * + * Protobuf type {@code google.cloud.kms.v1.PublicKey} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.PublicKey) + com.google.cloud.kms.v1.PublicKeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_PublicKey_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_PublicKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.PublicKey.class, com.google.cloud.kms.v1.PublicKey.Builder.class); + } + + // Construct using com.google.cloud.kms.v1.PublicKey.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + pem_ = ""; + + algorithm_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_PublicKey_descriptor; + } + + @java.lang.Override + public com.google.cloud.kms.v1.PublicKey getDefaultInstanceForType() { + return com.google.cloud.kms.v1.PublicKey.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.kms.v1.PublicKey build() { + com.google.cloud.kms.v1.PublicKey result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.kms.v1.PublicKey buildPartial() { + com.google.cloud.kms.v1.PublicKey result = new com.google.cloud.kms.v1.PublicKey(this); + result.pem_ = pem_; + result.algorithm_ = algorithm_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.kms.v1.PublicKey) { + return mergeFrom((com.google.cloud.kms.v1.PublicKey)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.kms.v1.PublicKey other) { + if (other == com.google.cloud.kms.v1.PublicKey.getDefaultInstance()) return this; + if (!other.getPem().isEmpty()) { + pem_ = other.pem_; + onChanged(); + } + if (other.algorithm_ != 0) { + setAlgorithmValue(other.getAlgorithmValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.kms.v1.PublicKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.kms.v1.PublicKey) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object pem_ = ""; + /** + *
+     * The public key, encoded in PEM format. For more information, see the
+     * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+     * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+     * [Textual Encoding of Subject Public Key Info]
+     * (https://tools.ietf.org/html/rfc7468#section-13).
+     * 
+ * + * string pem = 1; + */ + public java.lang.String getPem() { + java.lang.Object ref = pem_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pem_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The public key, encoded in PEM format. For more information, see the
+     * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+     * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+     * [Textual Encoding of Subject Public Key Info]
+     * (https://tools.ietf.org/html/rfc7468#section-13).
+     * 
+ * + * string pem = 1; + */ + public com.google.protobuf.ByteString + getPemBytes() { + java.lang.Object ref = pem_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The public key, encoded in PEM format. For more information, see the
+     * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+     * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+     * [Textual Encoding of Subject Public Key Info]
+     * (https://tools.ietf.org/html/rfc7468#section-13).
+     * 
+ * + * string pem = 1; + */ + public Builder setPem( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pem_ = value; + onChanged(); + return this; + } + /** + *
+     * The public key, encoded in PEM format. For more information, see the
+     * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+     * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+     * [Textual Encoding of Subject Public Key Info]
+     * (https://tools.ietf.org/html/rfc7468#section-13).
+     * 
+ * + * string pem = 1; + */ + public Builder clearPem() { + + pem_ = getDefaultInstance().getPem(); + onChanged(); + return this; + } + /** + *
+     * The public key, encoded in PEM format. For more information, see the
+     * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+     * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+     * [Textual Encoding of Subject Public Key Info]
+     * (https://tools.ietf.org/html/rfc7468#section-13).
+     * 
+ * + * string pem = 1; + */ + public Builder setPemBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pem_ = value; + onChanged(); + return this; + } + + private int algorithm_ = 0; + /** + *
+     * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+     * with this key.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public int getAlgorithmValue() { + return algorithm_; + } + /** + *
+     * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+     * with this key.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public Builder setAlgorithmValue(int value) { + algorithm_ = value; + onChanged(); + return this; + } + /** + *
+     * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+     * with this key.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm() { + @SuppressWarnings("deprecation") + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.valueOf(algorithm_); + return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.UNRECOGNIZED : result; + } + /** + *
+     * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+     * with this key.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public Builder setAlgorithm(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm value) { + if (value == null) { + throw new NullPointerException(); + } + + algorithm_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+     * with this key.
+     * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + public Builder clearAlgorithm() { + + algorithm_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.kms.v1.PublicKey) + } + + // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.PublicKey) + private static final com.google.cloud.kms.v1.PublicKey DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.kms.v1.PublicKey(); + } + + public static com.google.cloud.kms.v1.PublicKey getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PublicKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PublicKey(input, extensionRegistry); + } + }; + + 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.kms.v1.PublicKey getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKeyOrBuilder.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKeyOrBuilder.java new file mode 100644 index 000000000000..4a4fd44b4fd5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKeyOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/kms/v1/resources.proto + +package com.google.cloud.kms.v1; + +public interface PublicKeyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.kms.v1.PublicKey) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The public key, encoded in PEM format. For more information, see the
+   * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+   * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+   * [Textual Encoding of Subject Public Key Info]
+   * (https://tools.ietf.org/html/rfc7468#section-13).
+   * 
+ * + * string pem = 1; + */ + java.lang.String getPem(); + /** + *
+   * The public key, encoded in PEM format. For more information, see the
+   * [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
+   * [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
+   * [Textual Encoding of Subject Public Key Info]
+   * (https://tools.ietf.org/html/rfc7468#section-13).
+   * 
+ * + * string pem = 1; + */ + com.google.protobuf.ByteString + getPemBytes(); + + /** + *
+   * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+   * with this key.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + int getAlgorithmValue(); + /** + *
+   * The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated
+   * with this key.
+   * 
+ * + * .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; + */ + com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm getAlgorithm(); +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/resources.proto b/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/resources.proto index 212842650941..0bd39ef2678c 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/resources.proto +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // 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. +// syntax = "proto3"; @@ -45,9 +46,9 @@ message KeyRing { // A [CryptoKey][google.cloud.kms.v1.CryptoKey] is made up of one or more [versions][google.cloud.kms.v1.CryptoKeyVersion], which // represent the actual key material used in cryptographic operations. message CryptoKey { - // [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] describes the capabilities of a [CryptoKey][google.cloud.kms.v1.CryptoKey]. Two - // keys with the same purpose may use different underlying algorithms, but - // must support the same set of operations. + // [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] describes the cryptographic capabilities of a + // [CryptoKey][google.cloud.kms.v1.CryptoKey]. A given key can only be used for the operations allowed by + // its purpose. enum CryptoKeyPurpose { // Not specified. CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0; @@ -56,6 +57,16 @@ message CryptoKey { // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. ENCRYPT_DECRYPT = 1; + + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + // [AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign] and + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + ASYMMETRIC_SIGN = 5; + + // [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + // [AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt] and + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + ASYMMETRIC_DECRYPT = 6; } // Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format @@ -68,10 +79,13 @@ message CryptoKey { // // The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via // [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + // + // All keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] have a + // primary. For other keys, this field will be omitted. CryptoKeyVersion primary = 2; - // The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable - // purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + // The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. CryptoKeyPurpose purpose = 3; // Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. @@ -86,6 +100,10 @@ message CryptoKey { // [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and // [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] // do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + // + // Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + // automatic rotation. For other keys, this field must be omitted. google.protobuf.Timestamp next_rotation_time = 7; // Controls the rate of automatic rotation. @@ -94,33 +112,155 @@ message CryptoKey { // automatically rotates a key. Must be at least one day. // // If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + // + // Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support + // automatic rotation. For other keys, this field must be omitted. google.protobuf.Duration rotation_period = 8; } + // A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. + // The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either + // [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or + // auto-rotation are controlled by this template. + CryptoKeyVersionTemplate version_template = 11; + // Labels with user-defined metadata. For more information, see // [Labeling Keys](/kms/docs/labeling-keys). map labels = 10; } +// A [CryptoKeyVersionTemplate][google.cloud.kms.v1.CryptoKeyVersionTemplate] specifies the properties to use when creating +// a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], either manually with +// [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or +// automatically as a result of auto-rotation. +message CryptoKeyVersionTemplate { + // [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on + // this template. Immutable. Defaults to [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE]. + ProtectionLevel protection_level = 1; + + // Required. [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] to use + // when creating a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] based on this template. + // + // For backwards compatibility, GOOGLE_SYMMETRIC_ENCRYPTION is implied if both + // this field is omitted and [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 3; +} + +// Contains an HSM-generated attestation about a key operation. +message KeyOperationAttestation { + // Attestion formats provided by the HSM. + enum AttestationFormat { + ATTESTATION_FORMAT_UNSPECIFIED = 0; + + // Cavium HSM attestation compressed with gzip. Note that this format is + // defined by Cavium and subject to change at any time. + CAVIUM_V1_COMPRESSED = 3; + } + + // Output only. The format of the attestation data. + AttestationFormat format = 4; + + // Output only. The attestation data provided by the HSM when the key + // operation was performed. + bytes content = 5; +} + // A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents an individual cryptographic key, and the // associated key material. // -// It can be used for cryptographic operations either directly, or via its -// parent [CryptoKey][google.cloud.kms.v1.CryptoKey], in which case the server will choose the appropriate -// version for the operation. +// An [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] version can be +// used for cryptographic operations. // // For security reasons, the raw cryptographic key material represented by a // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] can never be viewed or exported. It can only be used to -// encrypt or decrypt data when an authorized user or application invokes Cloud -// KMS. +// encrypt, decrypt, or sign data when an authorized user or application invokes +// Cloud KMS. message CryptoKeyVersion { + // The algorithm of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], indicating what + // parameters must be used for each cryptographic operation. + // + // The + // [GOOGLE_SYMMETRIC_ENCRYPTION][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.GOOGLE_SYMMETRIC_ENCRYPTION] + // algorithm is usable with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + // + // Algorithms beginning with "RSA_SIGN_" are usable with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN]. + // + // The fields in the name after "RSA_SIGN_" correspond to the following + // parameters: padding algorithm, modulus bit length, and digest algorithm. + // + // For PSS, the salt length used is equal to the length of digest + // algorithm. For example, + // [RSA_SIGN_PSS_2048_SHA256][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm.RSA_SIGN_PSS_2048_SHA256] + // will use PSS with a salt length of 256 bits or 32 bytes. + // + // Algorithms beginning with "RSA_DECRYPT_" are usable with + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + // + // The fields in the name after "RSA_DECRYPT_" correspond to the following + // parameters: padding algorithm, modulus bit length, and digest algorithm. + // + // Algorithms beginning with "EC_SIGN_" are usable with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN]. + // + // The fields in the name after "EC_SIGN_" correspond to the following + // parameters: elliptic curve, digest algorithm. + enum CryptoKeyVersionAlgorithm { + // Not specified. + CRYPTO_KEY_VERSION_ALGORITHM_UNSPECIFIED = 0; + + // Creates symmetric encryption keys. + GOOGLE_SYMMETRIC_ENCRYPTION = 1; + + // RSASSA-PSS 2048 bit key with a SHA256 digest. + RSA_SIGN_PSS_2048_SHA256 = 2; + + // RSASSA-PSS 3072 bit key with a SHA256 digest. + RSA_SIGN_PSS_3072_SHA256 = 3; + + // RSASSA-PSS 4096 bit key with a SHA256 digest. + RSA_SIGN_PSS_4096_SHA256 = 4; + + // RSASSA-PKCS1-v1_5 with a 2048 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_2048_SHA256 = 5; + + // RSASSA-PKCS1-v1_5 with a 3072 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_3072_SHA256 = 6; + + // RSASSA-PKCS1-v1_5 with a 4096 bit key and a SHA256 digest. + RSA_SIGN_PKCS1_4096_SHA256 = 7; + + // RSAES-OAEP 2048 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_2048_SHA256 = 8; + + // RSAES-OAEP 3072 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_3072_SHA256 = 9; + + // RSAES-OAEP 4096 bit key with a SHA256 digest. + RSA_DECRYPT_OAEP_4096_SHA256 = 10; + + // ECDSA on the NIST P-256 curve with a SHA256 digest. + EC_SIGN_P256_SHA256 = 12; + + // ECDSA on the NIST P-384 curve with a SHA384 digest. + EC_SIGN_P384_SHA384 = 13; + } + // The state of a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], indicating if it can be used. enum CryptoKeyVersionState { // Not specified. CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0; - // This version may be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and - // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] requests. + // This version is still being generated. It may not be used, enabled, + // disabled, or destroyed yet. Cloud KMS will automatically mark this + // version [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] as soon as the version is ready. + PENDING_GENERATION = 5; + + // This version may be used for cryptographic operations. ENABLED = 1; // This version may not be used, but the key material is still available, @@ -138,6 +278,20 @@ message CryptoKeyVersion { DESTROY_SCHEDULED = 4; } + // A view for [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]s. Controls the level of detail returned + // for [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] in + // [KeyManagementService.ListCryptoKeyVersions][google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions] and + // [KeyManagementService.ListCryptoKeys][google.cloud.kms.v1.KeyManagementService.ListCryptoKeys]. + enum CryptoKeyVersionView { + // Default view for each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Does not include + // the [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation] field. + CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED = 0; + + // Provides all fields in each [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], including the + // [attestation][google.cloud.kms.v1.CryptoKeyVersion.attestation]. + FULL = 1; + } + // Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format // `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. string name = 1; @@ -145,9 +299,27 @@ message CryptoKeyVersion { // The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. CryptoKeyVersionState state = 3; + // Output only. The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] describing how crypto operations are + // performed with this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + ProtectionLevel protection_level = 7; + + // Output only. The [CryptoKeyVersionAlgorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] that this + // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] supports. + CryptoKeyVersionAlgorithm algorithm = 10; + + // Output only. Statement that was generated and signed by the HSM at key + // creation time. Use this statement to verify attributes of the key as stored + // on the HSM, independently of Google. Only provided for key versions with + // [protection_level][google.cloud.kms.v1.CryptoKeyVersion.protection_level] [HSM][google.cloud.kms.v1.ProtectionLevel.HSM]. + KeyOperationAttestation attestation = 8; + // Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. google.protobuf.Timestamp create_time = 4; + // Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material was + // generated. + google.protobuf.Timestamp generate_time = 11; + // Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled // for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. @@ -158,3 +330,30 @@ message CryptoKeyVersion { // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. google.protobuf.Timestamp destroy_event_time = 6; } + +// The public key for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Obtained via +// [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. +message PublicKey { + // The public key, encoded in PEM format. For more information, see the + // [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for + // [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and + // [Textual Encoding of Subject Public Key Info] + // (https://tools.ietf.org/html/rfc7468#section-13). + string pem = 1; + + // The [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm] associated + // with this key. + CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2; +} + +// [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] specifies how cryptographic operations are performed. +enum ProtectionLevel { + // Not specified. + PROTECTION_LEVEL_UNSPECIFIED = 0; + + // Crypto operations are performed in software. + SOFTWARE = 1; + + // Crypto operations are performed in a Hardware Security Module. + HSM = 2; +} diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/service.proto b/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/service.proto index 682c95fc8508..22026578c0f3 100644 --- a/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/service.proto +++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2018 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // 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. +// syntax = "proto3"; @@ -39,48 +40,81 @@ option php_namespace = "Google\\Cloud\\Kms\\V1"; // * [KeyRing][google.cloud.kms.v1.KeyRing] // * [CryptoKey][google.cloud.kms.v1.CryptoKey] // * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] +// +// If you are using manual gRPC libraries, see +// [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc). service KeyManagementService { // Lists [KeyRings][google.cloud.kms.v1.KeyRing]. rpc ListKeyRings(ListKeyRingsRequest) returns (ListKeyRingsResponse) { - option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/keyRings" }; + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/keyRings" + }; } // Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. rpc ListCryptoKeys(ListCryptoKeysRequest) returns (ListCryptoKeysResponse) { - option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys" }; + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys" + }; } // Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. rpc ListCryptoKeyVersions(ListCryptoKeyVersionsRequest) returns (ListCryptoKeyVersionsResponse) { - option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions" }; + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions" + }; } // Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. rpc GetKeyRing(GetKeyRingRequest) returns (KeyRing) { - option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/keyRings/*}" }; + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/keyRings/*}" + }; } // Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its // [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. rpc GetCryptoKey(GetCryptoKeyRequest) returns (CryptoKey) { - option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}" }; + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}" + }; } // Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. rpc GetCryptoKeyVersion(GetCryptoKeyVersionRequest) returns (CryptoKeyVersion) { - option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}" }; + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}" + }; + } + + // Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + rpc GetPublicKey(GetPublicKeyRequest) returns (PublicKey) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey" + }; } // Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location. rpc CreateKeyRing(CreateKeyRingRequest) returns (KeyRing) { - option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/keyRings" body: "key_ring" }; + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/keyRings" + body: "key_ring" + }; } // Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. // - // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + // [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + // are required. rpc CreateCryptoKey(CreateCryptoKeyRequest) returns (CryptoKey) { - option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys" body: "crypto_key" }; + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys" + body: "crypto_key" + }; } // Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. @@ -89,12 +123,18 @@ service KeyManagementService { // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. rpc CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest) returns (CryptoKeyVersion) { - option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions" body: "crypto_key_version" }; + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions" + body: "crypto_key_version" + }; } // Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. rpc UpdateCryptoKey(UpdateCryptoKeyRequest) returns (CryptoKey) { - option (google.api.http) = { patch: "/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}" body: "crypto_key" }; + option (google.api.http) = { + patch: "/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}" + body: "crypto_key" + }; } // Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. @@ -105,22 +145,59 @@ service KeyManagementService { // method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to // move between other states. rpc UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest) returns (CryptoKeyVersion) { - option (google.api.http) = { patch: "/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}" body: "crypto_key_version" }; + option (google.api.http) = { + patch: "/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}" + body: "crypto_key_version" + }; } // Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + // The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. rpc Encrypt(EncryptRequest) returns (EncryptResponse) { - option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt" body: "*" }; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt" + body: "*" + }; } - // Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + // Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. rpc Decrypt(DecryptRequest) returns (DecryptResponse) { - option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt" body: "*" }; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt" + body: "*" + }; + } + + // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] + // ASYMMETRIC_SIGN, producing a signature that can be verified with the public + // key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + rpc AsymmetricSign(AsymmetricSignRequest) returns (AsymmetricSignResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign" + body: "*" + }; + } + + // Decrypts data that was encrypted with a public key retrieved from + // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT. + rpc AsymmetricDecrypt(AsymmetricDecryptRequest) returns (AsymmetricDecryptResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt" + body: "*" + }; } - // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + // + // Returns an error if called on an asymmetric key. rpc UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest) returns (CryptoKey) { - option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion" body: "*" }; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion" + body: "*" + }; } // Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. @@ -136,18 +213,24 @@ service KeyManagementService { // Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process. rpc DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest) returns (CryptoKeyVersion) { - option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy" body: "*" }; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy" + body: "*" + }; } // Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] // state. // // Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] // will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared. rpc RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest) returns (CryptoKeyVersion) { - option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore" body: "*" }; + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore" + body: "*" + }; } } @@ -183,6 +266,9 @@ message ListCryptoKeysRequest { // Optional pagination token, returned earlier via // [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]. string page_token = 3; + + // The fields of the primary version to include in the response. + CryptoKeyVersion.CryptoKeyVersionView version_view = 4; } // Request message for [KeyManagementService.ListCryptoKeyVersions][google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions]. @@ -201,6 +287,9 @@ message ListCryptoKeyVersionsRequest { // Optional pagination token, returned earlier via // [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]. string page_token = 3; + + // The fields to include in the response. + CryptoKeyVersion.CryptoKeyVersionView view = 4; } // Response message for [KeyManagementService.ListKeyRings][google.cloud.kms.v1.KeyManagementService.ListKeyRings]. @@ -262,6 +351,13 @@ message GetCryptoKeyVersionRequest { string name = 1; } +// Request message for [KeyManagementService.GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. +message GetPublicKeyRequest { + // The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to + // get. + string name = 1; +} + // Request message for [KeyManagementService.CreateKeyRing][google.cloud.kms.v1.KeyManagementService.CreateKeyRing]. message CreateKeyRingRequest { // Required. The resource name of the location associated with the @@ -328,11 +424,24 @@ message EncryptRequest { string name = 1; // Required. The data to encrypt. Must be no larger than 64KiB. + // + // The maximum size depends on the key version's + // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For + // [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no larger + // than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the + // plaintext and additional_authenticated_data fields must be no larger than + // 8KiB. bytes plaintext = 2; // Optional data that, if specified, must also be provided during decryption - // through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. Must be no - // larger than 64KiB. + // through [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]. + // + // The maximum size depends on the key version's + // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For + // [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD must be no larger than + // 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of the + // plaintext and additional_authenticated_data fields must be no larger than + // 8KiB. bytes additional_authenticated_data = 3; } @@ -351,6 +460,28 @@ message DecryptRequest { bytes additional_authenticated_data = 3; } +// Request message for [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign]. +message AsymmetricSignRequest { + // Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. + string name = 1; + + // Required. The digest of the data to sign. The digest must be produced with + // the same digest algorithm as specified by the key version's + // [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + Digest digest = 3; +} + +// Request message for [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt]. +message AsymmetricDecryptRequest { + // Required. The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for + // decryption. + string name = 1; + + // Required. The data encrypted with the named [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public + // key using OAEP. + bytes ciphertext = 3; +} + // Response message for [KeyManagementService.Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. message DecryptResponse { // The decrypted data originally supplied in [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. @@ -366,6 +497,18 @@ message EncryptResponse { bytes ciphertext = 2; } +// Response message for [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign]. +message AsymmetricSignResponse { + // The created signature. + bytes signature = 1; +} + +// Response message for [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt]. +message AsymmetricDecryptResponse { + // The decrypted data originally encrypted with the matching public key. + bytes plaintext = 1; +} + // Request message for [KeyManagementService.UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. message UpdateCryptoKeyPrimaryVersionRequest { // The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to update. @@ -386,3 +529,26 @@ message RestoreCryptoKeyVersionRequest { // The resource name of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore. string name = 1; } + +// A [Digest][google.cloud.kms.v1.Digest] holds a cryptographic message digest. +message Digest { + // Required. The message digest. + oneof digest { + // A message digest produced with the SHA-256 algorithm. + bytes sha256 = 1; + + // A message digest produced with the SHA-384 algorithm. + bytes sha384 = 2; + + // A message digest produced with the SHA-512 algorithm. + bytes sha512 = 3; + } +} + +// Cloud KMS metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. +message LocationMetadata { + // Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with + // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] + // [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this location. + bool hsm_available = 1; +} diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java index b0b9caefbc2a..5cc716c7d21d 100644 --- a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java +++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java @@ -235,7 +235,7 @@ public final OperationsClient getOperationsClient() { * @param clusters The clusters to be created within the instance, mapped by desired cluster ID, * e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. Fields marked `OutputOnly` - * must be left blank. Currently exactly one cluster must be specified. + * must be left blank. Currently, at most two clusters can be specified. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( @@ -277,7 +277,7 @@ public final OperationFuture createInstanceAsy * @param clusters The clusters to be created within the instance, mapped by desired cluster ID, * e.g., just `mycluster` rather than * `projects/myproject/instances/myinstance/clusters/mycluster`. Fields marked `OutputOnly` - * must be left blank. Currently exactly one cluster must be specified. + * must be left blank. Currently, at most two clusters can be specified. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @BetaApi( @@ -1520,7 +1520,9 @@ public final UnaryCallable getAppProfileCallab *
* * @param parent The unique name of the instance for which a list of app profiles is requested. - * Values are of the form `projects/<project>/instances/<instance>`. + * Values are of the form `projects/<project>/instances/<instance>`. Use + * `<instance> = '-'` to list AppProfiles for all Instances in a project, e.g., + * `projects/myproject/instances/-`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAppProfilesPagedResponse listAppProfiles(InstanceName parent) { @@ -1547,7 +1549,9 @@ public final ListAppProfilesPagedResponse listAppProfiles(InstanceName parent) { *
* * @param parent The unique name of the instance for which a list of app profiles is requested. - * Values are of the form `projects/<project>/instances/<instance>`. + * Values are of the form `projects/<project>/instances/<instance>`. Use + * `<instance> = '-'` to list AppProfiles for all Instances in a project, e.g., + * `projects/myproject/instances/-`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAppProfilesPagedResponse listAppProfiles(String parent) { diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 5a2a03039fb3..9289801b5444 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -309,26 +309,11 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { - builder - .readRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming")); - - builder - .sampleRowKeysSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder .mutateRowSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .mutateRowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder .checkAndMutateRowSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java index 36eac47a77c8..fb324fff3426 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/v1beta1/stub/FirestoreStubSettings.java @@ -543,11 +543,6 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .batchGetDocumentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming")); - builder .beginTransactionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) @@ -563,11 +558,6 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .runQuerySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder .listCollectionIdsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java index fc65fe176564..40b59707ae22 100644 --- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java +++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java @@ -49,6 +49,9 @@ *

* [KeyRing][google.cloud.kms.v1.KeyRing] * [CryptoKey][google.cloud.kms.v1.CryptoKey] * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] * + *

If you are using manual gRPC libraries, see [Using gRPC with Cloud + * KMS](https://cloud.google.com/kms/docs/grpc). + * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * @@ -978,7 +981,9 @@ public final UnaryCallable createKeyRingCallable( * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a * [KeyRing][google.cloud.kms.v1.KeyRing]. * - *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. * *

Sample code: * @@ -1028,7 +1033,9 @@ public final CryptoKey createCryptoKey( * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a * [KeyRing][google.cloud.kms.v1.KeyRing]. * - *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. * *

Sample code: * @@ -1077,7 +1084,9 @@ public final CryptoKey createCryptoKey(String parent, String cryptoKeyId, Crypto * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a * [KeyRing][google.cloud.kms.v1.KeyRing]. * - *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. * *

Sample code: * @@ -1120,7 +1129,9 @@ public final CryptoKey createCryptoKey(CreateCryptoKeyRequest request) { * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a * [KeyRing][google.cloud.kms.v1.KeyRing]. * - *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *

[CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and + * [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm] + * are required. * *

Sample code: * @@ -1475,7 +1486,9 @@ public final CryptoKeyVersion updateCryptoKeyVersion(UpdateCryptoKeyVersionReque // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1492,6 +1505,12 @@ public final CryptoKeyVersion updateCryptoKeyVersion(UpdateCryptoKeyVersionReque *

If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its * [primary version][google.cloud.kms.v1.CryptoKey.primary]. * @param plaintext Required. The data to encrypt. Must be no larger than 64KiB. + *

The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no + * larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined + * length of the plaintext and additional_authenticated_data fields must be no larger than + * 8KiB. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EncryptResponse encrypt(CryptoKeyPathName name, ByteString plaintext) { @@ -1507,7 +1526,9 @@ public final EncryptResponse encrypt(CryptoKeyPathName name, ByteString plaintex // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1524,6 +1545,12 @@ public final EncryptResponse encrypt(CryptoKeyPathName name, ByteString plaintex *

If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server will use its * [primary version][google.cloud.kms.v1.CryptoKey.primary]. * @param plaintext Required. The data to encrypt. Must be no larger than 64KiB. + *

The maximum size depends on the key version's + * [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]. For + * [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the plaintext must be no + * larger than 64KiB. For [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined + * length of the plaintext and additional_authenticated_data fields must be no larger than + * 8KiB. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EncryptResponse encrypt(String name, ByteString plaintext) { @@ -1536,7 +1563,9 @@ public final EncryptResponse encrypt(String name, ByteString plaintext) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1562,7 +1591,9 @@ public final EncryptResponse encrypt(EncryptRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Encrypts data, so that it can only be recovered by a call to - * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1587,7 +1618,9 @@ public final UnaryCallable encryptCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Decrypts data that was protected by - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1618,7 +1651,9 @@ public final DecryptResponse decrypt(CryptoKeyName name, ByteString ciphertext) // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Decrypts data that was protected by - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1646,7 +1681,9 @@ public final DecryptResponse decrypt(String name, ByteString ciphertext) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Decrypts data that was protected by - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1672,7 +1709,9 @@ public final DecryptResponse decrypt(DecryptRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Decrypts data that was protected by - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. * *

Sample code: * @@ -1697,7 +1736,9 @@ public final UnaryCallable decryptCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + *

Returns an error if called on an asymmetric key. * *

Sample code: * @@ -1728,7 +1769,9 @@ public final CryptoKey updateCryptoKeyPrimaryVersion( // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + *

Returns an error if called on an asymmetric key. * *

Sample code: * @@ -1758,7 +1801,9 @@ public final CryptoKey updateCryptoKeyPrimaryVersion(String name, String cryptoK // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + *

Returns an error if called on an asymmetric key. * *

Sample code: * @@ -1785,7 +1830,9 @@ public final CryptoKey updateCryptoKeyPrimaryVersion( // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in - * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + * + *

Returns an error if called on an asymmetric key. * *

Sample code: * @@ -1959,7 +2006,7 @@ private final CryptoKeyVersion destroyCryptoKeyVersion(DestroyCryptoKeyVersionRe // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] * state. * *

Upon restoration of the CryptoKeyVersion, @@ -1992,7 +2039,7 @@ public final CryptoKeyVersion restoreCryptoKeyVersion(CryptoKeyVersionName name) // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] * state. * *

Upon restoration of the CryptoKeyVersion, @@ -2023,7 +2070,7 @@ public final CryptoKeyVersion restoreCryptoKeyVersion(String name) { // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] * state. * *

Upon restoration of the CryptoKeyVersion, @@ -2053,7 +2100,7 @@ private final CryptoKeyVersion restoreCryptoKeyVersion(RestoreCryptoKeyVersionRe // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the - * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] * state. * *

Upon restoration of the CryptoKeyVersion, @@ -2080,6 +2127,351 @@ private final CryptoKeyVersion restoreCryptoKeyVersion(RestoreCryptoKeyVersionRe return stub.restoreCryptoKeyVersionCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   PublicKey response = keyManagementServiceClient.getPublicKey(name);
+   * }
+   * 
+ * + * @param name The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PublicKey getPublicKey(CryptoKeyVersionName name) { + + GetPublicKeyRequest request = + GetPublicKeyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   PublicKey response = keyManagementServiceClient.getPublicKey(name.toString());
+   * }
+   * 
+ * + * @param name The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PublicKey getPublicKey(String name) { + + GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder().setName(name).build(); + return getPublicKey(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   PublicKey response = keyManagementServiceClient.getPublicKey(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PublicKey getPublicKey(GetPublicKeyRequest request) { + return getPublicKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + * The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be + * [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or + * [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<PublicKey> future = keyManagementServiceClient.getPublicKeyCallable().futureCall(request);
+   *   // Do something
+   *   PublicKey response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getPublicKeyCallable() { + return stub.getPublicKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   ByteString ciphertext = ByteString.copyFromUtf8("");
+   *   AsymmetricDecryptResponse response = keyManagementServiceClient.asymmetricDecrypt(name, ciphertext);
+   * }
+   * 
+ * + * @param name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. + * @param ciphertext Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AsymmetricDecryptResponse asymmetricDecrypt( + CryptoKeyVersionName name, ByteString ciphertext) { + + AsymmetricDecryptRequest request = + AsymmetricDecryptRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setCiphertext(ciphertext) + .build(); + return asymmetricDecrypt(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   ByteString ciphertext = ByteString.copyFromUtf8("");
+   *   AsymmetricDecryptResponse response = keyManagementServiceClient.asymmetricDecrypt(name.toString(), ciphertext);
+   * }
+   * 
+ * + * @param name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for decryption. + * @param ciphertext Required. The data encrypted with the named + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using OAEP. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AsymmetricDecryptResponse asymmetricDecrypt(String name, ByteString ciphertext) { + + AsymmetricDecryptRequest request = + AsymmetricDecryptRequest.newBuilder().setName(name).setCiphertext(ciphertext).build(); + return asymmetricDecrypt(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   ByteString ciphertext = ByteString.copyFromUtf8("");
+   *   AsymmetricDecryptRequest request = AsymmetricDecryptRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setCiphertext(ciphertext)
+   *     .build();
+   *   AsymmetricDecryptResponse response = keyManagementServiceClient.asymmetricDecrypt(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AsymmetricDecryptResponse asymmetricDecrypt(AsymmetricDecryptRequest request) { + return asymmetricDecryptCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Decrypts data that was encrypted with a public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   ByteString ciphertext = ByteString.copyFromUtf8("");
+   *   AsymmetricDecryptRequest request = AsymmetricDecryptRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setCiphertext(ciphertext)
+   *     .build();
+   *   ApiFuture<AsymmetricDecryptResponse> future = keyManagementServiceClient.asymmetricDecryptCallable().futureCall(request);
+   *   // Do something
+   *   AsymmetricDecryptResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + asymmetricDecryptCallable() { + return stub.asymmetricDecryptCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a + * signature that can be verified with the public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   Digest digest = Digest.newBuilder().build();
+   *   AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(name, digest);
+   * }
+   * 
+ * + * @param name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. + * @param digest Required. The digest of the data to sign. The digest must be produced with the + * same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Digest digest) { + + AsymmetricSignRequest request = + AsymmetricSignRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDigest(digest) + .build(); + return asymmetricSign(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a + * signature that can be verified with the public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   Digest digest = Digest.newBuilder().build();
+   *   AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(name.toString(), digest);
+   * }
+   * 
+ * + * @param name Required. The resource name of the + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing. + * @param digest Required. The digest of the data to sign. The digest must be produced with the + * same digest algorithm as specified by the key version's + * [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AsymmetricSignResponse asymmetricSign(String name, Digest digest) { + + AsymmetricSignRequest request = + AsymmetricSignRequest.newBuilder().setName(name).setDigest(digest).build(); + return asymmetricSign(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a + * signature that can be verified with the public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   Digest digest = Digest.newBuilder().build();
+   *   AsymmetricSignRequest request = AsymmetricSignRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setDigest(digest)
+   *     .build();
+   *   AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AsymmetricSignResponse asymmetricSign(AsymmetricSignRequest request) { + return asymmetricSignCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_SIGN, producing a + * signature that can be verified with the public key retrieved from + * [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]. + * + *

Sample code: + * + *


+   * try (KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.create()) {
+   *   CryptoKeyVersionName name = CryptoKeyVersionName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
+   *   Digest digest = Digest.newBuilder().build();
+   *   AsymmetricSignRequest request = AsymmetricSignRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setDigest(digest)
+   *     .build();
+   *   ApiFuture<AsymmetricSignResponse> future = keyManagementServiceClient.asymmetricSignCallable().futureCall(request);
+   *   // Do something
+   *   AsymmetricSignResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + asymmetricSignCallable() { + return stub.asymmetricSignCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Sets the access control policy on the specified resource. Replaces any existing policy. diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceSettings.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceSettings.java index f0352aabd4c0..dc804fdfc392 100644 --- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceSettings.java +++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceSettings.java @@ -162,6 +162,22 @@ public UnaryCallSettings decryptSettings() { return ((KeyManagementServiceStubSettings) getStubSettings()).restoreCryptoKeyVersionSettings(); } + /** Returns the object with the settings used for calls to getPublicKey. */ + public UnaryCallSettings getPublicKeySettings() { + return ((KeyManagementServiceStubSettings) getStubSettings()).getPublicKeySettings(); + } + + /** Returns the object with the settings used for calls to asymmetricDecrypt. */ + public UnaryCallSettings + asymmetricDecryptSettings() { + return ((KeyManagementServiceStubSettings) getStubSettings()).asymmetricDecryptSettings(); + } + + /** Returns the object with the settings used for calls to asymmetricSign. */ + public UnaryCallSettings asymmetricSignSettings() { + return ((KeyManagementServiceStubSettings) getStubSettings()).asymmetricSignSettings(); + } + /** Returns the object with the settings used for calls to setIamPolicy. */ public UnaryCallSettings setIamPolicySettings() { return ((KeyManagementServiceStubSettings) getStubSettings()).setIamPolicySettings(); @@ -369,6 +385,23 @@ public UnaryCallSettings.Builder decryptSetting return getStubSettingsBuilder().restoreCryptoKeyVersionSettings(); } + /** Returns the builder for the settings used for calls to getPublicKey. */ + public UnaryCallSettings.Builder getPublicKeySettings() { + return getStubSettingsBuilder().getPublicKeySettings(); + } + + /** Returns the builder for the settings used for calls to asymmetricDecrypt. */ + public UnaryCallSettings.Builder + asymmetricDecryptSettings() { + return getStubSettingsBuilder().asymmetricDecryptSettings(); + } + + /** Returns the builder for the settings used for calls to asymmetricSign. */ + public UnaryCallSettings.Builder + asymmetricSignSettings() { + return getStubSettingsBuilder().asymmetricSignSettings(); + } + /** Returns the builder for the settings used for calls to setIamPolicy. */ public UnaryCallSettings.Builder setIamPolicySettings() { return getStubSettingsBuilder().setIamPolicySettings(); diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/package-info.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/package-info.java index 54b961c22d45..ed754e8915c0 100644 --- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/package-info.java +++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/package-info.java @@ -15,7 +15,7 @@ */ /** - * A client to Google Cloud Key Management Service (KMS) API. + * A client to Cloud Key Management Service (KMS) API. * *

The interfaces provided are listed below, along with usage samples. * @@ -29,6 +29,9 @@ *

* [KeyRing][google.cloud.kms.v1.KeyRing] * [CryptoKey][google.cloud.kms.v1.CryptoKey] * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] * + *

If you are using manual gRPC libraries, see [Using gRPC with Cloud + * KMS](https://cloud.google.com/kms/docs/grpc). + * *

Sample for KeyManagementServiceClient: * *

diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java
index 7d0141c2a063..5a3d96704731 100644
--- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java
+++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java
@@ -37,7 +37,7 @@
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS
 /**
- * gRPC callable factory implementation for Google Cloud Key Management Service (KMS) API.
+ * gRPC callable factory implementation for Cloud Key Management Service (KMS) API.
  *
  * 

This class is for advanced usage. */ diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java index 42ea2ace8ff0..39dc03da5b31 100644 --- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java +++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java @@ -27,6 +27,10 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.kms.v1.AsymmetricDecryptRequest; +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.AsymmetricSignRequest; +import com.google.cloud.kms.v1.AsymmetricSignResponse; import com.google.cloud.kms.v1.CreateCryptoKeyRequest; import com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest; import com.google.cloud.kms.v1.CreateKeyRingRequest; @@ -40,6 +44,7 @@ import com.google.cloud.kms.v1.GetCryptoKeyRequest; import com.google.cloud.kms.v1.GetCryptoKeyVersionRequest; import com.google.cloud.kms.v1.GetKeyRingRequest; +import com.google.cloud.kms.v1.GetPublicKeyRequest; import com.google.cloud.kms.v1.KeyRing; import com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest; import com.google.cloud.kms.v1.ListCryptoKeyVersionsResponse; @@ -47,6 +52,7 @@ import com.google.cloud.kms.v1.ListCryptoKeysResponse; import com.google.cloud.kms.v1.ListKeyRingsRequest; import com.google.cloud.kms.v1.ListKeyRingsResponse; +import com.google.cloud.kms.v1.PublicKey; import com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; import com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; import com.google.cloud.kms.v1.UpdateCryptoKeyRequest; @@ -66,7 +72,7 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS /** - * gRPC stub implementation for Google Cloud Key Management Service (KMS) API. + * gRPC stub implementation for Cloud Key Management Service (KMS) API. * *

This class is for advanced usage and reflects the underlying API directly. */ @@ -214,6 +220,34 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { ProtoUtils.marshaller(RestoreCryptoKeyVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(CryptoKeyVersion.getDefaultInstance())) .build(); + private static final MethodDescriptor + getPublicKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.kms.v1.KeyManagementService/GetPublicKey") + .setRequestMarshaller(ProtoUtils.marshaller(GetPublicKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PublicKey.getDefaultInstance())) + .build(); + private static final MethodDescriptor + asymmetricDecryptMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.kms.v1.KeyManagementService/AsymmetricDecrypt") + .setRequestMarshaller( + ProtoUtils.marshaller(AsymmetricDecryptRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AsymmetricDecryptResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + asymmetricSignMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.kms.v1.KeyManagementService/AsymmetricSign") + .setRequestMarshaller( + ProtoUtils.marshaller(AsymmetricSignRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AsymmetricSignResponse.getDefaultInstance())) + .build(); private static final MethodDescriptor setIamPolicyMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -270,6 +304,10 @@ public class GrpcKeyManagementServiceStub extends KeyManagementServiceStub { destroyCryptoKeyVersionCallable; private final UnaryCallable restoreCryptoKeyVersionCallable; + private final UnaryCallable getPublicKeyCallable; + private final UnaryCallable + asymmetricDecryptCallable; + private final UnaryCallable asymmetricSignCallable; private final UnaryCallable setIamPolicyCallable; private final UnaryCallable getIamPolicyCallable; private final UnaryCallable @@ -536,6 +574,47 @@ public Map extract(RestoreCryptoKeyVersionRequest request) { } }) .build(); + GrpcCallSettings getPublicKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPublicKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetPublicKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + asymmetricDecryptTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(asymmetricDecryptMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AsymmetricDecryptRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + asymmetricSignTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(asymmetricSignMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AsymmetricSignRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); GrpcCallSettings setIamPolicyTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(setIamPolicyMethodDescriptor) @@ -650,6 +729,17 @@ public Map extract(TestIamPermissionsRequest request) { restoreCryptoKeyVersionTransportSettings, settings.restoreCryptoKeyVersionSettings(), clientContext); + this.getPublicKeyCallable = + callableFactory.createUnaryCallable( + getPublicKeyTransportSettings, settings.getPublicKeySettings(), clientContext); + this.asymmetricDecryptCallable = + callableFactory.createUnaryCallable( + asymmetricDecryptTransportSettings, + settings.asymmetricDecryptSettings(), + clientContext); + this.asymmetricSignCallable = + callableFactory.createUnaryCallable( + asymmetricSignTransportSettings, settings.asymmetricSignSettings(), clientContext); this.setIamPolicyCallable = callableFactory.createUnaryCallable( setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); @@ -749,6 +839,19 @@ public UnaryCallable decryptCallable() { return restoreCryptoKeyVersionCallable; } + public UnaryCallable getPublicKeyCallable() { + return getPublicKeyCallable; + } + + public UnaryCallable + asymmetricDecryptCallable() { + return asymmetricDecryptCallable; + } + + public UnaryCallable asymmetricSignCallable() { + return asymmetricSignCallable; + } + public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java index 4ceeb1a57abb..1bb034fd9401 100644 --- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java +++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java @@ -22,6 +22,10 @@ import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.kms.v1.AsymmetricDecryptRequest; +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.AsymmetricSignRequest; +import com.google.cloud.kms.v1.AsymmetricSignResponse; import com.google.cloud.kms.v1.CreateCryptoKeyRequest; import com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest; import com.google.cloud.kms.v1.CreateKeyRingRequest; @@ -35,6 +39,7 @@ import com.google.cloud.kms.v1.GetCryptoKeyRequest; import com.google.cloud.kms.v1.GetCryptoKeyVersionRequest; import com.google.cloud.kms.v1.GetKeyRingRequest; +import com.google.cloud.kms.v1.GetPublicKeyRequest; import com.google.cloud.kms.v1.KeyRing; import com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest; import com.google.cloud.kms.v1.ListCryptoKeyVersionsResponse; @@ -42,6 +47,7 @@ import com.google.cloud.kms.v1.ListCryptoKeysResponse; import com.google.cloud.kms.v1.ListKeyRingsRequest; import com.google.cloud.kms.v1.ListKeyRingsResponse; +import com.google.cloud.kms.v1.PublicKey; import com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; import com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; import com.google.cloud.kms.v1.UpdateCryptoKeyRequest; @@ -55,7 +61,7 @@ // AUTO-GENERATED DOCUMENTATION AND CLASS /** - * Base stub class for Google Cloud Key Management Service (KMS) API. + * Base stub class for Cloud Key Management Service (KMS) API. * *

This class is for advanced usage and reflects the underlying API directly. */ @@ -149,6 +155,19 @@ public UnaryCallable decryptCallable() { throw new UnsupportedOperationException("Not implemented: restoreCryptoKeyVersionCallable()"); } + public UnaryCallable getPublicKeyCallable() { + throw new UnsupportedOperationException("Not implemented: getPublicKeyCallable()"); + } + + public UnaryCallable + asymmetricDecryptCallable() { + throw new UnsupportedOperationException("Not implemented: asymmetricDecryptCallable()"); + } + + public UnaryCallable asymmetricSignCallable() { + throw new UnsupportedOperationException("Not implemented: asymmetricSignCallable()"); + } + public UnaryCallable setIamPolicyCallable() { throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); } diff --git a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java index 53817ce8b7fb..6167c54a1311 100644 --- a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java +++ b/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java @@ -41,6 +41,10 @@ import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.kms.v1.AsymmetricDecryptRequest; +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.AsymmetricSignRequest; +import com.google.cloud.kms.v1.AsymmetricSignResponse; import com.google.cloud.kms.v1.CreateCryptoKeyRequest; import com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest; import com.google.cloud.kms.v1.CreateKeyRingRequest; @@ -54,6 +58,7 @@ import com.google.cloud.kms.v1.GetCryptoKeyRequest; import com.google.cloud.kms.v1.GetCryptoKeyVersionRequest; import com.google.cloud.kms.v1.GetKeyRingRequest; +import com.google.cloud.kms.v1.GetPublicKeyRequest; import com.google.cloud.kms.v1.KeyRing; import com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest; import com.google.cloud.kms.v1.ListCryptoKeyVersionsResponse; @@ -61,6 +66,7 @@ import com.google.cloud.kms.v1.ListCryptoKeysResponse; import com.google.cloud.kms.v1.ListKeyRingsRequest; import com.google.cloud.kms.v1.ListKeyRingsResponse; +import com.google.cloud.kms.v1.PublicKey; import com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; import com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; import com.google.cloud.kms.v1.UpdateCryptoKeyRequest; @@ -142,6 +148,11 @@ public class KeyManagementServiceStubSettings destroyCryptoKeyVersionSettings; private final UnaryCallSettings restoreCryptoKeyVersionSettings; + private final UnaryCallSettings getPublicKeySettings; + private final UnaryCallSettings + asymmetricDecryptSettings; + private final UnaryCallSettings + asymmetricSignSettings; private final UnaryCallSettings setIamPolicySettings; private final UnaryCallSettings getIamPolicySettings; private final UnaryCallSettings @@ -239,6 +250,22 @@ public UnaryCallSettings decryptSettings() { return restoreCryptoKeyVersionSettings; } + /** Returns the object with the settings used for calls to getPublicKey. */ + public UnaryCallSettings getPublicKeySettings() { + return getPublicKeySettings; + } + + /** Returns the object with the settings used for calls to asymmetricDecrypt. */ + public UnaryCallSettings + asymmetricDecryptSettings() { + return asymmetricDecryptSettings; + } + + /** Returns the object with the settings used for calls to asymmetricSign. */ + public UnaryCallSettings asymmetricSignSettings() { + return asymmetricSignSettings; + } + /** Returns the object with the settings used for calls to setIamPolicy. */ public UnaryCallSettings setIamPolicySettings() { return setIamPolicySettings; @@ -340,6 +367,9 @@ protected KeyManagementServiceStubSettings(Builder settingsBuilder) throws IOExc settingsBuilder.updateCryptoKeyPrimaryVersionSettings().build(); destroyCryptoKeyVersionSettings = settingsBuilder.destroyCryptoKeyVersionSettings().build(); restoreCryptoKeyVersionSettings = settingsBuilder.restoreCryptoKeyVersionSettings().build(); + getPublicKeySettings = settingsBuilder.getPublicKeySettings().build(); + asymmetricDecryptSettings = settingsBuilder.asymmetricDecryptSettings().build(); + asymmetricSignSettings = settingsBuilder.asymmetricSignSettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); @@ -545,6 +575,11 @@ public static class Builder destroyCryptoKeyVersionSettings; private final UnaryCallSettings.Builder restoreCryptoKeyVersionSettings; + private final UnaryCallSettings.Builder getPublicKeySettings; + private final UnaryCallSettings.Builder + asymmetricDecryptSettings; + private final UnaryCallSettings.Builder + asymmetricSignSettings; private final UnaryCallSettings.Builder setIamPolicySettings; private final UnaryCallSettings.Builder getIamPolicySettings; private final UnaryCallSettings.Builder @@ -624,6 +659,12 @@ protected Builder(ClientContext clientContext) { restoreCryptoKeyVersionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getPublicKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asymmetricDecryptSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + asymmetricSignSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -648,6 +689,9 @@ protected Builder(ClientContext clientContext) { updateCryptoKeyPrimaryVersionSettings, destroyCryptoKeyVersionSettings, restoreCryptoKeyVersionSettings, + getPublicKeySettings, + asymmetricDecryptSettings, + asymmetricSignSettings, setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings); @@ -746,6 +790,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getPublicKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .asymmetricDecryptSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .asymmetricSignSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .setIamPolicySettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -784,6 +843,9 @@ protected Builder(KeyManagementServiceStubSettings settings) { settings.updateCryptoKeyPrimaryVersionSettings.toBuilder(); destroyCryptoKeyVersionSettings = settings.destroyCryptoKeyVersionSettings.toBuilder(); restoreCryptoKeyVersionSettings = settings.restoreCryptoKeyVersionSettings.toBuilder(); + getPublicKeySettings = settings.getPublicKeySettings.toBuilder(); + asymmetricDecryptSettings = settings.asymmetricDecryptSettings.toBuilder(); + asymmetricSignSettings = settings.asymmetricSignSettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); @@ -806,6 +868,9 @@ protected Builder(KeyManagementServiceStubSettings settings) { updateCryptoKeyPrimaryVersionSettings, destroyCryptoKeyVersionSettings, restoreCryptoKeyVersionSettings, + getPublicKeySettings, + asymmetricDecryptSettings, + asymmetricSignSettings, setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings); @@ -920,6 +985,23 @@ public UnaryCallSettings.Builder decryptSetting return restoreCryptoKeyVersionSettings; } + /** Returns the builder for the settings used for calls to getPublicKey. */ + public UnaryCallSettings.Builder getPublicKeySettings() { + return getPublicKeySettings; + } + + /** Returns the builder for the settings used for calls to asymmetricDecrypt. */ + public UnaryCallSettings.Builder + asymmetricDecryptSettings() { + return asymmetricDecryptSettings; + } + + /** Returns the builder for the settings used for calls to asymmetricSign. */ + public UnaryCallSettings.Builder + asymmetricSignSettings() { + return asymmetricSignSettings; + } + /** Returns the builder for the settings used for calls to setIamPolicy. */ public UnaryCallSettings.Builder setIamPolicySettings() { return setIamPolicySettings; diff --git a/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java b/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java index 52161cd8a8a5..462c2ac52c5c 100644 --- a/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java +++ b/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java @@ -844,6 +844,143 @@ public void restoreCryptoKeyVersionExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getPublicKeyTest() { + String pem = "pem110872"; + PublicKey expectedResponse = PublicKey.newBuilder().setPem(pem).build(); + mockKeyManagementService.addResponse(expectedResponse); + + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + + PublicKey actualResponse = client.getPublicKey(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockKeyManagementService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPublicKeyRequest actualRequest = (GetPublicKeyRequest) actualRequests.get(0); + + Assert.assertEquals(name, CryptoKeyVersionName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getPublicKeyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockKeyManagementService.addException(exception); + + try { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + + client.getPublicKey(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void asymmetricDecryptTest() { + ByteString plaintext = ByteString.copyFromUtf8("-9"); + AsymmetricDecryptResponse expectedResponse = + AsymmetricDecryptResponse.newBuilder().setPlaintext(plaintext).build(); + mockKeyManagementService.addResponse(expectedResponse); + + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + ByteString ciphertext = ByteString.copyFromUtf8("-72"); + + AsymmetricDecryptResponse actualResponse = client.asymmetricDecrypt(name, ciphertext); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockKeyManagementService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AsymmetricDecryptRequest actualRequest = (AsymmetricDecryptRequest) actualRequests.get(0); + + Assert.assertEquals(name, CryptoKeyVersionName.parse(actualRequest.getName())); + Assert.assertEquals(ciphertext, actualRequest.getCiphertext()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void asymmetricDecryptExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockKeyManagementService.addException(exception); + + try { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + ByteString ciphertext = ByteString.copyFromUtf8("-72"); + + client.asymmetricDecrypt(name, ciphertext); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void asymmetricSignTest() { + ByteString signature = ByteString.copyFromUtf8("106"); + AsymmetricSignResponse expectedResponse = + AsymmetricSignResponse.newBuilder().setSignature(signature).build(); + mockKeyManagementService.addResponse(expectedResponse); + + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + Digest digest = Digest.newBuilder().build(); + + AsymmetricSignResponse actualResponse = client.asymmetricSign(name, digest); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockKeyManagementService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AsymmetricSignRequest actualRequest = (AsymmetricSignRequest) actualRequests.get(0); + + Assert.assertEquals(name, CryptoKeyVersionName.parse(actualRequest.getName())); + Assert.assertEquals(digest, actualRequest.getDigest()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void asymmetricSignExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockKeyManagementService.addException(exception); + + try { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + Digest digest = Digest.newBuilder().build(); + + client.asymmetricSign(name, digest); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void setIamPolicyTest() { diff --git a/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java b/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java index 7b9943b577d5..e9c17ef37616 100644 --- a/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java +++ b/google-cloud-clients/google-cloud-kms/src/test/java/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java @@ -146,6 +146,21 @@ public void getCryptoKeyVersion( } } + @Override + public void getPublicKey( + GetPublicKeyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof PublicKey) { + requests.add(request); + responseObserver.onNext((PublicKey) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void createKeyRing( CreateKeyRingRequest request, StreamObserver responseObserver) { @@ -249,6 +264,37 @@ public void decrypt(DecryptRequest request, StreamObserver resp } } + @Override + public void asymmetricSign( + AsymmetricSignRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AsymmetricSignResponse) { + requests.add(request); + responseObserver.onNext((AsymmetricSignResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void asymmetricDecrypt( + AsymmetricDecryptRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AsymmetricDecryptResponse) { + requests.add(request); + responseObserver.onNext((AsymmetricDecryptResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void updateCryptoKeyPrimaryVersion( UpdateCryptoKeyPrimaryVersionRequest request, StreamObserver responseObserver) { diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java index 6cf3c210e11f..901b5971a468 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/stub/SpannerStubSettings.java @@ -480,21 +480,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .executeStreamingSqlSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder .readSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder - .streamingReadSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); - builder .beginTransactionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent"))