%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
%% See https://github.com/jkakar/aws-codegen for more details.
%% @doc
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.
cancel_key_deletion(Client, Input)
when is_map(Client), is_map(Input) ->
cancel_key_deletion(Client, Input, []).
cancel_key_deletion(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"CancelKeyDeletion">>, Input, Options).
%% @doc 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.
create_alias(Client, Input)
when is_map(Client), is_map(Input) ->
create_alias(Client, Input, []).
create_alias(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"CreateAlias">>, Input, Options).
%% @doc 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.
create_grant(Client, Input)
when is_map(Client), is_map(Input) ->
create_grant(Client, Input, []).
create_grant(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"CreateGrant">>, Input, Options).
%% @doc 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.
create_key(Client, Input)
when is_map(Client), is_map(Input) ->
create_key(Client, Input, []).
create_key(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"CreateKey">>, Input, Options).
%% @doc 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.
decrypt(Client, Input)
when is_map(Client), is_map(Input) ->
decrypt(Client, Input, []).
decrypt(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"Decrypt">>, Input, Options).
%% @doc Deletes the specified alias. To map an alias to a different key, call
%% UpdateAlias.
delete_alias(Client, Input)
when is_map(Client), is_map(Input) ->
delete_alias(Client, Input, []).
delete_alias(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"DeleteAlias">>, Input, Options).
%% @doc Provides detailed information about the specified customer master
%% key.
describe_key(Client, Input)
when is_map(Client), is_map(Input) ->
describe_key(Client, Input, []).
describe_key(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"DescribeKey">>, Input, Options).
%% @doc 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.
disable_key(Client, Input)
when is_map(Client), is_map(Input) ->
disable_key(Client, Input, []).
disable_key(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"DisableKey">>, Input, Options).
%% @doc Disables rotation of the specified key.
disable_key_rotation(Client, Input)
when is_map(Client), is_map(Input) ->
disable_key_rotation(Client, Input, []).
disable_key_rotation(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"DisableKeyRotation">>, Input, Options).
%% @doc Marks a key as enabled, thereby permitting its use.
enable_key(Client, Input)
when is_map(Client), is_map(Input) ->
enable_key(Client, Input, []).
enable_key(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"EnableKey">>, Input, Options).
%% @doc Enables rotation of the specified customer master key.
enable_key_rotation(Client, Input)
when is_map(Client), is_map(Input) ->
enable_key_rotation(Client, Input, []).
enable_key_rotation(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"EnableKeyRotation">>, Input, Options).
%% @doc Encrypts plaintext into ciphertext by using a customer master key.
%% The Encrypt function has two primary use cases: 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.
encrypt(Client, Input)
when is_map(Client), is_map(Input) ->
encrypt(Client, Input, []).
encrypt(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"Encrypt">>, Input, Options).
%% @doc 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.
%%
%% 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. 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.
generate_data_key(Client, Input)
when is_map(Client), is_map(Input) ->
generate_data_key(Client, Input, []).
generate_data_key(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"GenerateDataKey">>, Input, Options).
%% @doc 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.
generate_data_key_without_plaintext(Client, Input)
when is_map(Client), is_map(Input) ->
generate_data_key_without_plaintext(Client, Input, []).
generate_data_key_without_plaintext(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"GenerateDataKeyWithoutPlaintext">>, Input, Options).
%% @doc Generates an unpredictable byte string.
generate_random(Client, Input)
when is_map(Client), is_map(Input) ->
generate_random(Client, Input, []).
generate_random(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"GenerateRandom">>, Input, Options).
%% @doc Retrieves a policy attached to the specified key.
get_key_policy(Client, Input)
when is_map(Client), is_map(Input) ->
get_key_policy(Client, Input, []).
get_key_policy(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"GetKeyPolicy">>, Input, Options).
%% @doc Retrieves a Boolean value that indicates whether key rotation is
%% enabled for the specified key.
get_key_rotation_status(Client, Input)
when is_map(Client), is_map(Input) ->
get_key_rotation_status(Client, Input, []).
get_key_rotation_status(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"GetKeyRotationStatus">>, Input, Options).
%% @doc Lists all of the key aliases in the account.
list_aliases(Client, Input)
when is_map(Client), is_map(Input) ->
list_aliases(Client, Input, []).
list_aliases(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"ListAliases">>, Input, Options).
%% @doc List the grants for a specified key.
list_grants(Client, Input)
when is_map(Client), is_map(Input) ->
list_grants(Client, Input, []).
list_grants(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"ListGrants">>, Input, Options).
%% @doc Retrieves a list of policies attached to a key.
list_key_policies(Client, Input)
when is_map(Client), is_map(Input) ->
list_key_policies(Client, Input, []).
list_key_policies(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"ListKeyPolicies">>, Input, Options).
%% @doc Lists the customer master keys.
list_keys(Client, Input)
when is_map(Client), is_map(Input) ->
list_keys(Client, Input, []).
list_keys(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"ListKeys">>, Input, Options).
%% @doc 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.
list_retirable_grants(Client, Input)
when is_map(Client), is_map(Input) ->
list_retirable_grants(Client, Input, []).
list_retirable_grants(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"ListRetirableGrants">>, Input, Options).
%% @doc Attaches a policy to the specified key.
put_key_policy(Client, Input)
when is_map(Client), is_map(Input) ->
put_key_policy(Client, Input, []).
put_key_policy(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"PutKeyPolicy">>, Input, Options).
%% @doc 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.
re_encrypt(Client, Input)
when is_map(Client), is_map(Input) ->
re_encrypt(Client, Input, []).
re_encrypt(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"ReEncrypt">>, Input, Options).
%% @doc 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: RetiringPrincipal, if presentGranteePrincipal, if RetireGrant is a grantee
%% operationCreateGrant function.
retire_grant(Client, Input)
when is_map(Client), is_map(Input) ->
retire_grant(Client, Input, []).
retire_grant(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"RetireGrant">>, Input, Options).
%% @doc Revokes a grant. You can revoke a grant to actively deny operations
%% that depend on it.
revoke_grant(Client, Input)
when is_map(Client), is_map(Input) ->
revoke_grant(Client, Input, []).
revoke_grant(Client, Input, Options)
when is_map(Client), is_map(Input), is_list(Options) ->
request(Client, <<"RevokeGrant">>, Input, Options).
%% @doc 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.
%%
%%