Skip to content

Commit 90ec12d

Browse files
AWS KMS announces the support of ML-DSA key pairs that creates post-quantum safe digital signatures.
1 parent 838a1bd commit 90ec12d

17 files changed

+366
-154
lines changed

docgenerator/AWSSDKDocSamples/KeyManagementService.GeneratedSamples.extra.xml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
<value>
182182
<example>
183183
<para>
184-
This example creates a KMS key that contains an asymmetric elliptic curve (ECC) key pair for signing and verification. The key usage is required even though "SIGN_VERIFY" is the only valid value for ECC KMS keys. The key spec and key usage can't be changed after the key is created.
184+
This example creates a KMS key that contains an asymmetric elliptic curve (ECC) key pair for signing and verification. The key spec and key usage can't be changed after the key is created.
185185
</para>
186186
<code
187187
title="To create an asymmetric elliptic curve KMS key for signing and verification"
@@ -209,6 +209,25 @@
209209
</example>
210210
</value>
211211
</doc>
212+
<doc>
213+
<members>
214+
<member name="M:Amazon.KeyManagementService.IAmazonKeyManagementService.CreateKey(Amazon.KeyManagementService.Model.CreateKeyRequest)" />
215+
<member name="M:Amazon.KeyManagementService.AmazonKeyManagementServiceClient.CreateKey(Amazon.KeyManagementService.Model.CreateKeyRequest)" />
216+
<member name="T:Amazon.KeyManagementService.Model.CreateKeyRequest" />
217+
<member name="T:Amazon.KeyManagementService.Model.CreateKeyResponse" />
218+
</members>
219+
<value>
220+
<example>
221+
<para>
222+
This example creates a module-lattice digital signature algorithm (ML-DSA) key for signing and verification. The key-usage parameter is required even though SIGN_VERIFY is the only valid value for ML-DSA keys.
223+
</para>
224+
<code
225+
title="To create an asymmetric ML-DSA KMS key for signing and verification"
226+
source=".\AWSSDKDocSamples\KeyManagementService\KeyManagementService.GeneratedSamples.cs"
227+
region="to-create-an-asymmetric-mldsa-kms-key-for-signing-and-verfication" />
228+
</example>
229+
</value>
230+
</doc>
212231
<doc>
213232
<members>
214233
<member name="M:Amazon.KeyManagementService.IAmazonKeyManagementService.CreateKey(Amazon.KeyManagementService.Model.CreateKeyRequest)" />

docgenerator/AWSSDKDocSamples/KeyManagementService/KeyManagementService.GeneratedSamples.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,22 @@ public void KeyManagementServiceCreateKey()
203203
#endregion
204204
}
205205

206+
public void KeyManagementServiceCreateKey()
207+
{
208+
#region to-create-an-asymmetric-mldsa-kms-key-for-signing-and-verfication
209+
210+
var client = new AmazonKeyManagementServiceClient();
211+
var response = client.CreateKey(new CreateKeyRequest
212+
{
213+
KeySpec = "ML_DSA_65", // Describes the type of key material in the KMS key.
214+
KeyUsage = "SIGN_VERIFY" // The cryptographic operations for which you can use the KMS key.
215+
});
216+
217+
KeyMetadata keyMetadata = response.KeyMetadata; // Detailed information about the KMS key that this operation creates.
218+
219+
#endregion
220+
}
221+
206222
public void KeyManagementServiceCreateKey()
207223
{
208224
#region to-create-a-multi-region-primary-kms-key-4
@@ -279,6 +295,7 @@ public void KeyManagementServiceDecrypt()
279295

280296
string encryptionAlgorithm = response.EncryptionAlgorithm; // The encryption algorithm that was used to decrypt the ciphertext. SYMMETRIC_DEFAULT is the only valid value for symmetric encryption in AWS KMS.
281297
string keyId = response.KeyId; // The Amazon Resource Name (ARN) of the KMS key that was used to decrypt the data.
298+
string keyMaterialId = response.KeyMaterialId; // The identifier of the key material used to decrypt the ciphertext.
282299
MemoryStream plaintext = response.Plaintext; // The decrypted (plaintext) data.
283300

284301
#endregion
@@ -360,7 +377,8 @@ public void KeyManagementServiceDeleteImportedKeyMaterial()
360377
var client = new AmazonKeyManagementServiceClient();
361378
var response = client.DeleteImportedKeyMaterial(new DeleteImportedKeyMaterialRequest
362379
{
363-
KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab" // The identifier of the KMS key whose imported key material you are deleting. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
380+
KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab", // The identifier of the KMS key whose imported key material you are deleting. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
381+
KeyMaterialId = "0b7fd7ddbac6eef27907413567cad8c810e2883dc8a7534067a82ee1142fc1e6" // Identifies the deleted key material.
364382
});
365383

366384

@@ -657,6 +675,7 @@ public void KeyManagementServiceGenerateDataKey()
657675

658676
MemoryStream ciphertextBlob = response.CiphertextBlob; // The encrypted data key.
659677
string keyId = response.KeyId; // The ARN of the KMS key that was used to encrypt the data key.
678+
string keyMaterialId = response.KeyMaterialId; // The identifier of the key material used to encrypt the data key.
660679
MemoryStream plaintext = response.Plaintext; // The unencrypted (plaintext) data key.
661680

662681
#endregion
@@ -697,6 +716,7 @@ public void KeyManagementServiceGenerateDataKeyPair()
697716
});
698717

699718
string keyId = response.KeyId; // The key ARN of the symmetric encryption KMS key that was used to encrypt the private key.
719+
string keyMaterialId = response.KeyMaterialId; // The identifier of the key material used to encrypt the private key.
700720
string keyPairSpec = response.KeyPairSpec; // The actual key spec of the RSA data key pair.
701721
MemoryStream privateKeyCiphertextBlob = response.PrivateKeyCiphertextBlob; // The encrypted private key of the RSA data key pair.
702722
MemoryStream privateKeyPlaintext = response.PrivateKeyPlaintext; // The plaintext private key of the RSA data key pair.
@@ -722,6 +742,7 @@ public void KeyManagementServiceGenerateDataKeyPair()
722742

723743
MemoryStream ciphertextForRecipient = response.CiphertextForRecipient; // The private key of the RSA data key pair encrypted by the public key from the attestation document
724744
string keyId = response.KeyId; // The key ARN of the symmetric encryption KMS key that was used to encrypt the PrivateKeyCiphertextBlob.
745+
string keyMaterialId = response.KeyMaterialId; // The identifier of the key material used to encrypt the private key.
725746
string keyPairSpec = response.KeyPairSpec; // The actual key spec of the RSA data key pair.
726747
MemoryStream privateKeyCiphertextBlob = response.PrivateKeyCiphertextBlob; // The private key of the RSA data key pair encrypted by the KMS key.
727748
MemoryStream privateKeyPlaintext = response.PrivateKeyPlaintext; // This field is null or empty
@@ -742,6 +763,7 @@ public void KeyManagementServiceGenerateDataKeyPairWithoutPlaintext()
742763
});
743764

744765
string keyId = response.KeyId; // The key ARN of the symmetric encryption KMS key that encrypted the private key in the ECC asymmetric data key pair.
766+
string keyMaterialId = response.KeyMaterialId; // The identifier of the key material used to encrypt the private key.
745767
string keyPairSpec = response.KeyPairSpec; // The actual key spec of the ECC asymmetric data key pair.
746768
MemoryStream privateKeyCiphertextBlob = response.PrivateKeyCiphertextBlob; // The encrypted private key of the asymmetric ECC data key pair.
747769
MemoryStream publicKey = response.PublicKey; // The public key (plaintext).
@@ -762,6 +784,7 @@ public void KeyManagementServiceGenerateDataKeyWithoutPlaintext()
762784

763785
MemoryStream ciphertextBlob = response.CiphertextBlob; // The encrypted data key.
764786
string keyId = response.KeyId; // The ARN of the KMS key that was used to encrypt the data key.
787+
string keyMaterialId = response.KeyMaterialId; // The identifier of the key material used to encrypt the data key.
765788

766789
#endregion
767790
}
@@ -967,6 +990,8 @@ public void KeyManagementServiceImportKeyMaterial()
967990
KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab" // The identifier of the KMS key to import the key material into. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
968991
});
969992

993+
string keyId = response.KeyId; // The Amazon Resource Name (ARN) of the KMS key into which key material was imported.
994+
string keyMaterialId = response.KeyMaterialId; // Identifies the imported key material.
970995

971996
#endregion
972997
}
@@ -985,6 +1010,8 @@ public void KeyManagementServiceImportKeyMaterial()
9851010
ValidTo = new DateTime(2023, 9, 30, 12, 0, 0, DateTimeKind.Utc) // Specifies the date and time when the imported key material expires.
9861011
});
9871012

1013+
string keyId = response.KeyId; // The Amazon Resource Name (ARN) of the KMS key into which key material was imported.
1014+
string keyMaterialId = response.KeyMaterialId; // Identifies the imported key material.
9881015

9891016
#endregion
9901017
}
@@ -1200,8 +1227,12 @@ public void KeyManagementServiceReEncrypt()
12001227
});
12011228

12021229
MemoryStream ciphertextBlob = response.CiphertextBlob; // The reencrypted data.
1230+
string destinationEncryptionAlgorithm = response.DestinationEncryptionAlgorithm; // The encryption algorithm that was used to reencrypt the data.
1231+
string destinationKeyMaterialId = response.DestinationKeyMaterialId; // The identifier of the key material used to reencrypt the data.
12031232
string keyId = response.KeyId; // The ARN of the KMS key that was used to reencrypt the data.
1233+
string sourceEncryptionAlgorithm = response.SourceEncryptionAlgorithm; // The encryption algorithm that was used to decrypt the ciphertext before it was reencrypted.
12041234
string sourceKeyId = response.SourceKeyId; // The ARN of the KMS key that was originally used to encrypt the data.
1235+
string sourceKeyMaterialId = response.SourceKeyMaterialId; // The identifier of the key material used to originally encrypt the data.
12051236

12061237
#endregion
12071238
}

generator/ServiceModels/kms/kms-2014-11-01.api.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,10 @@
21072107
"HMAC_256",
21082108
"HMAC_384",
21092109
"HMAC_512",
2110-
"SM2"
2110+
"SM2",
2111+
"ML_DSA_44",
2112+
"ML_DSA_65",
2113+
"ML_DSA_87"
21112114
]
21122115
},
21132116
"KeyState":{
@@ -2299,7 +2302,8 @@
22992302
"type":"string",
23002303
"enum":[
23012304
"RAW",
2302-
"DIGEST"
2305+
"DIGEST",
2306+
"EXTERNAL_MU"
23032307
]
23042308
},
23052309
"MultiRegionConfiguration":{
@@ -2584,7 +2588,8 @@
25842588
"ECDSA_SHA_256",
25852589
"ECDSA_SHA_384",
25862590
"ECDSA_SHA_512",
2587-
"SM2DSA"
2591+
"SM2DSA",
2592+
"ML_DSA_SHAKE_256"
25882593
]
25892594
},
25902595
"SigningAlgorithmSpecList":{

0 commit comments

Comments
 (0)