Skip to content

Commit

Permalink
add net examples
Browse files Browse the repository at this point in the history
  • Loading branch information
josecorella committed Nov 6, 2024
1 parent 854c984 commit cf4f403
Show file tree
Hide file tree
Showing 5 changed files with 1,070 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ public static void DiscoveryRawEcdhKeyringGetItem(
}

// 2. Create the keyring.
// This keyring uses an ephemeral configuration. This configuration will always create a new
// key pair as the sender key pair for the key agreement operation. The ephemeral configuration can only
// encrypt data and CANNOT decrypt messages.
// This keyring uses a discovery configuration. This configuration will check on decrypt
// if it is meant to decrypt the message by checking if the configured public key is stored on the message.
// The discovery configuration can only decrypt messages and CANNOT encrypt messages.
// The DynamoDb encryption client uses this to encrypt and decrypt items.
final CreateRawEcdhKeyringInput keyringInput = CreateRawEcdhKeyringInput
.builder()
Expand Down
7 changes: 5 additions & 2 deletions Examples/runtimes/net/src/Examples.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Examples.keyring;

namespace Examples
{
Expand All @@ -10,7 +11,7 @@ class Program
static async Task Main()
{
ItemEncryptDecryptExample.PutItemGetItem();

await BasicPutGetExample.PutItemGetItem();
await ScanErrorExample.ScanError();
await GetEncryptedDataKeyDescriptionExample.GetEncryptedDataKeyDescription();
Expand All @@ -22,6 +23,8 @@ static async Task Main()
await MultiKeyringExample.MultiKeyringGetItemPutItem();
await RawRsaKeyringExample.RawRsaKeyringGetItemPutItem();
await KmsRsaKeyringExample.KmsRsaKeyringGetItemPutItem();
await RawEcdhKeyringExample.RawEcdhKeyringExamples();
await KmsEcdhKeyringExample.KmsEcdhKeyringExamples();

var keyId = CreateKeyStoreKeyExample.KeyStoreCreateKey();
var keyId2 = CreateKeyStoreKeyExample.KeyStoreCreateKey();
Expand All @@ -30,7 +33,7 @@ static async Task Main()
Thread.Sleep(5000);

await HierarchicalKeyringExample.HierarchicalKeyringGetItemPutItem(keyId, keyId2);

await BasicSearchableEncryptionExample.PutItemQueryItemWithBeacon(keyId);
await CompoundBeaconSearchableEncryptionExample.PutItemQueryItemWithCompoundBeacon(keyId);
await VirtualBeaconSearchableEncryptionExample.PutItemQueryItemWithVirtualBeacon(keyId);
Expand Down
6 changes: 6 additions & 0 deletions Examples/runtimes/net/src/TestUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public class TestUtils

public static readonly string TEST_KMS_RSA_KEY_ID =
"arn:aws:kms:us-west-2:658956600833:key/8b432da4-dde4-4bc3-a794-c7d68cbab5a6";

public static readonly string TEST_KMS_ECDH_KEY_ID_P256_SENDER =
"arn:aws:kms:us-west-2:370957321024:key/eabdf483-6be2-4d2d-8ee4-8c2583d416e9";

public static readonly string TEST_KMS_ECDH_KEY_ID_P256_RECIPIENT =
"arn:aws:kms:us-west-2:370957321024:key/0265c8e9-5b6a-4055-8f70-63719e09fda5";

public static readonly string TEST_MRK_REPLICA_KEY_ID_US_EAST_1 =
"arn:aws:kms:us-east-1:658956600833:key/mrk-80bd8ecdcd4342aebd84b7dc9da498a7";
Expand Down
Loading

0 comments on commit cf4f403

Please sign in to comment.