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

Commit

Permalink
feat: add support for Raw PKCS#1 signing keys (#651)
Browse files Browse the repository at this point in the history
* feat: add support for Raw PKCS#1 signing keys

PiperOrigin-RevId: 403966825

Source-Link: googleapis/googleapis@5b0219d

Source-Link: googleapis/googleapis-gen@ea0000e
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Oct 21, 2021
1 parent fcbcc2e commit 1c7a18d
Show file tree
Hide file tree
Showing 46 changed files with 1,298 additions and 418 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2943,7 +2943,7 @@ public final UnaryCallable<DecryptRequest, DecryptResponse> decryptCallable() {
*
* @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
* @param digest Optional. 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
Expand Down Expand Up @@ -2980,7 +2980,7 @@ public final AsymmetricSignResponse asymmetricSign(CryptoKeyVersionName name, Di
*
* @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
* @param digest Optional. 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
Expand Down Expand Up @@ -3015,6 +3015,8 @@ public final AsymmetricSignResponse asymmetricSign(String name, Digest digest) {
* .toString())
* .setDigest(Digest.newBuilder().build())
* .setDigestCrc32C(Int64Value.newBuilder().build())
* .setData(ByteString.EMPTY)
* .setDataCrc32C(Int64Value.newBuilder().build())
* .build();
* AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(request);
* }
Expand Down Expand Up @@ -3051,6 +3053,8 @@ public final AsymmetricSignResponse asymmetricSign(AsymmetricSignRequest request
* .toString())
* .setDigest(Digest.newBuilder().build())
* .setDigestCrc32C(Int64Value.newBuilder().build())
* .setData(ByteString.EMPTY)
* .setDataCrc32C(Int64Value.newBuilder().build())
* .build();
* ApiFuture<AsymmetricSignResponse> future =
* keyManagementServiceClient.asymmetricSignCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2077,6 +2077,7 @@ public void asymmetricSignTest() throws Exception {
.setSignatureCrc32C(Int64Value.newBuilder().build())
.setVerifiedDigestCrc32C(true)
.setName("name3373707")
.setVerifiedDataCrc32C(true)
.setProtectionLevel(ProtectionLevel.forNumber(0))
.build();
mockKeyManagementService.addResponse(expectedResponse);
Expand Down Expand Up @@ -2126,6 +2127,7 @@ public void asymmetricSignTest2() throws Exception {
.setSignatureCrc32C(Int64Value.newBuilder().build())
.setVerifiedDigestCrc32C(true)
.setName("name3373707")
.setVerifiedDataCrc32C(true)
.setProtectionLevel(ProtectionLevel.forNumber(0))
.build();
mockKeyManagementService.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public final boolean isInitialized() {

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

size = 0;
if (!getNameBytes().isEmpty()) {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (!ciphertext_.isEmpty()) {
Expand Down
Loading

0 comments on commit 1c7a18d

Please sign in to comment.