Skip to content
Permalink
Browse files
feat: add client integrity verification fields to the KMS protos (#234)
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* Add client integrity verification fields to the KMS protos

PiperOrigin-RevId: 326100874

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Aug 11 14:22:10 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: b40e4533f841c96aac1d9d7d342514d146b5b4cb
Source-Link: googleapis/googleapis@b40e453
  • Loading branch information
yoshi-automation committed Aug 13, 2020
1 parent bf28a63 commit f4e58f23d7ec440b129ce0090bcbc5301d2e1ed8
Showing with 7,372 additions and 378 deletions.
  1. +2 −2 README.md
  2. +4 −4 google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java
  3. +25 −4 google-cloud-kms/src/test/java/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java
  4. +456 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequest.java
  5. +80 −0 ...-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequestOrBuilder.java
  6. +530 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponse.java
  7. +89 −0 ...google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptResponseOrBuilder.java
  8. +453 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequest.java
  9. +77 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignRequestOrBuilder.java
  10. +723 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponse.java
  11. +118 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricSignResponseOrBuilder.java
  12. +4 −4 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java
  13. +931 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptRequest.java
  14. +163 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptRequestOrBuilder.java
  15. +432 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptResponse.java
  16. +74 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptResponseOrBuilder.java
  17. +931 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequest.java
  18. +163 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptRequestOrBuilder.java
  19. +664 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptResponse.java
  20. +111 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/EncryptResponseOrBuilder.java
  21. +272 −237 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsProto.java
  22. +127 −122 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/KmsResourcesProto.java
  23. +597 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKey.java
  24. +97 −0 proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/PublicKeyOrBuilder.java
  25. +24 −2 proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/resources.proto
  26. +222 −0 proto-google-cloud-kms-v1/src/main/proto/google/cloud/kms/v1/service.proto
  27. +3 −3 synth.metadata
@@ -48,11 +48,11 @@ If you are using Maven without BOM, add this to your dependencies:

If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-kms:1.39.1'
compile 'com.google.cloud:google-cloud-kms:1.39.0'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-kms" % "1.39.1"
libraryDependencies += "com.google.cloud" % "google-cloud-kms" % "1.39.0"
```
[//]: # ({x-version-update-end})

@@ -529,7 +529,7 @@ public final UnaryCallable<CreateCryptoKeyRequest, CryptoKey> createCryptoKeyCal
/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* <p>Sample code:
*
@@ -617,7 +617,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
/**
* Sets the access control policy on the specified resource. Replaces any existing policy.
*
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
* <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* <p>Sample code:
*
@@ -738,7 +738,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
*
* <p>Note: This operation is designed to be used for building permission-aware UIs and
* command-line tools, not for authorization checking. This operation may "fail open" without
@@ -840,7 +840,7 @@ public final TestIamPermissionsResponse testIamPermissions(
// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error.
*
* <p>Note: This operation is designed to be used for building permission-aware UIs and
* command-line tools, not for authorization checking. This operation may "fail open" without
@@ -706,7 +706,11 @@ public void getCryptoKeyVersionExceptionTest() throws Exception {
@SuppressWarnings("all")
public void getPublicKeyTest() {
String pem = "pem110872";
PublicKey expectedResponse = PublicKey.newBuilder().setPem(pem).build();
PublicKeyName name2 =
PublicKeyName.of(
"[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]");
PublicKey expectedResponse =
PublicKey.newBuilder().setPem(pem).setName(name2.toString()).build();
mockKeyManagementService.addResponse(expectedResponse);

CryptoKeyVersionName name =
@@ -1054,8 +1058,15 @@ public void updateCryptoKeyVersionExceptionTest() throws Exception {
public void encryptTest() {
String name2 = "name2-1052831874";
ByteString ciphertext = ByteString.copyFromUtf8("-72");
boolean verifiedPlaintextCrc32c = false;
boolean verifiedAdditionalAuthenticatedDataCrc32c = true;
EncryptResponse expectedResponse =
EncryptResponse.newBuilder().setName(name2).setCiphertext(ciphertext).build();
EncryptResponse.newBuilder()
.setName(name2)
.setCiphertext(ciphertext)
.setVerifiedPlaintextCrc32C(verifiedPlaintextCrc32c)
.setVerifiedAdditionalAuthenticatedDataCrc32C(verifiedAdditionalAuthenticatedDataCrc32c)
.build();
mockKeyManagementService.addResponse(expectedResponse);

ResourceName name = CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
@@ -1140,8 +1151,14 @@ public void decryptExceptionTest() throws Exception {
@SuppressWarnings("all")
public void asymmetricSignTest() {
ByteString signature = ByteString.copyFromUtf8("106");
boolean verifiedDigestCrc32c = true;
String name2 = "name2-1052831874";
AsymmetricSignResponse expectedResponse =
AsymmetricSignResponse.newBuilder().setSignature(signature).build();
AsymmetricSignResponse.newBuilder()
.setSignature(signature)
.setVerifiedDigestCrc32C(verifiedDigestCrc32c)
.setName(name2)
.build();
mockKeyManagementService.addResponse(expectedResponse);

CryptoKeyVersionName name =
@@ -1187,8 +1204,12 @@ public void asymmetricSignExceptionTest() throws Exception {
@SuppressWarnings("all")
public void asymmetricDecryptTest() {
ByteString plaintext = ByteString.copyFromUtf8("-9");
boolean verifiedCiphertextCrc32c = true;
AsymmetricDecryptResponse expectedResponse =
AsymmetricDecryptResponse.newBuilder().setPlaintext(plaintext).build();
AsymmetricDecryptResponse.newBuilder()
.setPlaintext(plaintext)
.setVerifiedCiphertextCrc32C(verifiedCiphertextCrc32c)
.build();
mockKeyManagementService.addResponse(expectedResponse);

CryptoKeyVersionName name =

0 comments on commit f4e58f2

Please sign in to comment.