Skip to content

Commit

Permalink
feat: add interoperable symmetric encryption system
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 544660001

Source-Link: googleapis/googleapis@511319c

Source-Link: googleapis/googleapis-gen@812def9
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuS21zLlYxLy5Pd2xCb3QueWFtbCIsImgiOiI4MTJkZWY5NTk0ZTlmYTA4NzZlMGUwMTE5NTFkYzBiZWM3YTBhNWZkIn0=
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed Jul 1, 2023
1 parent 0567fa8 commit 9ce4e96
Show file tree
Hide file tree
Showing 11 changed files with 3,999 additions and 873 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START cloudkms_v1_generated_KeyManagementService_RawDecrypt_async]
using Google.Cloud.Kms.V1;
using Google.Protobuf;
using System.Threading.Tasks;

public sealed partial class GeneratedKeyManagementServiceClientSnippets
{
/// <summary>Snippet for RawDecryptAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task RawDecryptRequestObjectAsync()
{
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RawDecryptRequest request = new RawDecryptRequest
{
Name = "",
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
InitializationVector = ByteString.Empty,
TagLength = 0,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawDecryptResponse response = await keyManagementServiceClient.RawDecryptAsync(request);
}
}
// [END cloudkms_v1_generated_KeyManagementService_RawDecrypt_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync]
using Google.Cloud.Kms.V1;
using Google.Protobuf;

public sealed partial class GeneratedKeyManagementServiceClientSnippets
{
/// <summary>Snippet for RawDecrypt</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void RawDecryptRequestObject()
{
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
RawDecryptRequest request = new RawDecryptRequest
{
Name = "",
Ciphertext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
InitializationVector = ByteString.Empty,
TagLength = 0,
CiphertextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawDecryptResponse response = keyManagementServiceClient.RawDecrypt(request);
}
}
// [END cloudkms_v1_generated_KeyManagementService_RawDecrypt_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START cloudkms_v1_generated_KeyManagementService_RawEncrypt_async]
using Google.Cloud.Kms.V1;
using Google.Protobuf;
using System.Threading.Tasks;

public sealed partial class GeneratedKeyManagementServiceClientSnippets
{
/// <summary>Snippet for RawEncryptAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task RawEncryptRequestObjectAsync()
{
// Create client
KeyManagementServiceClient keyManagementServiceClient = await KeyManagementServiceClient.CreateAsync();
// Initialize request argument(s)
RawEncryptRequest request = new RawEncryptRequest
{
Name = "",
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVector = ByteString.Empty,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawEncryptResponse response = await keyManagementServiceClient.RawEncryptAsync(request);
}
}
// [END cloudkms_v1_generated_KeyManagementService_RawEncrypt_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync]
using Google.Cloud.Kms.V1;
using Google.Protobuf;

public sealed partial class GeneratedKeyManagementServiceClientSnippets
{
/// <summary>Snippet for RawEncrypt</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void RawEncryptRequestObject()
{
// Create client
KeyManagementServiceClient keyManagementServiceClient = KeyManagementServiceClient.Create();
// Initialize request argument(s)
RawEncryptRequest request = new RawEncryptRequest
{
Name = "",
Plaintext = ByteString.Empty,
AdditionalAuthenticatedData = ByteString.Empty,
PlaintextCrc32C = 0L,
AdditionalAuthenticatedDataCrc32C = 0L,
InitializationVector = ByteString.Empty,
InitializationVectorCrc32C = 0L,
};
// Make the request
RawEncryptResponse response = keyManagementServiceClient.RawEncrypt(request);
}
}
// [END cloudkms_v1_generated_KeyManagementService_RawEncrypt_sync]
}
Loading

0 comments on commit 9ce4e96

Please sign in to comment.