AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
This is the response object from the Encapsulate operation.
Namespace: Amazon.KeyManagementService.Model
Assembly: AWSSDK.KeyManagementService.dll
Version: 3.x.y.z
public class EncapsulateResponse : AmazonWebServiceResponse
The EncapsulateResponse type exposes the following members
| Name | Description | |
|---|---|---|
|
EncapsulateResponse() |
| Name | Type | Description | |
|---|---|---|---|
|
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
EncapsulationAlgorithm | Amazon.KeyManagementService.EncapsulationAlgorithmSpec |
Gets and sets the property EncapsulationAlgorithm. The key encapsulation algorithm used to generate the shared secret. |
|
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
KeyId | System.String |
Gets and sets the property KeyId. The identifier of the ML-KEM KMS key used to encapsulate the shared secret. |
|
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
SharedSecret | System.IO.MemoryStream |
Gets and sets the property SharedSecret. The plaintext shared secret. It is a 32-byte cryptographically random value that both parties can use directly as key material or pass through a key derivation function to generate multiple keys and nonces. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. |
|
SharedSecretCiphertextBlob | System.IO.MemoryStream |
Gets and sets the property SharedSecretCiphertextBlob.
The encapsulated form of the shared secret. Pass this value to the Decapsulate
operation to recover the shared secret. When you use the HTTP API or the Amazon Web
Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. The
length of |
Generates a shared secret and its encapsulated ciphertext (SharedSecretCiphertextBlob) using the public key in an asymmetric ML-KEM KMS key. Send the ciphertext to your peer, who calls Decapsulate to recover the same shared secret.
var client = new AmazonKeyManagementServiceClient();
var response = client.Encapsulate(new EncapsulateRequest
{
EncapsulationAlgorithm = "ML_KEM",
KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab"
});
EncapsulationAlgorithmSpec encapsulationAlgorithm = response.EncapsulationAlgorithm;
string keyId = response.KeyId;
MemoryStream sharedSecret = response.SharedSecret;
MemoryStream sharedSecretCiphertextBlob = response.SharedSecretCiphertextBlob;
.NET:
Supported in: 8.0 and newer
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.7.2 and newer