AWS SDK Version 4 for .NET
API Reference

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 Decapsulate operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.KeyManagementService.Model.DecapsulateResponse

Namespace: Amazon.KeyManagementService.Model
Assembly: AWSSDK.KeyManagementService.dll
Version: 3.x.y.z

Syntax

C#
public class DecapsulateResponse : AmazonWebServiceResponse

The DecapsulateResponse type exposes the following members

Constructors

NameDescription
Public Method DecapsulateResponse()

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property EncapsulationAlgorithm Amazon.KeyManagementService.EncapsulationAlgorithmSpec

Gets and sets the property EncapsulationAlgorithm.

The key encapsulation algorithm used to recover the shared secret.

Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property KeyId System.String

Gets and sets the property KeyId.

The identifier of the ML-KEM KMS key used to decapsulate the shared secret.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property SharedSecret System.IO.MemoryStream

Gets and sets the property SharedSecret.

The plaintext shared secret recovered from the encapsulated form. It is a 32-byte value that matches the shared secret held by the encapsulating party. When you use the HTTP API or the Amazon Web Services CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.

Examples

Recovers a shared secret from its encapsulated ciphertext (SharedSecretCiphertextBlob) using the private key in an asymmetric ML-KEM KMS key. Your peer calls Encapsulate to generate the shared secret and ciphertext.

To recover a shared secret from its encapsulated ciphertext


var client = new AmazonKeyManagementServiceClient();
var response = client.Decapsulate(new DecapsulateRequest
{
    EncapsulationAlgorithm = "ML_KEM",
    KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab",
    SharedSecretCiphertextBlob = new MemoryStream(<binary data>)
});

EncapsulationAlgorithmSpec encapsulationAlgorithm = response.EncapsulationAlgorithm;
string keyId = response.KeyId;
MemoryStream sharedSecret = response.SharedSecret;

            

Version Information

.NET:
Supported in: 8.0 and newer

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer