AWS SDK Version 2 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.

.NET Framework 3.5
 

Classes

NameDescription
Class AliasListEntry Contains information about an alias.
Class AlreadyExistsException KeyManagementService exception
Class CancelKeyDeletionRequest Container for the parameters to the CancelKeyDeletion operation. Cancels the deletion of a customer master key (CMK). When this operation is successful, the CMK is set to the Disabled state. To enable a CMK, use EnableKey.

For more information about scheduling and canceling deletion of a CMK, go to Deleting Customer Master Keys in the AWS Key Management Service Developer Guide.

Class CancelKeyDeletionResponse Configuration for accessing Amazon CancelKeyDeletion service
Class CancelKeyDeletionResult
Class CreateAliasRequest Container for the parameters to the CreateAlias operation. Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). An alias must start with the word "alias" followed by a forward slash (alias/). An alias that begins with "aws" after the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).

The alias and the key it is mapped to must be in the same AWS account and the same region.

To map an alias to a different key, call UpdateAlias.

Class CreateAliasResponse
Class CreateGrantRequest Container for the parameters to the CreateGrant operation. Adds a grant to a key to specify who can use the key and under what conditions. Grants are alternate permission mechanisms to key policies.

For more information about grants, see Grants in the AWS Key Management Service Developer Guide.

Class CreateGrantResponse Configuration for accessing Amazon CreateGrant service
Class CreateGrantResult
Class CreateKeyRequest Container for the parameters to the CreateKey operation. Creates a customer master key. Customer master keys can be used to encrypt small amounts of data (less than 4K) directly, but they are most commonly used to encrypt or envelope data keys that are then used to encrypt customer data. For more information about data keys, see GenerateDataKey and GenerateDataKeyWithoutPlaintext.
Class CreateKeyResponse Configuration for accessing Amazon CreateKey service
Class CreateKeyResult
Class DecryptRequest Container for the parameters to the Decrypt operation. Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted by using any of the following functions:

Note that if a caller has been granted access permissions to all keys (through, for example, IAM user policies that grant Decrypt permission on all resources), then ciphertext encrypted by using keys in other accounts where the key grants access to the caller can be decrypted. To remedy this, we recommend that you do not grant Decrypt access in an IAM user policy. Instead grant Decrypt access only in key policies. If you must grant Decrypt access in an IAM user policy, you should scope the resource to specific keys or to specific trusted accounts.

Class DecryptResponse Configuration for accessing Amazon Decrypt service
Class DecryptResult
Class DeleteAliasRequest Container for the parameters to the DeleteAlias operation. Deletes the specified alias. To map an alias to a different key, call UpdateAlias.
Class DeleteAliasResponse
Class DependencyTimeoutException KeyManagementService exception
Class DescribeKeyRequest Container for the parameters to the DescribeKey operation. Provides detailed information about the specified customer master key.
Class DescribeKeyResponse Configuration for accessing Amazon DescribeKey service
Class DescribeKeyResult
Class DisabledException KeyManagementService exception
Class DisableKeyRequest Container for the parameters to the DisableKey operation. Sets the state of a master key to disabled, thereby preventing its use for cryptographic operations. For more information about how key state affects the use of a master key, go to How Key State Affects the Use of a Customer Master Key in the AWS Key Management Service Developer Guide.
Class DisableKeyResponse
Class DisableKeyRotationRequest Container for the parameters to the DisableKeyRotation operation. Disables rotation of the specified key.
Class DisableKeyRotationResponse
Class EnableKeyRequest Container for the parameters to the EnableKey operation. Marks a key as enabled, thereby permitting its use.
Class EnableKeyResponse
Class EnableKeyRotationRequest Container for the parameters to the EnableKeyRotation operation. Enables rotation of the specified customer master key.
Class EnableKeyRotationResponse
Class EncryptRequest Container for the parameters to the Encrypt operation. Encrypts plaintext into ciphertext by using a customer master key. The Encrypt function has two primary use cases:
  • You can encrypt up to 4 KB of arbitrary data such as an RSA key, a database password, or other sensitive customer information.
  • If you are moving encrypted data from one region to another, you can use this API to encrypt in the new region the plaintext data key that was used to encrypt the data in the original region. This provides you with an encrypted copy of the data key that can be decrypted in the new region and used there to decrypt the encrypted data.

Unless you are moving encrypted data from one region to another, you don't use this function to encrypt a generated data key within a region. You retrieve data keys already encrypted by calling the GenerateDataKey or GenerateDataKeyWithoutPlaintext function. Data keys don't need to be encrypted again by calling Encrypt.

If you want to encrypt data locally in your application, you can use the GenerateDataKey function to return a plaintext data encryption key and a copy of the key encrypted under the customer master key (CMK) of your choosing.

Class EncryptResponse Configuration for accessing Amazon Encrypt service
Class EncryptResult
Class GenerateDataKeyRequest Container for the parameters to the GenerateDataKey operation. Generates a data key that you can use in your application to locally encrypt data. This call returns a plaintext version of the key in the Plaintext field of the response object and an encrypted copy of the key in the CiphertextBlob field. The key is encrypted by using the master key specified by the KeyId field. To decrypt the encrypted key, pass it to the Decrypt API.

We recommend that you use the following pattern to locally encrypt data: call the GenerateDataKey API, use the key returned in the Plaintext response field to locally encrypt data, and then erase the plaintext data key from memory. Store the encrypted data key (contained in the CiphertextBlob field) alongside of the locally encrypted data.

You should not call the Encrypt function to re-encrypt your data keys within a region. GenerateDataKey always returns the data key encrypted and tied to the customer master key that will be used to decrypt it. There is no need to decrypt it twice.

If you decide to use the optional EncryptionContext parameter, you must also store the context in full or at least store enough information along with the encrypted data to be able to reconstruct the context when submitting the ciphertext to the Decrypt API. It is a good practice to choose a context that you can reconstruct on the fly to better secure the ciphertext. For more information about how this parameter is used, see Encryption Context.

To decrypt data, pass the encrypted data key to the Decrypt API. Decrypt uses the associated master key to decrypt the encrypted data key and returns it as plaintext. Use the plaintext data key to locally decrypt your data and then erase the key from memory. You must specify the encryption context, if any, that you specified when you generated the key. The encryption context is logged by CloudTrail, and you can use this log to help track the use of particular data.

Class GenerateDataKeyResponse Configuration for accessing Amazon GenerateDataKey service
Class GenerateDataKeyResult
Class GenerateDataKeyWithoutPlaintextRequest Container for the parameters to the GenerateDataKeyWithoutPlaintext operation. Returns a data key encrypted by a customer master key without the plaintext copy of that key. Otherwise, this API functions exactly like GenerateDataKey. You can use this API to, for example, satisfy an audit requirement that an encrypted key be made available without exposing the plaintext copy of that key.
Class GenerateDataKeyWithoutPlaintextResponse Configuration for accessing Amazon GenerateDataKeyWithoutPlaintext service
Class GenerateDataKeyWithoutPlaintextResult
Class GenerateRandomRequest Container for the parameters to the GenerateRandom operation. Generates an unpredictable byte string.
Class GenerateRandomResponse Configuration for accessing Amazon GenerateRandom service
Class GenerateRandomResult
Class GetKeyPolicyRequest Container for the parameters to the GetKeyPolicy operation. Retrieves a policy attached to the specified key.
Class GetKeyPolicyResponse Configuration for accessing Amazon GetKeyPolicy service
Class GetKeyPolicyResult
Class GetKeyRotationStatusRequest Container for the parameters to the GetKeyRotationStatus operation. Retrieves a Boolean value that indicates whether key rotation is enabled for the specified key.
Class GetKeyRotationStatusResponse Configuration for accessing Amazon GetKeyRotationStatus service
Class GetKeyRotationStatusResult
Class GrantConstraints A structure for specifying the conditions under which the operations permitted by the grant are allowed.

You can use this structure to allow the operations permitted by the grant only when a specified encryption context is present. For more information about encryption context, see Encryption Context in the AWS Key Management Service Developer Guide.

Class GrantListEntry Contains information about an entry in a list of grants.
Class InvalidAliasNameException KeyManagementService exception
Class InvalidArnException KeyManagementService exception
Class InvalidCiphertextException KeyManagementService exception
Class InvalidGrantIdException KeyManagementService exception
Class InvalidGrantTokenException KeyManagementService exception
Class InvalidKeyUsageException KeyManagementService exception
Class InvalidMarkerException KeyManagementService exception
Class KeyListEntry Contains information about each entry in the key list.
Class KeyMetadata Contains metadata about a customer master key (CMK).

This data type is used as a response element for the CreateKey and DescribeKey operations.

Class KeyUnavailableException KeyManagementService exception
Class KMSInternalException KeyManagementService exception
Class KMSInvalidStateException KeyManagementService exception
Class LimitExceededException KeyManagementService exception
Class ListAliasesRequest Container for the parameters to the ListAliases operation. Lists all of the key aliases in the account.
Class ListAliasesResponse Configuration for accessing Amazon ListAliases service
Class ListAliasesResult
Class ListGrantsRequest Container for the parameters to the ListGrants operation. List the grants for a specified key.
Class ListGrantsResponse Configuration for accessing Amazon ListGrants service
Class ListGrantsResult
Class ListKeyPoliciesRequest Container for the parameters to the ListKeyPolicies operation. Retrieves a list of policies attached to a key.
Class ListKeyPoliciesResponse Configuration for accessing Amazon ListKeyPolicies service
Class ListKeyPoliciesResult
Class ListKeysRequest Container for the parameters to the ListKeys operation. Lists the customer master keys.
Class ListKeysResponse Configuration for accessing Amazon ListKeys service
Class ListKeysResult
Class ListRetirableGrantsRequest Container for the parameters to the ListRetirableGrants operation. Returns a list of all grants for which the grant's RetiringPrincipal matches the one specified.

A typical use is to list all grants that you are able to retire. To retire a grant, use RetireGrant.

Class ListRetirableGrantsResponse Configuration for accessing Amazon ListRetirableGrants service
Class ListRetirableGrantsResult
Class MalformedPolicyDocumentException KeyManagementService exception
Class NotFoundException KeyManagementService exception
Class PutKeyPolicyRequest Container for the parameters to the PutKeyPolicy operation. Attaches a policy to the specified key.
Class PutKeyPolicyResponse
Class ReEncryptRequest Container for the parameters to the ReEncrypt operation. Encrypts data on the server side with a new customer master key without exposing the plaintext of the data on the client side. The data is first decrypted and then encrypted. This operation can also be used to change the encryption context of a ciphertext.

Unlike other actions, ReEncrypt is authorized twice - once as ReEncryptFrom on the source key and once as ReEncryptTo on the destination key. We therefore recommend that you include the "action":"kms:ReEncrypt*" statement in your key policies to permit re-encryption from or to the key. The statement is included automatically when you authorize use of the key through the console but must be included manually when you set a policy by using the PutKeyPolicy function.

Class ReEncryptResponse Configuration for accessing Amazon ReEncrypt service
Class ReEncryptResult
Class RetireGrantRequest Container for the parameters to the RetireGrant operation. Retires a grant. You can retire a grant when you're done using it to clean up. You should revoke a grant when you intend to actively deny operations that depend on it. The following are permitted to call this API:
  • The account that created the grant
  • The RetiringPrincipal, if present
  • The GranteePrincipal, if RetireGrant is a grantee operation
The grant to retire must be identified by its grant token or by a combination of the key ARN and the grant ID. A grant token is a unique variable-length base64-encoded string. A grant ID is a 64 character unique identifier of a grant. Both are returned by the CreateGrant function.
Class RetireGrantResponse
Class RevokeGrantRequest Container for the parameters to the RevokeGrant operation. Revokes a grant. You can revoke a grant to actively deny operations that depend on it.
Class RevokeGrantResponse
Class ScheduleKeyDeletionRequest Container for the parameters to the ScheduleKeyDeletion operation. Schedules the deletion of a customer master key (CMK). You may provide a waiting period, specified in days, before deletion occurs. If you do not provide a waiting period, the default period of 30 days is used. When this operation is successful, the state of the CMK changes to PendingDeletion. Before the waiting period ends, you can use CancelKeyDeletion to cancel the deletion of the CMK. After the waiting period ends, AWS KMS deletes the CMK and all AWS KMS data associated with it, including all aliases that point to it.

Deleting a CMK is a destructive and potentially dangerous operation. When a CMK is deleted, all data that was encrypted under the CMK is rendered unrecoverable. To restrict the use of a CMK without deleting it, use DisableKey.

For more information about scheduling a CMK for deletion, go to Deleting Customer Master Keys in the AWS Key Management Service Developer Guide.

Class ScheduleKeyDeletionResponse Configuration for accessing Amazon ScheduleKeyDeletion service
Class ScheduleKeyDeletionResult
Class UnsupportedOperationException KeyManagementService exception
Class UpdateAliasRequest Container for the parameters to the UpdateAlias operation. Updates an alias to map it to a different key.

An alias is not a property of a key. Therefore, an alias can be mapped to and unmapped from an existing key without changing the properties of the key.

An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). An alias must start with the word "alias" followed by a forward slash (alias/). An alias that begins with "aws" after the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).

The alias and the key it is mapped to must be in the same AWS account and the same region.

Class UpdateAliasResponse
Class UpdateKeyDescriptionRequest Container for the parameters to the UpdateKeyDescription operation. Updates the description of a key.
Class UpdateKeyDescriptionResponse