Skip to content

Commit cf4f403

Browse files
committed
add net examples
1 parent 854c984 commit cf4f403

File tree

5 files changed

+1070
-5
lines changed

5 files changed

+1070
-5
lines changed

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/keyring/RawEcdhKeyringExample.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ public static void DiscoveryRawEcdhKeyringGetItem(
278278
}
279279

280280
// 2. Create the keyring.
281-
// This keyring uses an ephemeral configuration. This configuration will always create a new
282-
// key pair as the sender key pair for the key agreement operation. The ephemeral configuration can only
283-
// encrypt data and CANNOT decrypt messages.
281+
// This keyring uses a discovery configuration. This configuration will check on decrypt
282+
// if it is meant to decrypt the message by checking if the configured public key is stored on the message.
283+
// The discovery configuration can only decrypt messages and CANNOT encrypt messages.
284284
// The DynamoDb encryption client uses this to encrypt and decrypt items.
285285
final CreateRawEcdhKeyringInput keyringInput = CreateRawEcdhKeyringInput
286286
.builder()

Examples/runtimes/net/src/Examples.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Threading;
33
using System.Threading.Tasks;
4+
using Examples.keyring;
45

56
namespace Examples
67
{
@@ -10,7 +11,7 @@ class Program
1011
static async Task Main()
1112
{
1213
ItemEncryptDecryptExample.PutItemGetItem();
13-
14+
1415
await BasicPutGetExample.PutItemGetItem();
1516
await ScanErrorExample.ScanError();
1617
await GetEncryptedDataKeyDescriptionExample.GetEncryptedDataKeyDescription();
@@ -22,6 +23,8 @@ static async Task Main()
2223
await MultiKeyringExample.MultiKeyringGetItemPutItem();
2324
await RawRsaKeyringExample.RawRsaKeyringGetItemPutItem();
2425
await KmsRsaKeyringExample.KmsRsaKeyringGetItemPutItem();
26+
await RawEcdhKeyringExample.RawEcdhKeyringExamples();
27+
await KmsEcdhKeyringExample.KmsEcdhKeyringExamples();
2528

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

3235
await HierarchicalKeyringExample.HierarchicalKeyringGetItemPutItem(keyId, keyId2);
33-
36+
3437
await BasicSearchableEncryptionExample.PutItemQueryItemWithBeacon(keyId);
3538
await CompoundBeaconSearchableEncryptionExample.PutItemQueryItemWithCompoundBeacon(keyId);
3639
await VirtualBeaconSearchableEncryptionExample.PutItemQueryItemWithVirtualBeacon(keyId);

Examples/runtimes/net/src/TestUtils.cs

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ public class TestUtils
2323

2424
public static readonly string TEST_KMS_RSA_KEY_ID =
2525
"arn:aws:kms:us-west-2:658956600833:key/8b432da4-dde4-4bc3-a794-c7d68cbab5a6";
26+
27+
public static readonly string TEST_KMS_ECDH_KEY_ID_P256_SENDER =
28+
"arn:aws:kms:us-west-2:370957321024:key/eabdf483-6be2-4d2d-8ee4-8c2583d416e9";
29+
30+
public static readonly string TEST_KMS_ECDH_KEY_ID_P256_RECIPIENT =
31+
"arn:aws:kms:us-west-2:370957321024:key/0265c8e9-5b6a-4055-8f70-63719e09fda5";
2632

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

0 commit comments

Comments
 (0)