How to call Amazon KMS APIs for a Nitro enclave - Amazon Key Management Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

How to call Amazon KMS APIs for a Nitro enclave

To call Amazon KMS APIs for a Nitro enclave, use the Recipient parameter in the request to provide the signed attestation document for the enclave and the encryption algorithm to use with the enclave's public key. When a request includes the Recipient parameter with a signed attestation document, the response includes a CiphertextForRecipient field with the ciphertext encrypted by the public key. The plaintext field is null or empty.

The Recipient parameter must specify a signed attestation document from an Amazon Nitro enclave. Amazon KMS relies on the digital signature for the enclave’s attestation document to prove that the public key in the request came from a valid enclave. You cannot supply your own certificate to digitally sign the attestation document.

To specify the Recipient parameter, use the Amazon Nitro Enclaves SDK or any Amazon SDK. The Amazon Nitro Enclaves SDK, which is supported only within a Nitro enclave, automatically adds the Recipient parameter and its values to every Amazon KMS request. To make requests for Nitro enclaves in the Amazon SDKs, you have to specify the Recipient parameter and its values. Support for Nitro enclave cryptographic attestation in the Amazon SDKs was introduced in March 2023.

Amazon KMS supports policy condition keys that you can use to allow or deny enclave operations with an Amazon KMS key based on the content of the attestation document. You can also monitor requests to Amazon KMS for your Nitro enclave in your Amazon CloudTrail logs.

For detailed information about the Recipient parameter and the AWS CiphertextForRecipient response field, see the Decrypt, DeriveSharedSecret, GenerateDataKey, GenerateDataKeyPair, and GenerateRandom topics in the Amazon Key Management Service API Reference, the Amazon Nitro Enclaves SDK, or any Amazon SDK. For information about setting up your data and data keys for encryption, see Using cryptographic attestation with Amazon KMS.