Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.

Commit 1c7a18d

Browse files
feat: add support for Raw PKCS#1 signing keys (#651)
* feat: add support for Raw PKCS#1 signing keys PiperOrigin-RevId: 403966825 Source-Link: googleapis/googleapis@5b0219d Source-Link: https://github.com/googleapis/googleapis-gen/commit/ea0000e708e860b65b574783d5ea61ad340911be Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWEwMDAwZTcwOGU4NjBiNjViNTc0NzgzZDVlYTYxYWQzNDA5MTFiZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent fcbcc2e commit 1c7a18d

46 files changed

Lines changed: 1298 additions & 418 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ public final UnaryCallable<DecryptRequest, DecryptResponse> decryptCallable() {
29432943
*
29442944
* @param name Required. The resource name of the
29452945
* [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
2946-
* @param digest Required. The digest of the data to sign. The digest must be produced with the
2946+
* @param digest Optional. The digest of the data to sign. The digest must be produced with the
29472947
* same digest algorithm as specified by the key version's
29482948
* [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
29492949
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -2980,7 +2980,7 @@ public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Di
29802980
*
29812981
* @param name Required. The resource name of the
29822982
* [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for signing.
2983-
* @param digest Required. The digest of the data to sign. The digest must be produced with the
2983+
* @param digest Optional. The digest of the data to sign. The digest must be produced with the
29842984
* same digest algorithm as specified by the key version's
29852985
* [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
29862986
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -3015,6 +3015,8 @@ public final AsymmetricSignResponse asymmetricSign(String name, Digest digest) {
30153015
* .toString())
30163016
* .setDigest(Digest.newBuilder().build())
30173017
* .setDigestCrc32C(Int64Value.newBuilder().build())
3018+
* .setData(ByteString.EMPTY)
3019+
* .setDataCrc32C(Int64Value.newBuilder().build())
30183020
* .build();
30193021
* AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(request);
30203022
* }
@@ -3051,6 +3053,8 @@ public final AsymmetricSignResponse asymmetricSign(AsymmetricSignRequest request
30513053
* .toString())
30523054
* .setDigest(Digest.newBuilder().build())
30533055
* .setDigestCrc32C(Int64Value.newBuilder().build())
3056+
* .setData(ByteString.EMPTY)
3057+
* .setDataCrc32C(Int64Value.newBuilder().build())
30543058
* .build();
30553059
* ApiFuture<AsymmetricSignResponse> future =
30563060
* keyManagementServiceClient.asymmetricSignCallable().futureCall(request);

google-cloud-kms/src/test/java/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,6 +2077,7 @@ public void asymmetricSignTest() throws Exception {
20772077
.setSignatureCrc32C(Int64Value.newBuilder().build())
20782078
.setVerifiedDigestCrc32C(true)
20792079
.setName("name3373707")
2080+
.setVerifiedDataCrc32C(true)
20802081
.setProtectionLevel(ProtectionLevel.forNumber(0))
20812082
.build();
20822083
mockKeyManagementService.addResponse(expectedResponse);
@@ -2126,6 +2127,7 @@ public void asymmetricSignTest2() throws Exception {
21262127
.setSignatureCrc32C(Int64Value.newBuilder().build())
21272128
.setVerifiedDigestCrc32C(true)
21282129
.setName("name3373707")
2130+
.setVerifiedDataCrc32C(true)
21292131
.setProtectionLevel(ProtectionLevel.forNumber(0))
21302132
.build();
21312133
mockKeyManagementService.addResponse(expectedResponse);

proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/AsymmetricDecryptRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public final boolean isInitialized() {
310310

311311
@java.lang.Override
312312
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
313-
if (!getNameBytes().isEmpty()) {
313+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
314314
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
315315
}
316316
if (!ciphertext_.isEmpty()) {
@@ -328,7 +328,7 @@ public int getSerializedSize() {
328328
if (size != -1) return size;
329329

330330
size = 0;
331-
if (!getNameBytes().isEmpty()) {
331+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
332332
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
333333
}
334334
if (!ciphertext_.isEmpty()) {

0 commit comments

Comments
 (0)