View Source ExAws.KMS (ex_aws_kms v2.4.1)

Operations on AWS KMS

Summary

Functions

Cancel a key deletion

Creates a customer master key (CMK)

Decrypts ciphertext

Delete a alias

Delete a imported key material

Disable a key rotation

Enable a key

Enable a key rotation

Encrypt a data by a key

Generate a data key pair without plaintext

Generate a data key without plaintext

Generates an unpredictable byte string

Retrieves a policy attached to the specified key

Indicates whether key rotation is enabled for the specified key

Returns the public key of an asymmetric CMK

Imports key material into an AWS KMS customer master key (CMK)

Lists all of the key aliases

List the grants for a specified key

Retrieves a list of policies attached to a key

Lists the customer master keys

A list of all grants for which the grant's RetiringPrincipal matches the one specified

Attaches a key policy to the specified customer master key (CMK)

Encrypts data with a new CMK without exposing the plaintext of the data

Retires a grant

Create a signature for a message or digest

Updates an alias to map it to a different key

Updates the description of a key

Verify a signature generated by the sign operation

Types

@type describe_key_opts() :: [{:grant_tokens, [binary()]}]
@type disable_key_opts() :: [{:grant_tokens, [binary()]}]
@type encrypt_opts() :: [encryption_context: map(), grant_tokens: [binary()]]
Link to this type

generate_data_key_opts()

View Source
@type generate_data_key_opts() :: [
  encryption_context: map(),
  grant_tokens: [binary()],
  key_spec: binary(),
  number_of_bytes: pos_integer()
]
Link to this type

generate_data_key_pair_opts()

View Source
@type generate_data_key_pair_opts() :: [
  encryption_context: map(),
  grant_tokens: [binary()],
  key_pair_spec: binary()
]
Link to this type

generate_data_key_pair_without_plaintext_opts()

View Source
@type generate_data_key_pair_without_plaintext_opts() :: [
  encryption_context: map(),
  grant_tokens: [binary()],
  key_pair_spec: binary()
]
Link to this type

generate_data_key_without_plaintext_opts()

View Source
@type generate_data_key_without_plaintext_opts() :: [
  encryption_context: map(),
  grant_tokens: [binary()],
  key_spec: binary(),
  number_of_bytes: pos_integer()
]
@type get_public_key_opts() :: [{:grant_tokens, [binary()]}]
Link to this type

import_key_material_opts()

View Source
@type import_key_material_opts() :: [expiration_model: binary(), valid_to: binary()]
@type list_aliases_opts() :: [limit: integer(), marker: binary()]
@type list_grants_opts() :: [limit: integer(), marker: binary()]
Link to this type

list_key_policies_opts()

View Source
@type list_key_policies_opts() :: [limit: integer(), marker: binary()]
@type list_keys_opts() :: [limit: integer(), marker: binary()]
Link to this type

list_retirable_grants_opts()

View Source
@type list_retirable_grants_opts() :: [limit: integer(), marker: binary()]
@type re_encrypt_opts() :: [
  destination_encryption_context: map(),
  grant_tokens: [binary()],
  source_encryption_context: map()
]
@type retire_grant_opts() :: [
  grant_id: binary(),
  grant_token: binary(),
  key_id: binary()
]
@type sign_opts() :: [grant_tokens: [binary()], message_type: binary()]
@type verify_opts() :: [grant_tokens: [binary()], message_type: binary()]

Functions

Link to this function

cancel_key_deletion(key_id)

View Source
@spec cancel_key_deletion(key_id :: binary()) :: ExAws.Operation.JSON.t()

Cancel a key deletion

Link to this function

create_alias(alias_name, target_key_id)

View Source
@spec create_alias(alias_name :: binary(), target_key_id :: binary()) ::
  ExAws.Operation.JSON.t()

Create a alias

Link to this function

create_grant(grantee_principal, key_id, opts \\ [])

View Source
@spec create_grant(
  grantee_principal :: binary(),
  key_id :: binary(),
  opts :: Keyword.t()
) ::
  ExAws.Operation.JSON.t()

Adds a grant to a key

@spec create_key(opts :: Keyword.t()) :: ExAws.Operation.JSON.t()

Creates a customer master key (CMK)

Link to this function

decrypt(ciphertext, opts \\ [])

View Source
@spec decrypt(ciphertext :: binary(), opts :: Keyword.t()) :: ExAws.Operation.JSON.t()

Decrypts ciphertext

Link to this function

delete_alias(alias_name)

View Source
@spec delete_alias(alias_name :: binary()) :: ExAws.Operation.JSON.t()

Delete a alias

Link to this function

delete_imported_key_material(key_id)

View Source
@spec delete_imported_key_material(key_id :: binary()) :: ExAws.Operation.JSON.t()

Delete a imported key material

Link to this function

describe_key(key_id, opts \\ [])

View Source
@spec describe_key(key_id :: binary(), opts :: describe_key_opts()) ::
  ExAws.Operation.JSON.t()

Describe a key

Link to this function

disable_key(key_id, opts \\ [])

View Source
@spec disable_key(key_id :: binary(), opts :: disable_key_opts()) ::
  ExAws.Operation.JSON.t()

Disable a key

Link to this function

disable_key_rotation(key_id)

View Source
@spec disable_key_rotation(key_id :: binary()) :: ExAws.Operation.JSON.t()

Disable a key rotation

@spec enable_key(key_id :: binary()) :: ExAws.Operation.JSON.t()

Enable a key

Link to this function

enable_key_rotation(key_id)

View Source
@spec enable_key_rotation(key_id :: binary()) :: ExAws.Operation.JSON.t()

Enable a key rotation

Link to this function

encrypt(key_id, plaintext, opts \\ [])

View Source
@spec encrypt(key_id :: binary(), plaintext :: binary(), opts :: encrypt_opts()) ::
  ExAws.Operation.JSON.t()

Encrypt a data by a key

Link to this function

generate_data_key(key_id, opts \\ [])

View Source
@spec generate_data_key(key_id :: binary(), opts :: generate_data_key_opts()) ::
  ExAws.Operation.JSON.t()

Generate a data key

Link to this function

generate_data_key_pair(key_id, opts \\ [])

View Source
@spec generate_data_key_pair(
  key_id :: binary(),
  opts :: generate_data_key_pair_opts()
) :: ExAws.Operation.JSON.t()

Generate a data key pair

Link to this function

generate_data_key_pair_without_plaintext(key_id, opts \\ [])

View Source
@spec generate_data_key_pair_without_plaintext(
  key_id :: binary(),
  opts :: generate_data_key_pair_without_plaintext_opts()
) :: ExAws.Operation.JSON.t()

Generate a data key pair without plaintext

Link to this function

generate_data_key_without_plaintext(key_id, opts \\ [])

View Source
@spec generate_data_key_without_plaintext(
  key_id :: binary(),
  opts :: generate_data_key_without_plaintext_opts()
) :: ExAws.Operation.JSON.t()

Generate a data key without plaintext

Link to this function

generate_random(number_of_bytes)

View Source
@spec generate_random(number_of_bytes :: pos_integer()) :: ExAws.Operation.JSON.t()

Generates an unpredictable byte string

Link to this function

get_key_policy(key_id, policy_name)

View Source
@spec get_key_policy(key_id :: binary(), policy_name :: binary()) ::
  ExAws.Operation.JSON.t()

Retrieves a policy attached to the specified key

Link to this function

get_key_rotation_status(key_id)

View Source
@spec get_key_rotation_status(key_id :: binary()) :: ExAws.Operation.JSON.t()

Indicates whether key rotation is enabled for the specified key

Link to this function

get_parameters_for_import(key_id, wrapping_algorithm \\ "RSAES_PKCS1_V1_5", wrapping_key_spec \\ "RSA_2048")

View Source
@spec get_parameters_for_import(
  key_id :: binary(),
  wrapping_algorithm :: binary(),
  wrapping_key_spec :: binary()
) :: ExAws.Operation.JSON.t()

Import key matrial

Link to this function

get_public_key(key_id, opts \\ [])

View Source
@spec get_public_key(key_id :: binary(), opts :: get_public_key_opts()) ::
  ExAws.Operation.JSON.t()

Returns the public key of an asymmetric CMK

Link to this function

import_key_material(encrypted_key_material, import_token, key_id, opts \\ [])

View Source
@spec import_key_material(
  encrypted_key_material :: binary(),
  import_token :: binary(),
  key_id :: binary(),
  opts :: import_key_material_opts()
) :: ExAws.Operation.JSON.t()

Imports key material into an AWS KMS customer master key (CMK)

Link to this function

list_aliases(opts \\ [])

View Source
@spec list_aliases(opts :: list_aliases_opts()) :: ExAws.Operation.JSON.t()

Lists all of the key aliases

Link to this function

list_grants(key_id, opts \\ [])

View Source
@spec list_grants(key_id :: binary(), opts :: list_grants_opts()) ::
  ExAws.Operation.JSON.t()

List the grants for a specified key

Link to this function

list_key_policies(key_id, opts \\ [])

View Source
@spec list_key_policies(key_id :: binary(), opts :: list_key_policies_opts()) ::
  ExAws.Operation.JSON.t()

Retrieves a list of policies attached to a key

@spec list_keys(opts :: list_keys_opts()) :: ExAws.Operation.JSON.t()

Lists the customer master keys

Link to this function

list_retirable_grants(retiring_principal, opts \\ [])

View Source
@spec list_retirable_grants(
  retiring_principal :: binary(),
  opts :: list_retirable_grants_opts()
) ::
  ExAws.Operation.JSON.t()

A list of all grants for which the grant's RetiringPrincipal matches the one specified

Link to this function

put_key_policy(key_id, policy, policy_name, bypass_policy_lockout_safety_check \\ false)

View Source
@spec put_key_policy(
  key_id :: binary(),
  policy :: binary(),
  policy_name :: binary(),
  bypass_policy_lockout_safety_check :: boolean()
) :: ExAws.Operation.JSON.t()

Attaches a key policy to the specified customer master key (CMK)

Link to this function

re_encrypt(ciphertext, destination_key_id, opts \\ [])

View Source
@spec re_encrypt(
  ciphertext :: binary(),
  describe_key :: binary(),
  opts :: re_encrypt_opts()
) ::
  ExAws.Operation.JSON.t()

Encrypts data with a new CMK without exposing the plaintext of the data

@spec retire_grant(opts :: retire_grant_opts()) :: ExAws.Operation.JSON.t()
@spec retire_grant(grant_token :: binary()) :: ExAws.Operation.JSON.t()

Retires a grant

Link to this function

retire_grant(grant_id, key_id)

View Source
@spec retire_grant(grant_id :: binary(), key_id :: binary()) ::
  ExAws.Operation.JSON.t()

Retires a grant

Link to this function

revoke_grant(grant_id, key_id)

View Source
@spec revoke_grant(grant_id :: binary(), key_id :: binary()) ::
  ExAws.Operation.JSON.t()

Revokes a grant

Link to this function

schedule_key_deletion(key_id, pending_windows_in_days \\ 30)

View Source
@spec schedule_key_deletion(key_id :: binary(), pending_windows_in_days :: integer()) ::
  ExAws.Operation.JSON.t()

Schedules the deletion of CMK

Link to this function

sign(message, key_id, signing_algorithm, opts \\ [])

View Source
@spec sign(
  message :: binary(),
  key_id :: binary(),
  signing_algorithm :: binary(),
  opts :: sign_opts()
) :: ExAws.Operation.JSON.t()

Create a signature for a message or digest

Link to this function

update_alias(alias_name, target_key_id)

View Source
@spec update_alias(alias_name :: binary(), target_key_id :: binary()) ::
  ExAws.Operation.JSON.t()

Updates an alias to map it to a different key

Link to this function

update_key_description(description, key_id)

View Source
@spec update_key_description(description :: binary(), key_id :: binary()) ::
  ExAws.Operation.JSON.t()

Updates the description of a key

Link to this function

verify(message, signature, key_id, signing_algorithm, opts \\ [])

View Source
@spec verify(
  message :: binary(),
  signature :: binary(),
  key_id :: binary(),
  signing_algorithm :: binary(),
  opts :: verify_opts()
) :: ExAws.Operation.JSON.t()

Verify a signature generated by the sign operation