aws-sdk-kms 1.23.0 → 1.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 413333a0836a4731aca836e7f75f99e1ecb5b36d
4
- data.tar.gz: 47b331d40b345f2d455256ce9613e463218cdaec
3
+ metadata.gz: 7a1d64a3a6d8bb465bd5c3723efd25dc66979b2a
4
+ data.tar.gz: 4d62486183f53d341fda59abe505fe5eb574066f
5
5
  SHA512:
6
- metadata.gz: 3ff3d39c65cb86916df2dd8d2c0e7b84a443a53c32d332bacfbe8b22d3ab6953f2db0bb762f1626674fb6a4898d25d4db586c881fd56fca644f03db1336c144f
7
- data.tar.gz: c10608e588885b8e2b354c1742be0260faa05ca3b4237bb60f3613921c45eac2c5cf7409053c6bdf610604d99dffd48c6a18f655efde8d14b4c8e98252e42036
6
+ metadata.gz: d3c526c701cc03769192f049859da5944e5d9e038ffd967bfd49001c2c67970e77710f96c654653a3ac4c4fef27342a247b406902eeb9a6b95a86c5baf6cfdec
7
+ data.tar.gz: 6c1a94627d34371d991d31b314c60c7da194e554c408ff0fa3d2e44abf803af6885d03f1b2e171dd6ec22fbf30ddc100333f57fc82abb4311b0a14b7668905ba
@@ -42,6 +42,6 @@ require_relative 'aws-sdk-kms/customizations'
42
42
  # @service
43
43
  module Aws::KMS
44
44
 
45
- GEM_VERSION = '1.23.0'
45
+ GEM_VERSION = '1.28.0'
46
46
 
47
47
  end
@@ -265,17 +265,17 @@ module Aws::KMS
265
265
  # @!group API Operations
266
266
 
267
267
  # Cancels the deletion of a customer master key (CMK). When this
268
- # operation is successful, the CMK is set to the `Disabled` state. To
269
- # enable a CMK, use EnableKey. You cannot perform this operation on a
270
- # CMK in a different AWS account.
268
+ # operation succeeds, the key state of the CMK is `Disabled`. To enable
269
+ # the CMK, use EnableKey. You cannot perform this operation on a CMK in
270
+ # a different AWS account.
271
271
  #
272
272
  # For more information about scheduling and canceling deletion of a CMK,
273
273
  # see [Deleting Customer Master Keys][1] in the *AWS Key Management
274
274
  # Service Developer Guide*.
275
275
  #
276
- # The result of this operation varies with the key state of the CMK. For
277
- # details, see [How Key State Affects Use of a Customer Master Key][2]
278
- # in the *AWS Key Management Service Developer Guide*.
276
+ # The CMK that you use for this operation must be in a compatible key
277
+ # state. For details, see [How Key State Affects Use of a Customer
278
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
279
279
  #
280
280
  #
281
281
  #
@@ -344,7 +344,9 @@ module Aws::KMS
344
344
  # To connect a custom key store, its associated AWS CloudHSM cluster
345
345
  # must have at least one active HSM. To get the number of active HSMs in
346
346
  # a cluster, use the [DescribeClusters][2] operation. To add HSMs to the
347
- # cluster, use the [CreateHsm][3] operation.
347
+ # cluster, use the [CreateHsm][3] operation. Also, the [ `kmsuser`
348
+ # crypto user][4] (CU) must not be logged into the cluster. This
349
+ # prevents AWS KMS from using this account to log in.
348
350
  #
349
351
  # The connection process can take an extended amount of time to
350
352
  # complete; up to 20 minutes. This operation starts the connection
@@ -357,8 +359,7 @@ module Aws::KMS
357
359
  # During the connection process, AWS KMS finds the AWS CloudHSM cluster
358
360
  # that is associated with the custom key store, creates the connection
359
361
  # infrastructure, connects to the cluster, logs into the AWS CloudHSM
360
- # client as the [ `kmsuser` crypto user][4] (CU), and rotates its
361
- # password.
362
+ # client as the `kmsuser` CU, and rotates its password.
362
363
  #
363
364
  # The `ConnectCustomKeyStore` operation might fail for various reasons.
364
365
  # To find the reason, use the DescribeCustomKeyStores operation and see
@@ -405,39 +406,78 @@ module Aws::KMS
405
406
  end
406
407
 
407
408
  # Creates a display name for a customer managed customer master key
408
- # (CMK). You can use an alias to identify a CMK in selected operations,
409
- # such as Encrypt and GenerateDataKey.
410
- #
411
- # Each CMK can have multiple aliases, but each alias points to only one
412
- # CMK. The alias name must be unique in the AWS account and region. To
413
- # simplify code that runs in multiple regions, use the same alias name,
414
- # but point it to a different CMK in each region.
409
+ # (CMK). You can use an alias to identify a CMK in cryptographic
410
+ # operations, such as Encrypt and GenerateDataKey. You can change the
411
+ # CMK associated with the alias at any time.
412
+ #
413
+ # Aliases are easier to remember than key IDs. They can also help to
414
+ # simplify your applications. For example, if you use an alias in your
415
+ # code, you can change the CMK your code uses by associating a given
416
+ # alias with a different CMK.
417
+ #
418
+ # To run the same code in multiple AWS regions, use an alias in your
419
+ # code, such as `alias/ApplicationKey`. Then, in each AWS Region, create
420
+ # an `alias/ApplicationKey` alias that is associated with a CMK in that
421
+ # Region. When you run your code, it uses the `alias/ApplicationKey` CMK
422
+ # for that AWS Region without any Region-specific code.
423
+ #
424
+ # This operation does not return a response. To get the alias that you
425
+ # created, use the ListAliases operation.
426
+ #
427
+ # To use aliases successfully, be aware of the following information.
428
+ #
429
+ # * Each alias points to only one CMK at a time, although a single CMK
430
+ # can have multiple aliases. The alias and its associated CMK must be
431
+ # in the same AWS account and Region.
432
+ #
433
+ # * You can associate an alias with any customer managed CMK in the same
434
+ # AWS account and Region. However, you do not have permission to
435
+ # associate an alias with an [AWS managed CMK][1] or an [AWS owned
436
+ # CMK][2].
437
+ #
438
+ # * To change the CMK associated with an alias, use the UpdateAlias
439
+ # operation. The current CMK and the new CMK must be the same type
440
+ # (both symmetric or both asymmetric) and they must have the same key
441
+ # usage (`ENCRYPT_DECRYPT` or `SIGN_VERIFY`). This restriction
442
+ # prevents cryptographic errors in code that uses aliases.
443
+ #
444
+ # * The alias name must begin with `alias/` followed by a name, such as
445
+ # `alias/ExampleAlias`. It can contain only alphanumeric characters,
446
+ # forward slashes (/), underscores (\_), and dashes (-). The alias
447
+ # name cannot begin with `alias/aws/`. The `alias/aws/` prefix is
448
+ # reserved for [AWS managed CMKs][1].
449
+ #
450
+ # * The alias name must be unique within an AWS Region. However, you can
451
+ # use the same alias name in multiple Regions of the same AWS account.
452
+ # Each instance of the alias is associated with a CMK in its Region.
453
+ #
454
+ # * After you create an alias, you cannot change its alias name.
455
+ # However, you can use the DeleteAlias operation to delete the alias
456
+ # and then create a new alias with the desired name.
457
+ #
458
+ # * You can use an alias name or alias ARN to identify a CMK in AWS KMS
459
+ # cryptographic operations and in the DescribeKey operation. However,
460
+ # you cannot use alias names or alias ARNs in API operations that
461
+ # manage CMKs, such as DisableKey or GetKeyPolicy. For information
462
+ # about the valid CMK identifiers for each AWS KMS API operation, see
463
+ # the descriptions of the `KeyId` parameter in the API operation
464
+ # documentation.
415
465
  #
416
466
  # Because an alias is not a property of a CMK, you can delete and change
417
467
  # the aliases of a CMK without affecting the CMK. Also, aliases do not
418
468
  # appear in the response from the DescribeKey operation. To get the
419
- # aliases of all CMKs, use the ListAliases operation.
420
- #
421
- # The alias name must begin with `alias/` followed by a name, such as
422
- # `alias/ExampleAlias`. It can contain only alphanumeric characters,
423
- # forward slashes (/), underscores (\_), and dashes (-). The alias name
424
- # cannot begin with `alias/aws/`. The `alias/aws/` prefix is reserved
425
- # for [AWS managed CMKs][1].
426
- #
427
- # The alias and the CMK it is mapped to must be in the same AWS account
428
- # and the same region. You cannot perform this operation on an alias in
429
- # a different AWS account.
469
+ # aliases and alias ARNs of CMKs in each AWS account and Region, use the
470
+ # ListAliases operation.
430
471
  #
431
- # To map an existing alias to a different CMK, call UpdateAlias.
432
- #
433
- # The result of this operation varies with the key state of the CMK. For
434
- # details, see [How Key State Affects Use of a Customer Master Key][2]
435
- # in the *AWS Key Management Service Developer Guide*.
472
+ # The CMK that you use for this operation must be in a compatible key
473
+ # state. For details, see [How Key State Affects Use of a Customer
474
+ # Master Key][3] in the *AWS Key Management Service Developer Guide*.
436
475
  #
437
476
  #
438
477
  #
439
478
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
440
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
479
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
480
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
441
481
  #
442
482
  # @option params [required, String] :alias_name
443
483
  # Specifies the alias name. This value must begin with `alias/` followed
@@ -542,6 +582,9 @@ module Aws::KMS
542
582
  # the specified AWS CloudHSM cluster. AWS KMS logs into the cluster as
543
583
  # this user to manage key material on your behalf.
544
584
  #
585
+ # The password must be a string of 7 to 32 characters. Its value is case
586
+ # sensitive.
587
+ #
545
588
  # This parameter tells AWS KMS the `kmsuser` account password; it does
546
589
  # not change the password in the AWS CloudHSM cluster.
547
590
  #
@@ -581,23 +624,58 @@ module Aws::KMS
581
624
  # key policies.
582
625
  #
583
626
  # To create a grant that allows a cryptographic operation only when the
584
- # encryption context in the operation request matches or includes a
585
- # specified encryption context, use the `Constraints` parameter. For
586
- # details, see GrantConstraints.
627
+ # request includes a particular [encryption context][1], use the
628
+ # `Constraints` parameter. For details, see GrantConstraints.
629
+ #
630
+ # You can create grants on symmetric and asymmetric CMKs. However, if
631
+ # the grant allows an operation that the CMK does not support,
632
+ # `CreateGrant` fails with a `ValidationException`.
633
+ #
634
+ # * Grants for symmetric CMKs cannot allow operations that are not
635
+ # supported for symmetric CMKs, including Sign, Verify, and
636
+ # GetPublicKey. (There are limited exceptions to this rule for legacy
637
+ # operations, but you should not create a grant for an operation that
638
+ # AWS KMS does not support.)
639
+ #
640
+ # * Grants for asymmetric CMKs cannot allow operations that are not
641
+ # supported for asymmetric CMKs, including operations that [generate
642
+ # data keys][2] or [data key pairs][3], or operations related to
643
+ # [automatic key rotation][4], [imported key material][5], or CMKs in
644
+ # [custom key stores][6].
645
+ #
646
+ # * Grants for asymmetric CMKs with a `KeyUsage` of `ENCRYPT_DECRYPT`
647
+ # cannot allow the Sign or Verify operations. Grants for asymmetric
648
+ # CMKs with a `KeyUsage` of `SIGN_VERIFY` cannot allow the Encrypt or
649
+ # Decrypt operations.
650
+ #
651
+ # * Grants for asymmetric CMKs cannot include an encryption context
652
+ # grant constraint. An encryption context is not supported on
653
+ # asymmetric CMKs.
654
+ #
655
+ # For information about symmetric and asymmetric CMKs, see [Using
656
+ # Symmetric and Asymmetric CMKs][7] in the *AWS Key Management Service
657
+ # Developer Guide*.
587
658
  #
588
659
  # To perform this operation on a CMK in a different AWS account, specify
589
660
  # the key ARN in the value of the `KeyId` parameter. For more
590
- # information about grants, see [Grants][1] in the <i> <i>AWS Key
661
+ # information about grants, see [Grants][8] in the <i> <i>AWS Key
591
662
  # Management Service Developer Guide</i> </i>.
592
663
  #
593
- # The result of this operation varies with the key state of the CMK. For
594
- # details, see [How Key State Affects Use of a Customer Master Key][2]
595
- # in the *AWS Key Management Service Developer Guide*.
664
+ # The CMK that you use for this operation must be in a compatible key
665
+ # state. For details, see [How Key State Affects Use of a Customer
666
+ # Master Key][9] in the *AWS Key Management Service Developer Guide*.
596
667
  #
597
668
  #
598
669
  #
599
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html
600
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
670
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
671
+ # [2]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey
672
+ # [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPair
673
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
674
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
675
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
676
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
677
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html
678
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
601
679
  #
602
680
  # @option params [required, String] :key_id
603
681
  # The unique identifier for the customer master key (CMK) that the grant
@@ -720,7 +798,7 @@ module Aws::KMS
720
798
  # key_id: "KeyIdType", # required
721
799
  # grantee_principal: "PrincipalIdType", # required
722
800
  # retiring_principal: "PrincipalIdType",
723
- # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, CreateGrant, RetireGrant, DescribeKey
801
+ # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext
724
802
  # constraints: {
725
803
  # encryption_context_subset: {
726
804
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -747,31 +825,91 @@ module Aws::KMS
747
825
  req.send_request(options)
748
826
  end
749
827
 
750
- # Creates a customer managed [customer master key][1] (CMK) in your AWS
751
- # account.
828
+ # Creates a unique customer managed [customer master key][1] (CMK) in
829
+ # your AWS account and Region. You cannot use this operation to create a
830
+ # CMK in a different AWS account.
831
+ #
832
+ # You can use the `CreateKey` operation to create symmetric or
833
+ # asymmetric CMKs.
834
+ #
835
+ # * **Symmetric CMKs** contain a 256-bit symmetric key that never leaves
836
+ # AWS KMS unencrypted. To use the CMK, you must call AWS KMS. You can
837
+ # use a symmetric CMK to encrypt and decrypt small amounts of data,
838
+ # but they are typically used to generate [data keys][2] and [data
839
+ # keys pairs][3]. For details, see GenerateDataKey and
840
+ # GenerateDataKeyPair.
841
+ #
842
+ # * **Asymmetric CMKs** can contain an RSA key pair or an Elliptic Curve
843
+ # (ECC) key pair. The private key in an asymmetric CMK never leaves
844
+ # AWS KMS unencrypted. However, you can use the GetPublicKey operation
845
+ # to download the public key so it can be used outside of AWS KMS.
846
+ # CMKs with RSA key pairs can be used to encrypt or decrypt data or
847
+ # sign and verify messages (but not both). CMKs with ECC key pairs can
848
+ # be used only to sign and verify messages.
849
+ #
850
+ # For information about symmetric and asymmetric CMKs, see [Using
851
+ # Symmetric and Asymmetric CMKs][4] in the *AWS Key Management Service
852
+ # Developer Guide*.
752
853
  #
753
- # You can use a CMK to encrypt small amounts of data (up to 4096 bytes)
754
- # directly. But CMKs are more commonly used to encrypt the [data
755
- # keys][2] that are used to encrypt data.
854
+ # To create different types of CMKs, use the following guidance:
756
855
  #
757
- # To create a CMK for imported key material, use the `Origin` parameter
758
- # with a value of `EXTERNAL`.
856
+ # Asymmetric CMKs
759
857
  #
760
- # To create a CMK in a [custom key store][3], use the `CustomKeyStoreId`
761
- # parameter to specify the custom key store. You must also use the
762
- # `Origin` parameter with a value of `AWS_CLOUDHSM`. The AWS CloudHSM
763
- # cluster that is associated with the custom key store must have at
764
- # least two active HSMs in different Availability Zones in the AWS
765
- # Region.
858
+ # : To create an asymmetric CMK, use the `CustomerMasterKeySpec`
859
+ # parameter to specify the type of key material in the CMK. Then, use
860
+ # the `KeyUsage` parameter to determine whether the CMK will be used
861
+ # to encrypt and decrypt or sign and verify. You can't change these
862
+ # properties after the CMK is created.
766
863
  #
767
- # You cannot use this operation to create a CMK in a different AWS
768
- # account.
769
864
  #
770
865
  #
866
+ # Symmetric CMKs
867
+ #
868
+ # : When creating a symmetric CMK, you don't need to specify the
869
+ # `CustomerMasterKeySpec` or `KeyUsage` parameters. The default value
870
+ # for `CustomerMasterKeySpec`, `SYMMETRIC_DEFAULT`, and the default
871
+ # value for `KeyUsage`, `ENCRYPT_DECRYPT`, are the only valid values
872
+ # for symmetric CMKs.
873
+ #
874
+ #
875
+ #
876
+ # Imported Key Material
877
+ #
878
+ # : To import your own key material, begin by creating a symmetric CMK
879
+ # with no key material. To do this, use the `Origin` parameter of
880
+ # `CreateKey` with a value of `EXTERNAL`. Next, use
881
+ # GetParametersForImport operation to get a public key and import
882
+ # token, and use the public key to encrypt your key material. Then,
883
+ # use ImportKeyMaterial with your import token to import the key
884
+ # material. For step-by-step instructions, see [Importing Key
885
+ # Material][5] in the <i> <i>AWS Key Management Service Developer
886
+ # Guide</i> </i>. You cannot import the key material into an
887
+ # asymmetric CMK.
888
+ #
889
+ #
890
+ #
891
+ # Custom Key Stores
892
+ #
893
+ # : To create a symmetric CMK in a [custom key store][6], use the
894
+ # `CustomKeyStoreId` parameter to specify the custom key store. You
895
+ # must also use the `Origin` parameter with a value of `AWS_CLOUDHSM`.
896
+ # The AWS CloudHSM cluster that is associated with the custom key
897
+ # store must have at least two active HSMs in different Availability
898
+ # Zones in the AWS Region.
899
+ #
900
+ # You cannot create an asymmetric CMK in a custom key store. For
901
+ # information about custom key stores in AWS KMS see [Using Custom Key
902
+ # Stores][6] in the <i> <i>AWS Key Management Service Developer
903
+ # Guide</i> </i>.
904
+ #
771
905
  #
772
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys
906
+ #
907
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master-keys
773
908
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
774
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
909
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs
910
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
911
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
912
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
775
913
  #
776
914
  # @option params [String] :policy
777
915
  # The key policy to attach to the CMK.
@@ -799,7 +937,7 @@ module Aws::KMS
799
937
  # policy to the CMK. For more information, see [Default Key Policy][3]
800
938
  # in the *AWS Key Management Service Developer Guide*.
801
939
  #
802
- # The key policy size limit is 32 kilobytes (32768 bytes).
940
+ # The key policy size quota is 32 kilobytes (32768 bytes).
803
941
  #
804
942
  #
805
943
  #
@@ -814,27 +952,97 @@ module Aws::KMS
814
952
  # for a task.
815
953
  #
816
954
  # @option params [String] :key_usage
817
- # The cryptographic operations for which you can use the CMK. The only
818
- # valid value is `ENCRYPT_DECRYPT`, which means you can use the CMK to
819
- # encrypt and decrypt data.
955
+ # Determines the cryptographic operations for which you can use the CMK.
956
+ # The default value is `ENCRYPT_DECRYPT`. This parameter is required
957
+ # only for asymmetric CMKs. You can't change the `KeyUsage` value after
958
+ # the CMK is created.
959
+ #
960
+ # Select only one valid value.
961
+ #
962
+ # * For symmetric CMKs, omit the parameter or specify `ENCRYPT_DECRYPT`.
963
+ #
964
+ # * For asymmetric CMKs with RSA key material, specify `ENCRYPT_DECRYPT`
965
+ # or `SIGN_VERIFY`.
966
+ #
967
+ # * For asymmetric CMKs with ECC key material, specify `SIGN_VERIFY`.
968
+ #
969
+ # @option params [String] :customer_master_key_spec
970
+ # Specifies the type of CMK to create. The default value,
971
+ # `SYMMETRIC_DEFAULT`, creates a CMK with a 256-bit symmetric key for
972
+ # encryption and decryption. For help choosing a key spec for your CMK,
973
+ # see [How to Choose Your CMK Configuration][1] in the *AWS Key
974
+ # Management Service Developer Guide*.
975
+ #
976
+ # The `CustomerMasterKeySpec` determines whether the CMK contains a
977
+ # symmetric key or an asymmetric key pair. It also determines the
978
+ # encryption algorithms or signing algorithms that the CMK supports. You
979
+ # can't change the `CustomerMasterKeySpec` after the CMK is created. To
980
+ # further restrict the algorithms that can be used with the CMK, use a
981
+ # condition key in its key policy or IAM policy. For more information,
982
+ # see [kms:EncryptionAlgorithm][2] or [kms:Signing Algorithm][3] in the
983
+ # *AWS Key Management Service Developer Guide*.
984
+ #
985
+ # [AWS services that are integrated with AWS KMS][4] use symmetric CMKs
986
+ # to protect your data. These services do not support asymmetric CMKs.
987
+ # For help determining whether a CMK is symmetric or asymmetric, see
988
+ # [Identifying Symmetric and Asymmetric CMKs][5] in the *AWS Key
989
+ # Management Service Developer Guide*.
990
+ #
991
+ # AWS KMS supports the following key specs for CMKs:
992
+ #
993
+ # * Symmetric key (default)
994
+ #
995
+ # * `SYMMETRIC_DEFAULT` (AES-256-GCM)
996
+ #
997
+ # ^
998
+ #
999
+ # * Asymmetric RSA key pairs
1000
+ #
1001
+ # * `RSA_2048`
1002
+ #
1003
+ # * `RSA_3072`
1004
+ #
1005
+ # * `RSA_4096`
1006
+ #
1007
+ # * Asymmetric NIST-recommended elliptic curve key pairs
1008
+ #
1009
+ # * `ECC_NIST_P256` (secp256r1)
1010
+ #
1011
+ # * `ECC_NIST_P384` (secp384r1)
1012
+ #
1013
+ # * `ECC_NIST_P521` (secp521r1)
1014
+ #
1015
+ # * Other asymmetric elliptic curve key pairs
1016
+ #
1017
+ # * `ECC_SECG_P256K1` (secp256k1), commonly used for cryptocurrencies.
1018
+ #
1019
+ # ^
1020
+ #
1021
+ #
1022
+ #
1023
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html
1024
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm
1025
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1026
+ # [4]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1027
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html
820
1028
  #
821
1029
  # @option params [String] :origin
822
1030
  # The source of the key material for the CMK. You cannot change the
823
- # origin after you create the CMK.
824
- #
825
- # The default is `AWS_KMS`, which means AWS KMS creates the key material
826
- # in its own key store.
1031
+ # origin after you create the CMK. The default is `AWS_KMS`, which means
1032
+ # AWS KMS creates the key material.
827
1033
  #
828
1034
  # When the parameter value is `EXTERNAL`, AWS KMS creates a CMK without
829
1035
  # key material so that you can import key material from your existing
830
1036
  # key management infrastructure. For more information about importing
831
1037
  # key material into AWS KMS, see [Importing Key Material][1] in the *AWS
832
- # Key Management Service Developer Guide*.
1038
+ # Key Management Service Developer Guide*. This value is valid only for
1039
+ # symmetric CMKs.
833
1040
  #
834
1041
  # When the parameter value is `AWS_CLOUDHSM`, AWS KMS creates the CMK in
835
1042
  # an AWS KMS [custom key store][2] and creates its key material in the
836
1043
  # associated AWS CloudHSM cluster. You must also use the
837
- # `CustomKeyStoreId` parameter to identify the custom key store.
1044
+ # `CustomKeyStoreId` parameter to identify the custom key store. This
1045
+ # value is valid only for symmetric CMKs.
838
1046
  #
839
1047
  #
840
1048
  #
@@ -849,6 +1057,9 @@ module Aws::KMS
849
1057
  # with the custom key store must have at least two active HSMs, each in
850
1058
  # a different Availability Zone in the Region.
851
1059
  #
1060
+ # This parameter is valid only for symmetric CMKs. You cannot create an
1061
+ # asymmetric CMK in a custom key store.
1062
+ #
852
1063
  # To find the ID of a custom key store, use the DescribeCustomKeyStores
853
1064
  # operation.
854
1065
  #
@@ -885,13 +1096,21 @@ module Aws::KMS
885
1096
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
886
1097
  #
887
1098
  # @option params [Array<Types::Tag>] :tags
888
- # One or more tags. Each tag consists of a tag key and a tag value. Tag
889
- # keys and tag values are both required, but tag values can be empty
890
- # (null) strings.
1099
+ # One or more tags. Each tag consists of a tag key and a tag value. Both
1100
+ # the tag key and the tag value are required, but the tag value can be
1101
+ # an empty (null) string.
891
1102
  #
892
- # Use this parameter to tag the CMK when it is created. Alternately, you
893
- # can omit this parameter and instead tag the CMK after it is created
894
- # using TagResource.
1103
+ # When you add tags to an AWS resource, AWS generates a cost allocation
1104
+ # report with usage and costs aggregated by tags. For information about
1105
+ # adding, changing, deleting and listing tags for CMKs, see [Tagging
1106
+ # Keys][1].
1107
+ #
1108
+ # Use this parameter to tag the CMK when it is created. To add tags to
1109
+ # an existing CMK, use the TagResource operation.
1110
+ #
1111
+ #
1112
+ #
1113
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html
895
1114
  #
896
1115
  # @return [Types::CreateKeyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
897
1116
  #
@@ -932,7 +1151,8 @@ module Aws::KMS
932
1151
  # resp = client.create_key({
933
1152
  # policy: "PolicyType",
934
1153
  # description: "DescriptionType",
935
- # key_usage: "ENCRYPT_DECRYPT", # accepts ENCRYPT_DECRYPT
1154
+ # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT
1155
+ # customer_master_key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT
936
1156
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM
937
1157
  # custom_key_store_id: "CustomKeyStoreIdType",
938
1158
  # bypass_policy_lockout_safety_check: false,
@@ -952,7 +1172,7 @@ module Aws::KMS
952
1172
  # resp.key_metadata.creation_date #=> Time
953
1173
  # resp.key_metadata.enabled #=> Boolean
954
1174
  # resp.key_metadata.description #=> String
955
- # resp.key_metadata.key_usage #=> String, one of "ENCRYPT_DECRYPT"
1175
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
956
1176
  # resp.key_metadata.key_state #=> String, one of "Enabled", "Disabled", "PendingDeletion", "PendingImport", "Unavailable"
957
1177
  # resp.key_metadata.deletion_date #=> Time
958
1178
  # resp.key_metadata.valid_to #=> Time
@@ -961,6 +1181,11 @@ module Aws::KMS
961
1181
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
962
1182
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
963
1183
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
1184
+ # resp.key_metadata.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
1185
+ # resp.key_metadata.encryption_algorithms #=> Array
1186
+ # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1187
+ # resp.key_metadata.signing_algorithms #=> Array
1188
+ # resp.key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512"
964
1189
  #
965
1190
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey AWS API Documentation
966
1191
  #
@@ -971,39 +1196,79 @@ module Aws::KMS
971
1196
  req.send_request(options)
972
1197
  end
973
1198
 
974
- # Decrypts ciphertext. Ciphertext is plaintext that has been previously
975
- # encrypted by using any of the following operations:
1199
+ # Decrypts ciphertext that was encrypted by a AWS KMS customer master
1200
+ # key (CMK) using any of the following operations:
1201
+ #
1202
+ # * Encrypt
976
1203
  #
977
1204
  # * GenerateDataKey
978
1205
  #
1206
+ # * GenerateDataKeyPair
1207
+ #
979
1208
  # * GenerateDataKeyWithoutPlaintext
980
1209
  #
981
- # * Encrypt
1210
+ # * GenerateDataKeyPairWithoutPlaintext
1211
+ #
1212
+ # You can use this operation to decrypt ciphertext that was encrypted
1213
+ # under a symmetric or asymmetric CMK. When the CMK is asymmetric, you
1214
+ # must specify the CMK and the encryption algorithm that was used to
1215
+ # encrypt the ciphertext. For information about symmetric and asymmetric
1216
+ # CMKs, see [Using Symmetric and Asymmetric CMKs][1] in the *AWS Key
1217
+ # Management Service Developer Guide*.
1218
+ #
1219
+ # The Decrypt operation also decrypts ciphertext that was encrypted
1220
+ # outside of AWS KMS by the public key in an AWS KMS asymmetric CMK.
1221
+ # However, it cannot decrypt ciphertext produced by other libraries,
1222
+ # such as the [AWS Encryption SDK][2] or [Amazon S3 client-side
1223
+ # encryption][3]. These libraries return a ciphertext format that is
1224
+ # incompatible with AWS KMS.
1225
+ #
1226
+ # If the ciphertext was encrypted under a symmetric CMK, you do not need
1227
+ # to specify the CMK or the encryption algorithm. AWS KMS can get this
1228
+ # information from metadata that it adds to the symmetric ciphertext
1229
+ # blob. However, if you prefer, you can specify the `KeyId` to ensure
1230
+ # that a particular CMK is used to decrypt the ciphertext. If you
1231
+ # specify a different CMK than the one used to encrypt the ciphertext,
1232
+ # the `Decrypt` operation fails.
982
1233
  #
983
1234
  # Whenever possible, use key policies to give users permission to call
984
- # the Decrypt operation on the CMK, instead of IAM policies. Otherwise,
985
- # you might create an IAM user policy that gives the user Decrypt
986
- # permission on all CMKs. This user could decrypt ciphertext that was
987
- # encrypted by CMKs in other accounts if the key policy for the
988
- # cross-account CMK permits it. If you must use an IAM policy for
989
- # `Decrypt` permissions, limit the user to particular CMKs or particular
990
- # trusted accounts.
991
- #
992
- # The result of this operation varies with the key state of the CMK. For
993
- # details, see [How Key State Affects Use of a Customer Master Key][1]
994
- # in the *AWS Key Management Service Developer Guide*.
1235
+ # the Decrypt operation on a particular CMK, instead of using IAM
1236
+ # policies. Otherwise, you might create an IAM user policy that gives
1237
+ # the user Decrypt permission on all CMKs. This user could decrypt
1238
+ # ciphertext that was encrypted by CMKs in other accounts if the key
1239
+ # policy for the cross-account CMK permits it. If you must use an IAM
1240
+ # policy for `Decrypt` permissions, limit the user to particular CMKs or
1241
+ # particular trusted accounts.
995
1242
  #
1243
+ # The CMK that you use for this operation must be in a compatible key
1244
+ # state. For details, see [How Key State Affects Use of a Customer
1245
+ # Master Key][4] in the *AWS Key Management Service Developer Guide*.
996
1246
  #
997
1247
  #
998
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
1248
+ #
1249
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1250
+ # [2]: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/
1251
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html
1252
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
999
1253
  #
1000
1254
  # @option params [required, String, IO] :ciphertext_blob
1001
1255
  # Ciphertext to be decrypted. The blob includes metadata.
1002
1256
  #
1003
1257
  # @option params [Hash<String,String>] :encryption_context
1004
- # The encryption context. If this was specified in the Encrypt function,
1005
- # it must be specified here or the decryption operation will fail. For
1006
- # more information, see [Encryption Context][1].
1258
+ # Specifies the encryption context to use when decrypting the data. An
1259
+ # encryption context is valid only for cryptographic operations with a
1260
+ # symmetric CMK. The standard asymmetric encryption algorithms that AWS
1261
+ # KMS uses do not support an encryption context.
1262
+ #
1263
+ # An *encryption context* is a collection of non-secret key-value pairs
1264
+ # that represents additional authenticated data. When you use an
1265
+ # encryption context to encrypt data, you must specify the same (an
1266
+ # exact case-sensitive match) encryption context to decrypt the data. An
1267
+ # encryption context is optional when encrypting with a symmetric CMK,
1268
+ # but it is highly recommended.
1269
+ #
1270
+ # For more information, see [Encryption Context][1] in the *AWS Key
1271
+ # Management Service Developer Guide*.
1007
1272
  #
1008
1273
  #
1009
1274
  #
@@ -1019,10 +1284,54 @@ module Aws::KMS
1019
1284
  #
1020
1285
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
1021
1286
  #
1287
+ # @option params [String] :key_id
1288
+ # Specifies the customer master key (CMK) that AWS KMS will use to
1289
+ # decrypt the ciphertext. Enter a key ID of the CMK that was used to
1290
+ # encrypt the ciphertext.
1291
+ #
1292
+ # If you specify a `KeyId` value, the `Decrypt` operation succeeds only
1293
+ # if the specified CMK was used to encrypt the ciphertext.
1294
+ #
1295
+ # This parameter is required only when the ciphertext was encrypted
1296
+ # under an asymmetric CMK. Otherwise, AWS KMS uses the metadata that it
1297
+ # adds to the ciphertext blob to determine which CMK was used to encrypt
1298
+ # the ciphertext. However, you can use this parameter to ensure that a
1299
+ # particular CMK (of any kind) is used to decrypt the ciphertext.
1300
+ #
1301
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
1302
+ # name, or alias ARN. When using an alias name, prefix it with
1303
+ # `"alias/"`.
1304
+ #
1305
+ # For example:
1306
+ #
1307
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
1308
+ #
1309
+ # * Key ARN:
1310
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
1311
+ #
1312
+ # * Alias name: `alias/ExampleAlias`
1313
+ #
1314
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
1315
+ #
1316
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
1317
+ # To get the alias name and alias ARN, use ListAliases.
1318
+ #
1319
+ # @option params [String] :encryption_algorithm
1320
+ # Specifies the encryption algorithm that will be used to decrypt the
1321
+ # ciphertext. Specify the same algorithm that was used to encrypt the
1322
+ # data. If you specify a different algorithm, the `Decrypt` operation
1323
+ # fails.
1324
+ #
1325
+ # This parameter is required only when the ciphertext was encrypted
1326
+ # under an asymmetric CMK. The default value, `SYMMETRIC_DEFAULT`,
1327
+ # represents the only supported algorithm that is valid for symmetric
1328
+ # CMKs.
1329
+ #
1022
1330
  # @return [Types::DecryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1023
1331
  #
1024
1332
  # * {Types::DecryptResponse#key_id #key_id} => String
1025
1333
  # * {Types::DecryptResponse#plaintext #plaintext} => String
1334
+ # * {Types::DecryptResponse#encryption_algorithm #encryption_algorithm} => String
1026
1335
  #
1027
1336
  #
1028
1337
  # @example Example: To decrypt data
@@ -1047,12 +1356,15 @@ module Aws::KMS
1047
1356
  # "EncryptionContextKey" => "EncryptionContextValue",
1048
1357
  # },
1049
1358
  # grant_tokens: ["GrantTokenType"],
1359
+ # key_id: "KeyIdType",
1360
+ # encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
1050
1361
  # })
1051
1362
  #
1052
1363
  # @example Response structure
1053
1364
  #
1054
1365
  # resp.key_id #=> String
1055
1366
  # resp.plaintext #=> String
1367
+ # resp.encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1056
1368
  #
1057
1369
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt AWS API Documentation
1058
1370
  #
@@ -1178,9 +1490,9 @@ module Aws::KMS
1178
1490
  # After you delete key material, you can use ImportKeyMaterial to
1179
1491
  # reimport the same key material into the CMK.
1180
1492
  #
1181
- # The result of this operation varies with the key state of the CMK. For
1182
- # details, see [How Key State Affects Use of a Customer Master Key][2]
1183
- # in the *AWS Key Management Service Developer Guide*.
1493
+ # The CMK that you use for this operation must be in a compatible key
1494
+ # state. For details, see [How Key State Affects Use of a Customer
1495
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
1184
1496
  #
1185
1497
  #
1186
1498
  #
@@ -1314,7 +1626,7 @@ module Aws::KMS
1314
1626
  # resp.custom_key_stores[0].cloud_hsm_cluster_id #=> String
1315
1627
  # resp.custom_key_stores[0].trust_anchor_certificate #=> String
1316
1628
  # resp.custom_key_stores[0].connection_state #=> String, one of "CONNECTED", "CONNECTING", "FAILED", "DISCONNECTED", "DISCONNECTING"
1317
- # resp.custom_key_stores[0].connection_error_code #=> String, one of "INVALID_CREDENTIALS", "CLUSTER_NOT_FOUND", "NETWORK_ERRORS", "INTERNAL_ERROR", "INSUFFICIENT_CLOUDHSM_HSMS", "USER_LOCKED_OUT"
1629
+ # resp.custom_key_stores[0].connection_error_code #=> String, one of "INVALID_CREDENTIALS", "CLUSTER_NOT_FOUND", "NETWORK_ERRORS", "INTERNAL_ERROR", "INSUFFICIENT_CLOUDHSM_HSMS", "USER_LOCKED_OUT", "USER_NOT_FOUND", "USER_LOGGED_IN"
1318
1630
  # resp.custom_key_stores[0].creation_date #=> Time
1319
1631
  # resp.next_marker #=> String
1320
1632
  # resp.truncated #=> Boolean
@@ -1328,20 +1640,50 @@ module Aws::KMS
1328
1640
  req.send_request(options)
1329
1641
  end
1330
1642
 
1331
- # Provides detailed information about the specified customer master key
1332
- # (CMK).
1643
+ # Provides detailed information about a customer master key (CMK). You
1644
+ # can run `DescribeKey` on a [customer managed CMK][1] or an [AWS
1645
+ # managed CMK][2].
1646
+ #
1647
+ # This detailed information includes the key ARN, creation date (and
1648
+ # deletion date, if applicable), the key state, and the origin and
1649
+ # expiration date (if any) of the key material. For CMKs in custom key
1650
+ # stores, it includes information about the custom key store, such as
1651
+ # the key store ID and the AWS CloudHSM cluster ID. It includes fields,
1652
+ # like `KeySpec`, that help you distinguish symmetric from asymmetric
1653
+ # CMKs. It also provides information that is particularly important to
1654
+ # asymmetric CMKs, such as the key usage (encryption or signing) and the
1655
+ # encryption algorithms or signing algorithms that the CMK supports.
1656
+ #
1657
+ # `DescribeKey` does not return the following information:
1658
+ #
1659
+ # * Aliases associated with the CMK. To get this information, use
1660
+ # ListAliases.
1661
+ #
1662
+ # * Whether automatic key rotation is enabled on the CMK. To get this
1663
+ # information, use GetKeyRotationStatus. Also, some key states prevent
1664
+ # a CMK from being automatically rotated. For details, see [How
1665
+ # Automatic Key Rotation Works][3] in *AWS Key Management Service
1666
+ # Developer Guide*.
1333
1667
  #
1334
- # You can use `DescribeKey` on a predefined AWS alias, that is, an AWS
1335
- # alias with no key ID. When you do, AWS KMS associates the alias with
1336
- # an [AWS managed CMK][1] and returns its `KeyId` and `Arn` in the
1337
- # response.
1668
+ # * Tags on the CMK. To get this information, use ListResourceTags.
1669
+ #
1670
+ # * Key policies and grants on the CMK. To get this information, use
1671
+ # GetKeyPolicy and ListGrants.
1672
+ #
1673
+ # If you call the `DescribeKey` operation on a *predefined AWS alias*,
1674
+ # that is, an AWS alias with no key ID, AWS KMS creates an [AWS managed
1675
+ # CMK][4]. Then, it associates the alias with the new CMK, and returns
1676
+ # the `KeyId` and `Arn` of the new CMK in the response.
1338
1677
  #
1339
1678
  # To perform this operation on a CMK in a different AWS account, specify
1340
1679
  # the key ARN or alias ARN in the value of the KeyId parameter.
1341
1680
  #
1342
1681
  #
1343
1682
  #
1344
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys
1683
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
1684
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
1685
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-how-it-works
1686
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys
1345
1687
  #
1346
1688
  # @option params [required, String] :key_id
1347
1689
  # Describes the specified customer master key (CMK).
@@ -1427,7 +1769,7 @@ module Aws::KMS
1427
1769
  # resp.key_metadata.creation_date #=> Time
1428
1770
  # resp.key_metadata.enabled #=> Boolean
1429
1771
  # resp.key_metadata.description #=> String
1430
- # resp.key_metadata.key_usage #=> String, one of "ENCRYPT_DECRYPT"
1772
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
1431
1773
  # resp.key_metadata.key_state #=> String, one of "Enabled", "Disabled", "PendingDeletion", "PendingImport", "Unavailable"
1432
1774
  # resp.key_metadata.deletion_date #=> Time
1433
1775
  # resp.key_metadata.valid_to #=> Time
@@ -1436,6 +1778,11 @@ module Aws::KMS
1436
1778
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
1437
1779
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
1438
1780
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
1781
+ # resp.key_metadata.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
1782
+ # resp.key_metadata.encryption_algorithms #=> Array
1783
+ # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1784
+ # resp.key_metadata.signing_algorithms #=> Array
1785
+ # resp.key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512"
1439
1786
  #
1440
1787
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey AWS API Documentation
1441
1788
  #
@@ -1454,9 +1801,9 @@ module Aws::KMS
1454
1801
  # [How Key State Affects the Use of a Customer Master Key][1] in the <i>
1455
1802
  # <i>AWS Key Management Service Developer Guide</i> </i>.
1456
1803
  #
1457
- # The result of this operation varies with the key state of the CMK. For
1458
- # details, see [How Key State Affects Use of a Customer Master Key][1]
1459
- # in the *AWS Key Management Service Developer Guide*.
1804
+ # The CMK that you use for this operation must be in a compatible key
1805
+ # state. For details, see [How Key State Affects Use of a Customer
1806
+ # Master Key][1] in the *AWS Key Management Service Developer Guide*.
1460
1807
  #
1461
1808
  #
1462
1809
  #
@@ -1503,20 +1850,26 @@ module Aws::KMS
1503
1850
  end
1504
1851
 
1505
1852
  # Disables [automatic rotation of the key material][1] for the specified
1506
- # customer master key (CMK). You cannot perform this operation on a CMK
1507
- # in a different AWS account.
1853
+ # symmetric customer master key (CMK).
1508
1854
  #
1509
- # The result of this operation varies with the key state of the CMK. For
1510
- # details, see [How Key State Affects Use of a Customer Master Key][2]
1511
- # in the *AWS Key Management Service Developer Guide*.
1855
+ # You cannot enable automatic rotation of asymmetric CMKs, CMKs with
1856
+ # imported key material, or CMKs in a [custom key store][2]. You cannot
1857
+ # perform this operation on a CMK in a different AWS account.
1858
+ #
1859
+ # The CMK that you use for this operation must be in a compatible key
1860
+ # state. For details, see [How Key State Affects Use of a Customer
1861
+ # Master Key][3] in the *AWS Key Management Service Developer Guide*.
1512
1862
  #
1513
1863
  #
1514
1864
  #
1515
1865
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
1516
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
1866
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
1867
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
1517
1868
  #
1518
1869
  # @option params [required, String] :key_id
1519
- # A unique identifier for the customer master key (CMK).
1870
+ # Identifies a symmetric customer master key (CMK). You cannot enable
1871
+ # automatic rotation of [asymmetric CMKs][1], CMKs with [imported key
1872
+ # material][2], or CMKs in a [custom key store][3].
1520
1873
  #
1521
1874
  # Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
1522
1875
  #
@@ -1529,6 +1882,12 @@ module Aws::KMS
1529
1882
  #
1530
1883
  # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
1531
1884
  #
1885
+ #
1886
+ #
1887
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks
1888
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
1889
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
1890
+ #
1532
1891
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1533
1892
  #
1534
1893
  #
@@ -1611,9 +1970,9 @@ module Aws::KMS
1611
1970
  # allows you to use the CMK for cryptographic operations. You cannot
1612
1971
  # perform this operation on a CMK in a different AWS account.
1613
1972
  #
1614
- # The result of this operation varies with the key state of the CMK. For
1615
- # details, see [How Key State Affects Use of a Customer Master Key][1]
1616
- # in the *AWS Key Management Service Developer Guide*.
1973
+ # The CMK that you use for this operation must be in a compatible key
1974
+ # state. For details, see [How Key State Affects Use of a Customer
1975
+ # Master Key][1] in the *AWS Key Management Service Developer Guide*.
1617
1976
  #
1618
1977
  #
1619
1978
  #
@@ -1660,15 +2019,15 @@ module Aws::KMS
1660
2019
  end
1661
2020
 
1662
2021
  # Enables [automatic rotation of the key material][1] for the specified
1663
- # customer master key (CMK). You cannot perform this operation on a CMK
1664
- # in a different AWS account.
2022
+ # symmetric customer master key (CMK). You cannot perform this operation
2023
+ # on a CMK in a different AWS account.
1665
2024
  #
1666
- # You cannot enable automatic rotation of CMKs with imported key
1667
- # material or CMKs in a [custom key store][2].
2025
+ # You cannot enable automatic rotation of asymmetric CMKs, CMKs with
2026
+ # imported key material, or CMKs in a [custom key store][2].
1668
2027
  #
1669
- # The result of this operation varies with the key state of the CMK. For
1670
- # details, see [How Key State Affects Use of a Customer Master Key][3]
1671
- # in the *AWS Key Management Service Developer Guide*.
2028
+ # The CMK that you use for this operation must be in a compatible key
2029
+ # state. For details, see [How Key State Affects Use of a Customer
2030
+ # Master Key][3] in the *AWS Key Management Service Developer Guide*.
1672
2031
  #
1673
2032
  #
1674
2033
  #
@@ -1677,7 +2036,9 @@ module Aws::KMS
1677
2036
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
1678
2037
  #
1679
2038
  # @option params [required, String] :key_id
1680
- # A unique identifier for the customer master key (CMK).
2039
+ # Identifies a symmetric customer master key (CMK). You cannot enable
2040
+ # automatic rotation of asymmetric CMKs, CMKs with imported key
2041
+ # material, or CMKs in a [custom key store][1].
1681
2042
  #
1682
2043
  # Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
1683
2044
  #
@@ -1690,6 +2051,10 @@ module Aws::KMS
1690
2051
  #
1691
2052
  # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
1692
2053
  #
2054
+ #
2055
+ #
2056
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2057
+ #
1693
2058
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1694
2059
  #
1695
2060
  #
@@ -1719,9 +2084,8 @@ module Aws::KMS
1719
2084
  # Encrypts plaintext into ciphertext by using a customer master key
1720
2085
  # (CMK). The `Encrypt` operation has two primary use cases:
1721
2086
  #
1722
- # * You can encrypt up to 4 kilobytes (4096 bytes) of arbitrary data
1723
- # such as an RSA key, a database password, or other sensitive
1724
- # information.
2087
+ # * You can encrypt small amounts of arbitrary data, such as a personal
2088
+ # identifier or database password, or other sensitive information.
1725
2089
  #
1726
2090
  # * You can use the `Encrypt` operation to move encrypted data from one
1727
2091
  # AWS region to another. In the first region, generate a data key and
@@ -1730,24 +2094,76 @@ module Aws::KMS
1730
2094
  # safely move the encrypted data and encrypted data key to the new
1731
2095
  # region, and decrypt in the new region when necessary.
1732
2096
  #
1733
- # You don't need use this operation to encrypt a data key within a
1734
- # region. The GenerateDataKey and GenerateDataKeyWithoutPlaintext
1735
- # operations return an encrypted data key.
2097
+ # You don't need to use the `Encrypt` operation to encrypt a data key.
2098
+ # The GenerateDataKey and GenerateDataKeyPair operations return a
2099
+ # plaintext data key and an encrypted copy of that data key.
1736
2100
  #
1737
- # Also, you don't need to use this operation to encrypt data in your
1738
- # application. You can use the plaintext and encrypted data keys that
1739
- # the `GenerateDataKey` operation returns.
2101
+ # When you encrypt data, you must specify a symmetric or asymmetric CMK
2102
+ # to use in the encryption operation. The CMK must have a `KeyUsage`
2103
+ # value of `ENCRYPT_DECRYPT.` To find the `KeyUsage` of a CMK, use the
2104
+ # DescribeKey operation.
1740
2105
  #
1741
- # The result of this operation varies with the key state of the CMK. For
1742
- # details, see [How Key State Affects Use of a Customer Master Key][1]
1743
- # in the *AWS Key Management Service Developer Guide*.
2106
+ # If you use a symmetric CMK, you can use an encryption context to add
2107
+ # additional security to your encryption operation. If you specify an
2108
+ # `EncryptionContext` when encrypting data, you must specify the same
2109
+ # encryption context (a case-sensitive exact match) when decrypting the
2110
+ # data. Otherwise, the request to decrypt fails with an
2111
+ # `InvalidCiphertextException`. For more information, see [Encryption
2112
+ # Context][1] in the *AWS Key Management Service Developer Guide*.
2113
+ #
2114
+ # If you specify an asymmetric CMK, you must also specify the encryption
2115
+ # algorithm. The algorithm must be compatible with the CMK type.
2116
+ #
2117
+ # When you use an asymmetric CMK to encrypt or reencrypt data, be sure
2118
+ # to record the CMK and encryption algorithm that you choose. You will
2119
+ # be required to provide the same CMK and encryption algorithm when you
2120
+ # decrypt the data. If the CMK and algorithm do not match the values
2121
+ # used to encrypt the data, the decrypt operation fails.
2122
+ #
2123
+ # You are not required to supply the CMK ID and encryption algorithm
2124
+ # when you decrypt with symmetric CMKs because AWS KMS stores this
2125
+ # information in the ciphertext blob. AWS KMS cannot store metadata in
2126
+ # ciphertext generated with asymmetric keys. The standard format for
2127
+ # asymmetric key ciphertext does not include configurable fields.
2128
+ #
2129
+ # The maximum size of the data that you can encrypt varies with the type
2130
+ # of CMK and the encryption algorithm that you choose.
2131
+ #
2132
+ # * Symmetric CMKs
2133
+ #
2134
+ # * `SYMMETRIC_DEFAULT`\: 4096 bytes
2135
+ #
2136
+ # ^
2137
+ #
2138
+ # * `RSA_2048`
2139
+ #
2140
+ # * `RSAES_OAEP_SHA_1`\: 214 bytes
2141
+ #
2142
+ # * `RSAES_OAEP_SHA_256`\: 190 bytes
2143
+ #
2144
+ # * `RSA_3072`
2145
+ #
2146
+ # * `RSAES_OAEP_SHA_1`\: 342 bytes
2147
+ #
2148
+ # * `RSAES_OAEP_SHA_256`\: 318 bytes
2149
+ #
2150
+ # * `RSA_4096`
2151
+ #
2152
+ # * `RSAES_OAEP_SHA_1`\: 470 bytes
2153
+ #
2154
+ # * `RSAES_OAEP_SHA_256`\: 446 bytes
2155
+ #
2156
+ # The CMK that you use for this operation must be in a compatible key
2157
+ # state. For details, see [How Key State Affects Use of a Customer
2158
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
1744
2159
  #
1745
2160
  # To perform this operation on a CMK in a different AWS account, specify
1746
2161
  # the key ARN or alias ARN in the value of the KeyId parameter.
1747
2162
  #
1748
2163
  #
1749
2164
  #
1750
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2165
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2166
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
1751
2167
  #
1752
2168
  # @option params [required, String] :key_id
1753
2169
  # A unique identifier for the customer master key (CMK).
@@ -1775,10 +2191,20 @@ module Aws::KMS
1775
2191
  # Data to be encrypted.
1776
2192
  #
1777
2193
  # @option params [Hash<String,String>] :encryption_context
1778
- # Name-value pair that specifies the encryption context to be used for
1779
- # authenticated encryption. If used here, the same value must be
1780
- # supplied to the `Decrypt` API or decryption will fail. For more
1781
- # information, see [Encryption Context][1].
2194
+ # Specifies the encryption context that will be used to encrypt the
2195
+ # data. An encryption context is valid only for cryptographic operations
2196
+ # with a symmetric CMK. The standard asymmetric encryption algorithms
2197
+ # that AWS KMS uses do not support an encryption context.
2198
+ #
2199
+ # An *encryption context* is a collection of non-secret key-value pairs
2200
+ # that represents additional authenticated data. When you use an
2201
+ # encryption context to encrypt data, you must specify the same (an
2202
+ # exact case-sensitive match) encryption context to decrypt the data. An
2203
+ # encryption context is optional when encrypting with a symmetric CMK,
2204
+ # but it is highly recommended.
2205
+ #
2206
+ # For more information, see [Encryption Context][1] in the *AWS Key
2207
+ # Management Service Developer Guide*.
1782
2208
  #
1783
2209
  #
1784
2210
  #
@@ -1794,10 +2220,21 @@ module Aws::KMS
1794
2220
  #
1795
2221
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
1796
2222
  #
2223
+ # @option params [String] :encryption_algorithm
2224
+ # Specifies the encryption algorithm that AWS KMS will use to encrypt
2225
+ # the plaintext message. The algorithm must be compatible with the CMK
2226
+ # that you specify.
2227
+ #
2228
+ # This parameter is required only for asymmetric CMKs. The default
2229
+ # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric CMKs.
2230
+ # If you are using an asymmetric CMK, we recommend
2231
+ # RSAES\_OAEP\_SHA\_256.
2232
+ #
1797
2233
  # @return [Types::EncryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1798
2234
  #
1799
2235
  # * {Types::EncryptResponse#ciphertext_blob #ciphertext_blob} => String
1800
2236
  # * {Types::EncryptResponse#key_id #key_id} => String
2237
+ # * {Types::EncryptResponse#encryption_algorithm #encryption_algorithm} => String
1801
2238
  #
1802
2239
  #
1803
2240
  # @example Example: To encrypt data
@@ -1824,12 +2261,14 @@ module Aws::KMS
1824
2261
  # "EncryptionContextKey" => "EncryptionContextValue",
1825
2262
  # },
1826
2263
  # grant_tokens: ["GrantTokenType"],
2264
+ # encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
1827
2265
  # })
1828
2266
  #
1829
2267
  # @example Response structure
1830
2268
  #
1831
2269
  # resp.ciphertext_blob #=> String
1832
2270
  # resp.key_id #=> String
2271
+ # resp.encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1833
2272
  #
1834
2273
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt AWS API Documentation
1835
2274
  #
@@ -1840,27 +2279,45 @@ module Aws::KMS
1840
2279
  req.send_request(options)
1841
2280
  end
1842
2281
 
1843
- # Generates a unique data key. This operation returns a plaintext copy
1844
- # of the data key and a copy that is encrypted under a customer master
1845
- # key (CMK) that you specify. You can use the plaintext key to encrypt
1846
- # your data outside of KMS and store the encrypted data key with the
1847
- # encrypted data.
2282
+ # Generates a unique symmetric data key. This operation returns a
2283
+ # plaintext copy of the data key and a copy that is encrypted under a
2284
+ # customer master key (CMK) that you specify. You can use the plaintext
2285
+ # key to encrypt your data outside of AWS KMS and store the encrypted
2286
+ # data key with the encrypted data.
1848
2287
  #
1849
2288
  # `GenerateDataKey` returns a unique data key for each request. The
1850
2289
  # bytes in the key are not related to the caller or CMK that is used to
1851
2290
  # encrypt the data key.
1852
2291
  #
1853
- # To generate a data key, you need to specify the customer master key
1854
- # (CMK) that will be used to encrypt the data key. You must also specify
1855
- # the length of the data key using either the `KeySpec` or
1856
- # `NumberOfBytes` field (but not both). For common key lengths (128-bit
1857
- # and 256-bit symmetric keys), we recommend that you use `KeySpec`. To
1858
- # perform this operation on a CMK in a different AWS account, specify
1859
- # the key ARN or alias ARN in the value of the KeyId parameter.
2292
+ # To generate a data key, specify the symmetric CMK that will be used to
2293
+ # encrypt the data key. You cannot use an asymmetric CMK to generate
2294
+ # data keys. To get the type of your CMK, use the DescribeKey operation.
2295
+ #
2296
+ # You must also specify the length of the data key. Use either the
2297
+ # `KeySpec` or `NumberOfBytes` parameters (but not both). For 128-bit
2298
+ # and 256-bit data keys, use the `KeySpec` parameter.
2299
+ #
2300
+ # If the operation succeeds, the plaintext copy of the data key is in
2301
+ # the `Plaintext` field of the response, and the encrypted copy of the
2302
+ # data key in the `CiphertextBlob` field.
2303
+ #
2304
+ # To get only an encrypted copy of the data key, use
2305
+ # GenerateDataKeyWithoutPlaintext. To generate an asymmetric data key
2306
+ # pair, use the GenerateDataKeyPair or
2307
+ # GenerateDataKeyPairWithoutPlaintext operation. To get a
2308
+ # cryptographically secure random byte string, use GenerateRandom.
2309
+ #
2310
+ # You can use the optional encryption context to add additional security
2311
+ # to the encryption operation. If you specify an `EncryptionContext`,
2312
+ # you must specify the same encryption context (a case-sensitive exact
2313
+ # match) when decrypting the encrypted data key. Otherwise, the request
2314
+ # to decrypt fails with an InvalidCiphertextException. For more
2315
+ # information, see [Encryption Context][1] in the *AWS Key Management
2316
+ # Service Developer Guide*.
1860
2317
  #
1861
- # You will find the plaintext copy of the data key in the `Plaintext`
1862
- # field of the response, and the encrypted copy of the data key in the
1863
- # `CiphertextBlob` field.
2318
+ # The CMK that you use for this operation must be in a compatible key
2319
+ # state. For details, see [How Key State Affects Use of a Customer
2320
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
1864
2321
  #
1865
2322
  # We recommend that you use the following pattern to encrypt data
1866
2323
  # locally in your application:
@@ -1882,30 +2339,13 @@ module Aws::KMS
1882
2339
  # 2. Use the plaintext data key to decrypt data locally, then erase the
1883
2340
  # plaintext data key from memory.
1884
2341
  #
1885
- # To get only an encrypted copy of the data key, use
1886
- # GenerateDataKeyWithoutPlaintext. To get a cryptographically secure
1887
- # random byte string, use GenerateRandom.
1888
- #
1889
- # You can use the optional encryption context to add additional security
1890
- # to your encryption operation. When you specify an `EncryptionContext`
1891
- # in the `GenerateDataKey` operation, you must specify the same
1892
- # encryption context (a case-sensitive exact match) in your request to
1893
- # Decrypt the data key. Otherwise, the request to decrypt fails with an
1894
- # `InvalidCiphertextException`. For more information, see [Encryption
1895
- # Context][1] in the <i> <i>AWS Key Management Service Developer
1896
- # Guide</i> </i>.
1897
- #
1898
- # The result of this operation varies with the key state of the CMK. For
1899
- # details, see [How Key State Affects Use of a Customer Master Key][2]
1900
- # in the *AWS Key Management Service Developer Guide*.
1901
- #
1902
2342
  #
1903
2343
  #
1904
2344
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
1905
2345
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
1906
2346
  #
1907
2347
  # @option params [required, String] :key_id
1908
- # An identifier for the CMK that encrypts the data key.
2348
+ # Identifies the symmetric CMK that encrypts the data key.
1909
2349
  #
1910
2350
  # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
1911
2351
  # name, or alias ARN. When using an alias name, prefix it with
@@ -1927,8 +2367,15 @@ module Aws::KMS
1927
2367
  # To get the alias name and alias ARN, use ListAliases.
1928
2368
  #
1929
2369
  # @option params [Hash<String,String>] :encryption_context
1930
- # A set of key-value pairs that represents additional authenticated
1931
- # data.
2370
+ # Specifies the encryption context that will be used when encrypting the
2371
+ # data key.
2372
+ #
2373
+ # An *encryption context* is a collection of non-secret key-value pairs
2374
+ # that represents additional authenticated data. When you use an
2375
+ # encryption context to encrypt data, you must specify the same (an
2376
+ # exact case-sensitive match) encryption context to decrypt the data. An
2377
+ # encryption context is optional when encrypting with a symmetric CMK,
2378
+ # but it is highly recommended.
1932
2379
  #
1933
2380
  # For more information, see [Encryption Context][1] in the *AWS Key
1934
2381
  # Management Service Developer Guide*.
@@ -1938,14 +2385,21 @@ module Aws::KMS
1938
2385
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
1939
2386
  #
1940
2387
  # @option params [Integer] :number_of_bytes
1941
- # The length of the data key in bytes. For example, use the value 64 to
1942
- # generate a 512-bit data key (64 bytes is 512 bits). For common key
1943
- # lengths (128-bit and 256-bit symmetric keys), we recommend that you
1944
- # use the `KeySpec` field instead of this one.
2388
+ # Specifies the length of the data key in bytes. For example, use the
2389
+ # value 64 to generate a 512-bit data key (64 bytes is 512 bits). For
2390
+ # 128-bit (16-byte) and 256-bit (32-byte) data keys, use the `KeySpec`
2391
+ # parameter.
2392
+ #
2393
+ # You must specify either the `KeySpec` or the `NumberOfBytes` parameter
2394
+ # (but not both) in every `GenerateDataKey` request.
1945
2395
  #
1946
2396
  # @option params [String] :key_spec
1947
- # The length of the data key. Use `AES_128` to generate a 128-bit
1948
- # symmetric key, or `AES_256` to generate a 256-bit symmetric key.
2397
+ # Specifies the length of the data key. Use `AES_128` to generate a
2398
+ # 128-bit symmetric key, or `AES_256` to generate a 256-bit symmetric
2399
+ # key.
2400
+ #
2401
+ # You must specify either the `KeySpec` or the `NumberOfBytes` parameter
2402
+ # (but not both) in every `GenerateDataKey` request.
1949
2403
  #
1950
2404
  # @option params [Array<String>] :grant_tokens
1951
2405
  # A list of grant tokens.
@@ -2008,40 +2462,74 @@ module Aws::KMS
2008
2462
  req.send_request(options)
2009
2463
  end
2010
2464
 
2011
- # Generates a unique data key. This operation returns a data key that is
2012
- # encrypted under a customer master key (CMK) that you specify.
2013
- # `GenerateDataKeyWithoutPlaintext` is identical to GenerateDataKey
2014
- # except that returns only the encrypted copy of the data key.
2465
+ # Generates a unique asymmetric data key pair. The `GenerateDataKeyPair`
2466
+ # operation returns a plaintext public key, a plaintext private key, and
2467
+ # a copy of the private key that is encrypted under the symmetric CMK
2468
+ # you specify. You can use the data key pair to perform asymmetric
2469
+ # cryptography outside of AWS KMS.
2470
+ #
2471
+ # `GenerateDataKeyPair` returns a unique data key pair for each request.
2472
+ # The bytes in the keys are not related to the caller or the CMK that is
2473
+ # used to encrypt the private key.
2474
+ #
2475
+ # You can use the public key that `GenerateDataKeyPair` returns to
2476
+ # encrypt data or verify a signature outside of AWS KMS. Then, store the
2477
+ # encrypted private key with the data. When you are ready to decrypt
2478
+ # data or sign a message, you can use the Decrypt operation to decrypt
2479
+ # the encrypted private key.
2480
+ #
2481
+ # To generate a data key pair, you must specify a symmetric customer
2482
+ # master key (CMK) to encrypt the private key in a data key pair. You
2483
+ # cannot use an asymmetric CMK. To get the type of your CMK, use the
2484
+ # DescribeKey operation.
2485
+ #
2486
+ # If you are using the data key pair to encrypt data, or for any
2487
+ # operation where you don't immediately need a private key, consider
2488
+ # using the GenerateDataKeyPairWithoutPlaintext operation.
2489
+ # `GenerateDataKeyPairWithoutPlaintext` returns a plaintext public key
2490
+ # and an encrypted private key, but omits the plaintext private key that
2491
+ # you need only to decrypt ciphertext or sign a message. Later, when you
2492
+ # need to decrypt the data or sign a message, use the Decrypt operation
2493
+ # to decrypt the encrypted private key in the data key pair.
2015
2494
  #
2016
- # Like `GenerateDataKey`, `GenerateDataKeyWithoutPlaintext` returns a
2017
- # unique data key for each request. The bytes in the key are not related
2018
- # to the caller or CMK that is used to encrypt the data key.
2495
+ # You can use the optional encryption context to add additional security
2496
+ # to the encryption operation. If you specify an `EncryptionContext`,
2497
+ # you must specify the same encryption context (a case-sensitive exact
2498
+ # match) when decrypting the encrypted data key. Otherwise, the request
2499
+ # to decrypt fails with an InvalidCiphertextException. For more
2500
+ # information, see [Encryption Context][1] in the *AWS Key Management
2501
+ # Service Developer Guide*.
2019
2502
  #
2020
- # This operation is useful for systems that need to encrypt data at some
2021
- # point, but not immediately. When you need to encrypt the data, you
2022
- # call the Decrypt operation on the encrypted copy of the key.
2503
+ # The CMK that you use for this operation must be in a compatible key
2504
+ # state. For details, see [How Key State Affects Use of a Customer
2505
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
2023
2506
  #
2024
- # It's also useful in distributed systems with different levels of
2025
- # trust. For example, you might store encrypted data in containers. One
2026
- # component of your system creates new containers and stores an
2027
- # encrypted data key with each container. Then, a different component
2028
- # puts the data into the containers. That component first decrypts the
2029
- # data key, uses the plaintext data key to encrypt data, puts the
2030
- # encrypted data into the container, and then destroys the plaintext
2031
- # data key. In this system, the component that creates the containers
2032
- # never sees the plaintext data key.
2033
2507
  #
2034
- # The result of this operation varies with the key state of the CMK. For
2035
- # details, see [How Key State Affects Use of a Customer Master Key][1]
2036
- # in the *AWS Key Management Service Developer Guide*.
2037
2508
  #
2509
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2510
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2511
+ #
2512
+ # @option params [Hash<String,String>] :encryption_context
2513
+ # Specifies the encryption context that will be used when encrypting the
2514
+ # private key in the data key pair.
2515
+ #
2516
+ # An *encryption context* is a collection of non-secret key-value pairs
2517
+ # that represents additional authenticated data. When you use an
2518
+ # encryption context to encrypt data, you must specify the same (an
2519
+ # exact case-sensitive match) encryption context to decrypt the data. An
2520
+ # encryption context is optional when encrypting with a symmetric CMK,
2521
+ # but it is highly recommended.
2522
+ #
2523
+ # For more information, see [Encryption Context][1] in the *AWS Key
2524
+ # Management Service Developer Guide*.
2038
2525
  #
2039
2526
  #
2040
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2527
+ #
2528
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2041
2529
  #
2042
2530
  # @option params [required, String] :key_id
2043
- # The identifier of the customer master key (CMK) that encrypts the data
2044
- # key.
2531
+ # Specifies the symmetric CMK that encrypts the private key in the data
2532
+ # key pair. You cannot specify an asymmetric CMKs.
2045
2533
  #
2046
2534
  # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
2047
2535
  # name, or alias ARN. When using an alias name, prefix it with
@@ -2062,26 +2550,13 @@ module Aws::KMS
2062
2550
  # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
2063
2551
  # To get the alias name and alias ARN, use ListAliases.
2064
2552
  #
2065
- # @option params [Hash<String,String>] :encryption_context
2066
- # A set of key-value pairs that represents additional authenticated
2067
- # data.
2068
- #
2069
- # For more information, see [Encryption Context][1] in the *AWS Key
2070
- # Management Service Developer Guide*.
2071
- #
2072
- #
2073
- #
2074
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2075
- #
2076
- # @option params [String] :key_spec
2077
- # The length of the data key. Use `AES_128` to generate a 128-bit
2078
- # symmetric key, or `AES_256` to generate a 256-bit symmetric key.
2553
+ # @option params [required, String] :key_pair_spec
2554
+ # Determines the type of data key pair that is generated.
2079
2555
  #
2080
- # @option params [Integer] :number_of_bytes
2081
- # The length of the data key in bytes. For example, use the value 64 to
2082
- # generate a 512-bit data key (64 bytes is 512 bits). For common key
2083
- # lengths (128-bit and 256-bit symmetric keys), we recommend that you
2084
- # use the `KeySpec` field instead of this one.
2556
+ # The AWS KMS rule that restricts the use of asymmetric RSA CMKs to
2557
+ # encrypt and decrypt or to sign and verify (but not both), and the rule
2558
+ # that permits you to use ECC CMKs only to sign and verify, are not
2559
+ # effective outside of AWS KMS.
2085
2560
  #
2086
2561
  # @option params [Array<String>] :grant_tokens
2087
2562
  # A list of grant tokens.
@@ -2093,36 +2568,314 @@ module Aws::KMS
2093
2568
  #
2094
2569
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
2095
2570
  #
2096
- # @return [Types::GenerateDataKeyWithoutPlaintextResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2097
- #
2098
- # * {Types::GenerateDataKeyWithoutPlaintextResponse#ciphertext_blob #ciphertext_blob} => String
2099
- # * {Types::GenerateDataKeyWithoutPlaintextResponse#key_id #key_id} => String
2100
- #
2101
- #
2102
- # @example Example: To generate an encrypted data key
2103
- #
2104
- # # The following example generates an encrypted copy of a 256-bit symmetric data encryption key (data key). The data key is
2105
- # # encrypted with the specified customer master key (CMK).
2106
- #
2107
- # resp = client.generate_data_key_without_plaintext({
2108
- # key_id: "alias/ExampleAlias", # The identifier of the CMK to use to encrypt the data key. You can use the key ID or Amazon Resource Name (ARN) of the CMK, or the name or ARN of an alias that refers to the CMK.
2109
- # key_spec: "AES_256", # Specifies the type of data key to return.
2110
- # })
2571
+ # @return [Types::GenerateDataKeyPairResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2111
2572
  #
2112
- # resp.to_h outputs the following:
2113
- # {
2114
- # ciphertext_blob: "<binary data>", # The encrypted data key.
2115
- # key_id: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The ARN of the CMK that was used to encrypt the data key.
2116
- # }
2573
+ # * {Types::GenerateDataKeyPairResponse#private_key_ciphertext_blob #private_key_ciphertext_blob} => String
2574
+ # * {Types::GenerateDataKeyPairResponse#private_key_plaintext #private_key_plaintext} => String
2575
+ # * {Types::GenerateDataKeyPairResponse#public_key #public_key} => String
2576
+ # * {Types::GenerateDataKeyPairResponse#key_id #key_id} => String
2577
+ # * {Types::GenerateDataKeyPairResponse#key_pair_spec #key_pair_spec} => String
2117
2578
  #
2118
2579
  # @example Request syntax with placeholder values
2119
2580
  #
2120
- # resp = client.generate_data_key_without_plaintext({
2121
- # key_id: "KeyIdType", # required
2581
+ # resp = client.generate_data_key_pair({
2122
2582
  # encryption_context: {
2123
2583
  # "EncryptionContextKey" => "EncryptionContextValue",
2124
2584
  # },
2125
- # key_spec: "AES_256", # accepts AES_256, AES_128
2585
+ # key_id: "KeyIdType", # required
2586
+ # key_pair_spec: "RSA_2048", # required, accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1
2587
+ # grant_tokens: ["GrantTokenType"],
2588
+ # })
2589
+ #
2590
+ # @example Response structure
2591
+ #
2592
+ # resp.private_key_ciphertext_blob #=> String
2593
+ # resp.private_key_plaintext #=> String
2594
+ # resp.public_key #=> String
2595
+ # resp.key_id #=> String
2596
+ # resp.key_pair_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1"
2597
+ #
2598
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair AWS API Documentation
2599
+ #
2600
+ # @overload generate_data_key_pair(params = {})
2601
+ # @param [Hash] params ({})
2602
+ def generate_data_key_pair(params = {}, options = {})
2603
+ req = build_request(:generate_data_key_pair, params)
2604
+ req.send_request(options)
2605
+ end
2606
+
2607
+ # Generates a unique asymmetric data key pair. The
2608
+ # `GenerateDataKeyPairWithoutPlaintext` operation returns a plaintext
2609
+ # public key and a copy of the private key that is encrypted under the
2610
+ # symmetric CMK you specify. Unlike GenerateDataKeyPair, this operation
2611
+ # does not return a plaintext private key.
2612
+ #
2613
+ # To generate a data key pair, you must specify a symmetric customer
2614
+ # master key (CMK) to encrypt the private key in the data key pair. You
2615
+ # cannot use an asymmetric CMK. To get the type of your CMK, use the
2616
+ # `KeySpec` field in the DescribeKey response.
2617
+ #
2618
+ # You can use the public key that `GenerateDataKeyPairWithoutPlaintext`
2619
+ # returns to encrypt data or verify a signature outside of AWS KMS.
2620
+ # Then, store the encrypted private key with the data. When you are
2621
+ # ready to decrypt data or sign a message, you can use the Decrypt
2622
+ # operation to decrypt the encrypted private key.
2623
+ #
2624
+ # `GenerateDataKeyPairWithoutPlaintext` returns a unique data key pair
2625
+ # for each request. The bytes in the key are not related to the caller
2626
+ # or CMK that is used to encrypt the private key.
2627
+ #
2628
+ # You can use the optional encryption context to add additional security
2629
+ # to the encryption operation. If you specify an `EncryptionContext`,
2630
+ # you must specify the same encryption context (a case-sensitive exact
2631
+ # match) when decrypting the encrypted data key. Otherwise, the request
2632
+ # to decrypt fails with an InvalidCiphertextException. For more
2633
+ # information, see [Encryption Context][1] in the *AWS Key Management
2634
+ # Service Developer Guide*.
2635
+ #
2636
+ # The CMK that you use for this operation must be in a compatible key
2637
+ # state. For details, see [How Key State Affects Use of a Customer
2638
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
2639
+ #
2640
+ #
2641
+ #
2642
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2643
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2644
+ #
2645
+ # @option params [Hash<String,String>] :encryption_context
2646
+ # Specifies the encryption context that will be used when encrypting the
2647
+ # private key in the data key pair.
2648
+ #
2649
+ # An *encryption context* is a collection of non-secret key-value pairs
2650
+ # that represents additional authenticated data. When you use an
2651
+ # encryption context to encrypt data, you must specify the same (an
2652
+ # exact case-sensitive match) encryption context to decrypt the data. An
2653
+ # encryption context is optional when encrypting with a symmetric CMK,
2654
+ # but it is highly recommended.
2655
+ #
2656
+ # For more information, see [Encryption Context][1] in the *AWS Key
2657
+ # Management Service Developer Guide*.
2658
+ #
2659
+ #
2660
+ #
2661
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2662
+ #
2663
+ # @option params [required, String] :key_id
2664
+ # Specifies the CMK that encrypts the private key in the data key pair.
2665
+ # You must specify a symmetric CMK. You cannot use an asymmetric CMK. To
2666
+ # get the type of your CMK, use the DescribeKey operation.
2667
+ #
2668
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
2669
+ # name, or alias ARN. When using an alias name, prefix it with
2670
+ # `"alias/"`.
2671
+ #
2672
+ # For example:
2673
+ #
2674
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
2675
+ #
2676
+ # * Key ARN:
2677
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
2678
+ #
2679
+ # * Alias name: `alias/ExampleAlias`
2680
+ #
2681
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
2682
+ #
2683
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
2684
+ # To get the alias name and alias ARN, use ListAliases.
2685
+ #
2686
+ # @option params [required, String] :key_pair_spec
2687
+ # Determines the type of data key pair that is generated.
2688
+ #
2689
+ # The AWS KMS rule that restricts the use of asymmetric RSA CMKs to
2690
+ # encrypt and decrypt or to sign and verify (but not both), and the rule
2691
+ # that permits you to use ECC CMKs only to sign and verify, are not
2692
+ # effective outside of AWS KMS.
2693
+ #
2694
+ # @option params [Array<String>] :grant_tokens
2695
+ # A list of grant tokens.
2696
+ #
2697
+ # For more information, see [Grant Tokens][1] in the *AWS Key Management
2698
+ # Service Developer Guide*.
2699
+ #
2700
+ #
2701
+ #
2702
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
2703
+ #
2704
+ # @return [Types::GenerateDataKeyPairWithoutPlaintextResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2705
+ #
2706
+ # * {Types::GenerateDataKeyPairWithoutPlaintextResponse#private_key_ciphertext_blob #private_key_ciphertext_blob} => String
2707
+ # * {Types::GenerateDataKeyPairWithoutPlaintextResponse#public_key #public_key} => String
2708
+ # * {Types::GenerateDataKeyPairWithoutPlaintextResponse#key_id #key_id} => String
2709
+ # * {Types::GenerateDataKeyPairWithoutPlaintextResponse#key_pair_spec #key_pair_spec} => String
2710
+ #
2711
+ # @example Request syntax with placeholder values
2712
+ #
2713
+ # resp = client.generate_data_key_pair_without_plaintext({
2714
+ # encryption_context: {
2715
+ # "EncryptionContextKey" => "EncryptionContextValue",
2716
+ # },
2717
+ # key_id: "KeyIdType", # required
2718
+ # key_pair_spec: "RSA_2048", # required, accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1
2719
+ # grant_tokens: ["GrantTokenType"],
2720
+ # })
2721
+ #
2722
+ # @example Response structure
2723
+ #
2724
+ # resp.private_key_ciphertext_blob #=> String
2725
+ # resp.public_key #=> String
2726
+ # resp.key_id #=> String
2727
+ # resp.key_pair_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1"
2728
+ #
2729
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext AWS API Documentation
2730
+ #
2731
+ # @overload generate_data_key_pair_without_plaintext(params = {})
2732
+ # @param [Hash] params ({})
2733
+ def generate_data_key_pair_without_plaintext(params = {}, options = {})
2734
+ req = build_request(:generate_data_key_pair_without_plaintext, params)
2735
+ req.send_request(options)
2736
+ end
2737
+
2738
+ # Generates a unique symmetric data key. This operation returns a data
2739
+ # key that is encrypted under a customer master key (CMK) that you
2740
+ # specify. To request an asymmetric data key pair, use the
2741
+ # GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext operations.
2742
+ #
2743
+ # `GenerateDataKeyWithoutPlaintext` is identical to the GenerateDataKey
2744
+ # operation except that returns only the encrypted copy of the data key.
2745
+ # This operation is useful for systems that need to encrypt data at some
2746
+ # point, but not immediately. When you need to encrypt the data, you
2747
+ # call the Decrypt operation on the encrypted copy of the key.
2748
+ #
2749
+ # It's also useful in distributed systems with different levels of
2750
+ # trust. For example, you might store encrypted data in containers. One
2751
+ # component of your system creates new containers and stores an
2752
+ # encrypted data key with each container. Then, a different component
2753
+ # puts the data into the containers. That component first decrypts the
2754
+ # data key, uses the plaintext data key to encrypt data, puts the
2755
+ # encrypted data into the container, and then destroys the plaintext
2756
+ # data key. In this system, the component that creates the containers
2757
+ # never sees the plaintext data key.
2758
+ #
2759
+ # `GenerateDataKeyWithoutPlaintext` returns a unique data key for each
2760
+ # request. The bytes in the keys are not related to the caller or CMK
2761
+ # that is used to encrypt the private key.
2762
+ #
2763
+ # To generate a data key, you must specify the symmetric customer master
2764
+ # key (CMK) that is used to encrypt the data key. You cannot use an
2765
+ # asymmetric CMK to generate a data key. To get the type of your CMK,
2766
+ # use the DescribeKey operation.
2767
+ #
2768
+ # If the operation succeeds, you will find the encrypted copy of the
2769
+ # data key in the `CiphertextBlob` field.
2770
+ #
2771
+ # You can use the optional encryption context to add additional security
2772
+ # to the encryption operation. If you specify an `EncryptionContext`,
2773
+ # you must specify the same encryption context (a case-sensitive exact
2774
+ # match) when decrypting the encrypted data key. Otherwise, the request
2775
+ # to decrypt fails with an InvalidCiphertextException. For more
2776
+ # information, see [Encryption Context][1] in the *AWS Key Management
2777
+ # Service Developer Guide*.
2778
+ #
2779
+ # The CMK that you use for this operation must be in a compatible key
2780
+ # state. For details, see [How Key State Affects Use of a Customer
2781
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
2782
+ #
2783
+ #
2784
+ #
2785
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2786
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2787
+ #
2788
+ # @option params [required, String] :key_id
2789
+ # The identifier of the symmetric customer master key (CMK) that
2790
+ # encrypts the data key.
2791
+ #
2792
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
2793
+ # name, or alias ARN. When using an alias name, prefix it with
2794
+ # `"alias/"`. To specify a CMK in a different AWS account, you must use
2795
+ # the key ARN or alias ARN.
2796
+ #
2797
+ # For example:
2798
+ #
2799
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
2800
+ #
2801
+ # * Key ARN:
2802
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
2803
+ #
2804
+ # * Alias name: `alias/ExampleAlias`
2805
+ #
2806
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
2807
+ #
2808
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
2809
+ # To get the alias name and alias ARN, use ListAliases.
2810
+ #
2811
+ # @option params [Hash<String,String>] :encryption_context
2812
+ # Specifies the encryption context that will be used when encrypting the
2813
+ # data key.
2814
+ #
2815
+ # An *encryption context* is a collection of non-secret key-value pairs
2816
+ # that represents additional authenticated data. When you use an
2817
+ # encryption context to encrypt data, you must specify the same (an
2818
+ # exact case-sensitive match) encryption context to decrypt the data. An
2819
+ # encryption context is optional when encrypting with a symmetric CMK,
2820
+ # but it is highly recommended.
2821
+ #
2822
+ # For more information, see [Encryption Context][1] in the *AWS Key
2823
+ # Management Service Developer Guide*.
2824
+ #
2825
+ #
2826
+ #
2827
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
2828
+ #
2829
+ # @option params [String] :key_spec
2830
+ # The length of the data key. Use `AES_128` to generate a 128-bit
2831
+ # symmetric key, or `AES_256` to generate a 256-bit symmetric key.
2832
+ #
2833
+ # @option params [Integer] :number_of_bytes
2834
+ # The length of the data key in bytes. For example, use the value 64 to
2835
+ # generate a 512-bit data key (64 bytes is 512 bits). For common key
2836
+ # lengths (128-bit and 256-bit symmetric keys), we recommend that you
2837
+ # use the `KeySpec` field instead of this one.
2838
+ #
2839
+ # @option params [Array<String>] :grant_tokens
2840
+ # A list of grant tokens.
2841
+ #
2842
+ # For more information, see [Grant Tokens][1] in the *AWS Key Management
2843
+ # Service Developer Guide*.
2844
+ #
2845
+ #
2846
+ #
2847
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
2848
+ #
2849
+ # @return [Types::GenerateDataKeyWithoutPlaintextResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
2850
+ #
2851
+ # * {Types::GenerateDataKeyWithoutPlaintextResponse#ciphertext_blob #ciphertext_blob} => String
2852
+ # * {Types::GenerateDataKeyWithoutPlaintextResponse#key_id #key_id} => String
2853
+ #
2854
+ #
2855
+ # @example Example: To generate an encrypted data key
2856
+ #
2857
+ # # The following example generates an encrypted copy of a 256-bit symmetric data encryption key (data key). The data key is
2858
+ # # encrypted with the specified customer master key (CMK).
2859
+ #
2860
+ # resp = client.generate_data_key_without_plaintext({
2861
+ # key_id: "alias/ExampleAlias", # The identifier of the CMK to use to encrypt the data key. You can use the key ID or Amazon Resource Name (ARN) of the CMK, or the name or ARN of an alias that refers to the CMK.
2862
+ # key_spec: "AES_256", # Specifies the type of data key to return.
2863
+ # })
2864
+ #
2865
+ # resp.to_h outputs the following:
2866
+ # {
2867
+ # ciphertext_blob: "<binary data>", # The encrypted data key.
2868
+ # key_id: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The ARN of the CMK that was used to encrypt the data key.
2869
+ # }
2870
+ #
2871
+ # @example Request syntax with placeholder values
2872
+ #
2873
+ # resp = client.generate_data_key_without_plaintext({
2874
+ # key_id: "KeyIdType", # required
2875
+ # encryption_context: {
2876
+ # "EncryptionContextKey" => "EncryptionContextValue",
2877
+ # },
2878
+ # key_spec: "AES_256", # accepts AES_256, AES_128
2126
2879
  # number_of_bytes: 1,
2127
2880
  # grant_tokens: ["GrantTokenType"],
2128
2881
  # })
@@ -2270,9 +3023,13 @@ module Aws::KMS
2270
3023
  # key material][1] is enabled for the specified customer master key
2271
3024
  # (CMK).
2272
3025
  #
2273
- # The result of this operation varies with the key state of the CMK. For
2274
- # details, see [How Key State Affects Use of a Customer Master Key][2]
2275
- # in the *AWS Key Management Service Developer Guide*.
3026
+ # You cannot enable automatic rotation of asymmetric CMKs, CMKs with
3027
+ # imported key material, or CMKs in a [custom key store][2]. The key
3028
+ # rotation status for these CMKs is always `false`.
3029
+ #
3030
+ # The CMK that you use for this operation must be in a compatible key
3031
+ # state. For details, see [How Key State Affects Use of a Customer
3032
+ # Master Key][3] in the *AWS Key Management Service Developer Guide*.
2276
3033
  #
2277
3034
  # * Disabled: The key rotation status does not change when you disable a
2278
3035
  # CMK. However, while the CMK is disabled, AWS KMS does not rotate the
@@ -2289,7 +3046,8 @@ module Aws::KMS
2289
3046
  #
2290
3047
  #
2291
3048
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2292
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3049
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3050
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2293
3051
  #
2294
3052
  # @option params [required, String] :key_id
2295
3053
  # A unique identifier for the customer master key (CMK).
@@ -2343,29 +3101,32 @@ module Aws::KMS
2343
3101
  req.send_request(options)
2344
3102
  end
2345
3103
 
2346
- # Returns the items you need in order to import key material into AWS
2347
- # KMS from your existing key management infrastructure. For more
2348
- # information about importing key material into AWS KMS, see [Importing
2349
- # Key Material][1] in the *AWS Key Management Service Developer Guide*.
2350
- #
2351
- # You must specify the key ID of the customer master key (CMK) into
2352
- # which you will import key material. This CMK's `Origin` must be
2353
- # `EXTERNAL`. You must also specify the wrapping algorithm and type of
2354
- # wrapping key (public key) that you will use to encrypt the key
2355
- # material. You cannot perform this operation on a CMK in a different
2356
- # AWS account.
3104
+ # Returns the items you need to import key material into a symmetric,
3105
+ # customer managed customer master key (CMK). For more information about
3106
+ # importing key material into AWS KMS, see [Importing Key Material][1]
3107
+ # in the *AWS Key Management Service Developer Guide*.
2357
3108
  #
2358
3109
  # This operation returns a public key and an import token. Use the
2359
- # public key to encrypt the key material. Store the import token to send
2360
- # with a subsequent ImportKeyMaterial request. The public key and import
2361
- # token from the same response must be used together. These items are
2362
- # valid for 24 hours. When they expire, they cannot be used for a
2363
- # subsequent ImportKeyMaterial request. To get new ones, send another
3110
+ # public key to encrypt the symmetric key material. Store the import
3111
+ # token to send with a subsequent ImportKeyMaterial request.
3112
+ #
3113
+ # You must specify the key ID of the symmetric CMK into which you will
3114
+ # import key material. This CMK's `Origin` must be `EXTERNAL`. You must
3115
+ # also specify the wrapping algorithm and type of wrapping key (public
3116
+ # key) that you will use to encrypt the key material. You cannot perform
3117
+ # this operation on an asymmetric CMK or on any CMK in a different AWS
3118
+ # account.
3119
+ #
3120
+ # To import key material, you must use the public key and import token
3121
+ # from the same response. These items are valid for 24 hours. The
3122
+ # expiration date and time appear in the `GetParametersForImport`
3123
+ # response. You cannot use an expired token in an ImportKeyMaterial
3124
+ # request. If your key and token expire, send another
2364
3125
  # `GetParametersForImport` request.
2365
3126
  #
2366
- # The result of this operation varies with the key state of the CMK. For
2367
- # details, see [How Key State Affects Use of a Customer Master Key][2]
2368
- # in the *AWS Key Management Service Developer Guide*.
3127
+ # The CMK that you use for this operation must be in a compatible key
3128
+ # state. For details, see [How Key State Affects Use of a Customer
3129
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
2369
3130
  #
2370
3131
  #
2371
3132
  #
@@ -2373,8 +3134,8 @@ module Aws::KMS
2373
3134
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2374
3135
  #
2375
3136
  # @option params [required, String] :key_id
2376
- # The identifier of the CMK into which you will import key material. The
2377
- # CMK's `Origin` must be `EXTERNAL`.
3137
+ # The identifier of the symmetric CMK into which you will import key
3138
+ # material. The `Origin` of the CMK must be `EXTERNAL`.
2378
3139
  #
2379
3140
  # Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
2380
3141
  #
@@ -2451,12 +3212,136 @@ module Aws::KMS
2451
3212
  req.send_request(options)
2452
3213
  end
2453
3214
 
2454
- # Imports key material into an existing AWS KMS customer master key
2455
- # (CMK) that was created without key material. You cannot perform this
2456
- # operation on a CMK in a different AWS account. For more information
2457
- # about creating CMKs with no key material and then importing key
2458
- # material, see [Importing Key Material][1] in the *AWS Key Management
2459
- # Service Developer Guide*.
3215
+ # Returns the public key of an asymmetric CMK. Unlike the private key of
3216
+ # a asymmetric CMK, which never leaves AWS KMS unencrypted, callers with
3217
+ # `kms:GetPublicKey` permission can download the public key of an
3218
+ # asymmetric CMK. You can share the public key to allow others to
3219
+ # encrypt messages and verify signatures outside of AWS KMS. For
3220
+ # information about symmetric and asymmetric CMKs, see [Using Symmetric
3221
+ # and Asymmetric CMKs][1] in the *AWS Key Management Service Developer
3222
+ # Guide*.
3223
+ #
3224
+ # You do not need to download the public key. Instead, you can use the
3225
+ # public key within AWS KMS by calling the Encrypt, ReEncrypt, or Verify
3226
+ # operations with the identifier of an asymmetric CMK. When you use the
3227
+ # public key within AWS KMS, you benefit from the authentication,
3228
+ # authorization, and logging that are part of every AWS KMS operation.
3229
+ # You also reduce of risk of encrypting data that cannot be decrypted.
3230
+ # These features are not effective outside of AWS KMS. For details, see
3231
+ # [Special Considerations for Downloading Public Keys][2].
3232
+ #
3233
+ # To help you use the public key safely outside of AWS KMS,
3234
+ # `GetPublicKey` returns important information about the public key in
3235
+ # the response, including:
3236
+ #
3237
+ # * [CustomerMasterKeySpec][3]\: The type of key material in the public
3238
+ # key, such as `RSA_4096` or `ECC_NIST_P521`.
3239
+ #
3240
+ # * [KeyUsage][4]\: Whether the key is used for encryption or signing.
3241
+ #
3242
+ # * [EncryptionAlgorithms][5] or [SigningAlgorithms][6]\: A list of the
3243
+ # encryption algorithms or the signing algorithms for the key.
3244
+ #
3245
+ # Although AWS KMS cannot enforce these restrictions on external
3246
+ # operations, it is crucial that you use this information to prevent the
3247
+ # public key from being used improperly. For example, you can prevent a
3248
+ # public signing key from being used encrypt data, or prevent a public
3249
+ # key from being used with an encryption algorithm that is not supported
3250
+ # by AWS KMS. You can also avoid errors, such as using the wrong signing
3251
+ # algorithm in a verification operation.
3252
+ #
3253
+ # The CMK that you use for this operation must be in a compatible key
3254
+ # state. For details, see [How Key State Affects Use of a Customer
3255
+ # Master Key][7] in the *AWS Key Management Service Developer Guide*.
3256
+ #
3257
+ #
3258
+ #
3259
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3260
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/download-public-key.html#download-public-key-considerations
3261
+ # [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-CustomerMasterKeySpec
3262
+ # [4]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage
3263
+ # [5]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms
3264
+ # [6]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-SigningAlgorithms
3265
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3266
+ #
3267
+ # @option params [required, String] :key_id
3268
+ # Identifies the asymmetric CMK that includes the public key.
3269
+ #
3270
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
3271
+ # name, or alias ARN. When using an alias name, prefix it with
3272
+ # `"alias/"`. To specify a CMK in a different AWS account, you must use
3273
+ # the key ARN or alias ARN.
3274
+ #
3275
+ # For example:
3276
+ #
3277
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
3278
+ #
3279
+ # * Key ARN:
3280
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
3281
+ #
3282
+ # * Alias name: `alias/ExampleAlias`
3283
+ #
3284
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
3285
+ #
3286
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
3287
+ # To get the alias name and alias ARN, use ListAliases.
3288
+ #
3289
+ # @option params [Array<String>] :grant_tokens
3290
+ # A list of grant tokens.
3291
+ #
3292
+ # For more information, see [Grant Tokens][1] in the *AWS Key Management
3293
+ # Service Developer Guide*.
3294
+ #
3295
+ #
3296
+ #
3297
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
3298
+ #
3299
+ # @return [Types::GetPublicKeyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3300
+ #
3301
+ # * {Types::GetPublicKeyResponse#key_id #key_id} => String
3302
+ # * {Types::GetPublicKeyResponse#public_key #public_key} => String
3303
+ # * {Types::GetPublicKeyResponse#customer_master_key_spec #customer_master_key_spec} => String
3304
+ # * {Types::GetPublicKeyResponse#key_usage #key_usage} => String
3305
+ # * {Types::GetPublicKeyResponse#encryption_algorithms #encryption_algorithms} => Array&lt;String&gt;
3306
+ # * {Types::GetPublicKeyResponse#signing_algorithms #signing_algorithms} => Array&lt;String&gt;
3307
+ #
3308
+ # @example Request syntax with placeholder values
3309
+ #
3310
+ # resp = client.get_public_key({
3311
+ # key_id: "KeyIdType", # required
3312
+ # grant_tokens: ["GrantTokenType"],
3313
+ # })
3314
+ #
3315
+ # @example Response structure
3316
+ #
3317
+ # resp.key_id #=> String
3318
+ # resp.public_key #=> String
3319
+ # resp.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
3320
+ # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
3321
+ # resp.encryption_algorithms #=> Array
3322
+ # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
3323
+ # resp.signing_algorithms #=> Array
3324
+ # resp.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512"
3325
+ #
3326
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey AWS API Documentation
3327
+ #
3328
+ # @overload get_public_key(params = {})
3329
+ # @param [Hash] params ({})
3330
+ def get_public_key(params = {}, options = {})
3331
+ req = build_request(:get_public_key, params)
3332
+ req.send_request(options)
3333
+ end
3334
+
3335
+ # Imports key material into an existing symmetric AWS KMS customer
3336
+ # master key (CMK) that was created without key material. After you
3337
+ # successfully import key material into a CMK, you can [reimport the
3338
+ # same key material][1] into that CMK, but you cannot import different
3339
+ # key material.
3340
+ #
3341
+ # You cannot perform this operation on an asymmetric CMK or on any CMK
3342
+ # in a different AWS account. For more information about creating CMKs
3343
+ # with no key material and then importing key material, see [Importing
3344
+ # Key Material][2] in the *AWS Key Management Service Developer Guide*.
2460
3345
  #
2461
3346
  # Before using this operation, call GetParametersForImport. Its response
2462
3347
  # includes a public key and an import token. Use the public key to
@@ -2475,35 +3360,43 @@ module Aws::KMS
2475
3360
  # * The encrypted key material. To get the public key to encrypt the key
2476
3361
  # material, call GetParametersForImport.
2477
3362
  #
2478
- # * The import token that GetParametersForImport returned. This token
2479
- # and the public key used to encrypt the key material must have come
2480
- # from the same response.
3363
+ # * The import token that GetParametersForImport returned. You must use
3364
+ # a public key and token from the same `GetParametersForImport`
3365
+ # response.
2481
3366
  #
2482
3367
  # * Whether the key material expires and if so, when. If you set an
2483
- # expiration date, you can change it only by reimporting the same key
2484
- # material and specifying a new expiration date. If the key material
2485
- # expires, AWS KMS deletes the key material and the CMK becomes
2486
- # unusable. To use the CMK again, you must reimport the same key
2487
- # material.
3368
+ # expiration date, AWS KMS deletes the key material from the CMK on
3369
+ # the specified date, and the CMK becomes unusable. To use the CMK
3370
+ # again, you must reimport the same key material. The only way to
3371
+ # change an expiration date is by reimporting the same key material
3372
+ # and specifying a new expiration date.
2488
3373
  #
2489
3374
  # When this operation is successful, the key state of the CMK changes
2490
- # from `PendingImport` to `Enabled`, and you can use the CMK. After you
2491
- # successfully import key material into a CMK, you can reimport the same
2492
- # key material into that CMK, but you cannot import different key
2493
- # material.
3375
+ # from `PendingImport` to `Enabled`, and you can use the CMK.
2494
3376
  #
2495
- # The result of this operation varies with the key state of the CMK. For
2496
- # details, see [How Key State Affects Use of a Customer Master Key][2]
2497
- # in the *AWS Key Management Service Developer Guide*.
3377
+ # If this operation fails, use the exception to help determine the
3378
+ # problem. If the error is related to the key material, the import
3379
+ # token, or wrapping key, use GetParametersForImport to get a new public
3380
+ # key and import token for the CMK and repeat the import procedure. For
3381
+ # help, see [How To Import Key Material][3] in the *AWS Key Management
3382
+ # Service Developer Guide*.
2498
3383
  #
3384
+ # The CMK that you use for this operation must be in a compatible key
3385
+ # state. For details, see [How Key State Affects Use of a Customer
3386
+ # Master Key][4] in the *AWS Key Management Service Developer Guide*.
2499
3387
  #
2500
3388
  #
2501
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2502
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3389
+ #
3390
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material
3391
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3392
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-overview
3393
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2503
3394
  #
2504
3395
  # @option params [required, String] :key_id
2505
- # The identifier of the CMK to import the key material into. The CMK's
2506
- # `Origin` must be `EXTERNAL`.
3396
+ # The identifier of the symmetric CMK that receives the imported key
3397
+ # material. The CMK's `Origin` must be `EXTERNAL`. This must be the
3398
+ # same CMK specified in the `KeyID` parameter of the corresponding
3399
+ # GetParametersForImport request.
2507
3400
  #
2508
3401
  # Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
2509
3402
  #
@@ -2522,10 +3415,10 @@ module Aws::KMS
2522
3415
  # contained the public key that you used to encrypt the key material.
2523
3416
  #
2524
3417
  # @option params [required, String, IO] :encrypted_key_material
2525
- # The encrypted key material to import. It must be encrypted with the
2526
- # public key that you received in the response to a previous
2527
- # GetParametersForImport request, using the wrapping algorithm that you
2528
- # specified in that request.
3418
+ # The encrypted key material to import. The key material must be
3419
+ # encrypted with the public wrapping key that GetParametersForImport
3420
+ # returned, using the wrapping algorithm that you specified in the same
3421
+ # `GetParametersForImport` request.
2529
3422
  #
2530
3423
  # @option params [Time,DateTime,Date,Integer,String] :valid_to
2531
3424
  # The time at which the imported key material expires. When the key
@@ -2591,7 +3484,7 @@ module Aws::KMS
2591
3484
  # field. These are predefined aliases that AWS has created but has not
2592
3485
  # yet associated with a CMK. Aliases that AWS creates in your account,
2593
3486
  # including predefined aliases, do not count against your [AWS KMS
2594
- # aliases limit][1].
3487
+ # aliases quota][1].
2595
3488
  #
2596
3489
  #
2597
3490
  #
@@ -2831,7 +3724,7 @@ module Aws::KMS
2831
3724
  # resp.grants[0].retiring_principal #=> String
2832
3725
  # resp.grants[0].issuing_account #=> String
2833
3726
  # resp.grants[0].operations #=> Array
2834
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "CreateGrant", "RetireGrant", "DescribeKey"
3727
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
2835
3728
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
2836
3729
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
2837
3730
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -2932,7 +3825,7 @@ module Aws::KMS
2932
3825
  end
2933
3826
 
2934
3827
  # Gets a list of all customer master keys (CMKs) in the caller's AWS
2935
- # account and region.
3828
+ # account and Region.
2936
3829
  #
2937
3830
  # @option params [Integer] :limit
2938
3831
  # Use this parameter to specify the maximum number of items to return.
@@ -3202,7 +4095,7 @@ module Aws::KMS
3202
4095
  # resp.grants[0].retiring_principal #=> String
3203
4096
  # resp.grants[0].issuing_account #=> String
3204
4097
  # resp.grants[0].operations #=> Array
3205
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "CreateGrant", "RetireGrant", "DescribeKey"
4098
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
3206
4099
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
3207
4100
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
3208
4101
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -3267,12 +4160,15 @@ module Aws::KMS
3267
4160
  # information, see [Changes that I make are not always immediately
3268
4161
  # visible][2] in the *AWS Identity and Access Management User Guide*.
3269
4162
  #
3270
- # The key policy size limit is 32 kilobytes (32768 bytes).
4163
+ # The key policy cannot exceed 32 kilobytes (32768 bytes). For more
4164
+ # information, see [Resource Quotas][3] in the *AWS Key Management
4165
+ # Service Developer Guide*.
3271
4166
  #
3272
4167
  #
3273
4168
  #
3274
4169
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
3275
4170
  # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
4171
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html
3276
4172
  #
3277
4173
  # @option params [Boolean] :bypass_policy_lockout_safety_check
3278
4174
  # A flag to indicate whether to bypass the key policy lockout safety
@@ -3326,40 +4222,142 @@ module Aws::KMS
3326
4222
  req.send_request(options)
3327
4223
  end
3328
4224
 
3329
- # Encrypts data on the server side with a new customer master key (CMK)
3330
- # without exposing the plaintext of the data on the client side. The
3331
- # data is first decrypted and then reencrypted. You can also use this
3332
- # operation to change the encryption context of a ciphertext.
3333
- #
3334
- # You can reencrypt data using CMKs in different AWS accounts.
3335
- #
3336
- # Unlike other operations, `ReEncrypt` is authorized twice, once as
3337
- # `ReEncryptFrom` on the source CMK and once as `ReEncryptTo` on the
3338
- # destination CMK. We recommend that you include the `"kms:ReEncrypt*"`
3339
- # permission in your [key policies][1] to permit reencryption from or to
3340
- # the CMK. This permission is automatically included in the key policy
3341
- # when you create a CMK through the console. But you must include it
3342
- # manually when you create a CMK programmatically or when you set a key
3343
- # policy with the PutKeyPolicy operation.
3344
- #
3345
- # The result of this operation varies with the key state of the CMK. For
3346
- # details, see [How Key State Affects Use of a Customer Master Key][2]
3347
- # in the *AWS Key Management Service Developer Guide*.
4225
+ # Decrypts ciphertext and then reencrypts it entirely within AWS KMS.
4226
+ # You can use this operation to change the customer master key (CMK)
4227
+ # under which data is encrypted, such as when you [manually rotate][1] a
4228
+ # CMK or change the CMK that protects a ciphertext. You can also use it
4229
+ # to reencrypt ciphertext under the same CMK, such as to change the
4230
+ # encryption context of a ciphertext.
4231
+ #
4232
+ # The `ReEncrypt` operation can decrypt ciphertext that was encrypted by
4233
+ # using an AWS KMS CMK in an AWS KMS operation, such as Encrypt or
4234
+ # GenerateDataKey. It can also decrypt ciphertext that was encrypted by
4235
+ # using the public key of an asymmetric CMK outside of AWS KMS. However,
4236
+ # it cannot decrypt ciphertext produced by other libraries, such as the
4237
+ # [AWS Encryption SDK][2] or [Amazon S3 client-side encryption][3].
4238
+ # These libraries return a ciphertext format that is incompatible with
4239
+ # AWS KMS.
4240
+ #
4241
+ # When you use the `ReEncrypt` operation, you need to provide
4242
+ # information for the decrypt operation and the subsequent encrypt
4243
+ # operation.
3348
4244
  #
4245
+ # * If your ciphertext was encrypted under an asymmetric CMK, you must
4246
+ # identify the *source CMK*, that is, the CMK that encrypted the
4247
+ # ciphertext. You must also supply the encryption algorithm that was
4248
+ # used. This information is required to decrypt the data.
4249
+ #
4250
+ # * It is optional, but you can specify a source CMK even when the
4251
+ # ciphertext was encrypted under a symmetric CMK. This ensures that
4252
+ # the ciphertext is decrypted only by using a particular CMK. If the
4253
+ # CMK that you specify cannot decrypt the ciphertext, the `ReEncrypt`
4254
+ # operation fails.
4255
+ #
4256
+ # * To reencrypt the data, you must specify the *destination CMK*, that
4257
+ # is, the CMK that re-encrypts the data after it is decrypted. You can
4258
+ # select a symmetric or asymmetric CMK. If the destination CMK is an
4259
+ # asymmetric CMK, you must also provide the encryption algorithm. The
4260
+ # algorithm that you choose must be compatible with the CMK.
4261
+ #
4262
+ # When you use an asymmetric CMK to encrypt or reencrypt data, be sure
4263
+ # to record the CMK and encryption algorithm that you choose. You will
4264
+ # be required to provide the same CMK and encryption algorithm when
4265
+ # you decrypt the data. If the CMK and algorithm do not match the
4266
+ # values used to encrypt the data, the decrypt operation fails.
4267
+ #
4268
+ # You are not required to supply the CMK ID and encryption algorithm
4269
+ # when you decrypt with symmetric CMKs because AWS KMS stores this
4270
+ # information in the ciphertext blob. AWS KMS cannot store metadata in
4271
+ # ciphertext generated with asymmetric keys. The standard format for
4272
+ # asymmetric key ciphertext does not include configurable fields.
4273
+ #
4274
+ # Unlike other AWS KMS API operations, `ReEncrypt` callers must have two
4275
+ # permissions:
4276
+ #
4277
+ # * `kms:EncryptFrom` permission on the source CMK
4278
+ #
4279
+ # * `kms:EncryptTo` permission on the destination CMK
4280
+ #
4281
+ # To permit reencryption from
4282
+ #
4283
+ # or to a CMK, include the `"kms:ReEncrypt*"` permission in your [key
4284
+ # policy][4]. This permission is automatically included in the key
4285
+ # policy when you use the console to create a CMK. But you must include
4286
+ # it manually when you create a CMK programmatically or when you use the
4287
+ # PutKeyPolicy operation set a key policy.
4288
+ #
4289
+ # The CMK that you use for this operation must be in a compatible key
4290
+ # state. For details, see [How Key State Affects Use of a Customer
4291
+ # Master Key][5] in the *AWS Key Management Service Developer Guide*.
3349
4292
  #
3350
4293
  #
3351
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
3352
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4294
+ #
4295
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually
4296
+ # [2]: https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/
4297
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html
4298
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
4299
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3353
4300
  #
3354
4301
  # @option params [required, String, IO] :ciphertext_blob
3355
4302
  # Ciphertext of the data to reencrypt.
3356
4303
  #
3357
4304
  # @option params [Hash<String,String>] :source_encryption_context
3358
- # Encryption context used to encrypt and decrypt the data specified in
3359
- # the `CiphertextBlob` parameter.
4305
+ # Specifies the encryption context to use to decrypt the ciphertext.
4306
+ # Enter the same encryption context that was used to encrypt the
4307
+ # ciphertext.
4308
+ #
4309
+ # An *encryption context* is a collection of non-secret key-value pairs
4310
+ # that represents additional authenticated data. When you use an
4311
+ # encryption context to encrypt data, you must specify the same (an
4312
+ # exact case-sensitive match) encryption context to decrypt the data. An
4313
+ # encryption context is optional when encrypting with a symmetric CMK,
4314
+ # but it is highly recommended.
4315
+ #
4316
+ # For more information, see [Encryption Context][1] in the *AWS Key
4317
+ # Management Service Developer Guide*.
4318
+ #
4319
+ #
4320
+ #
4321
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
4322
+ #
4323
+ # @option params [String] :source_key_id
4324
+ # A unique identifier for the CMK that is used to decrypt the ciphertext
4325
+ # before it reencrypts it using the destination CMK.
4326
+ #
4327
+ # This parameter is required only when the ciphertext was encrypted
4328
+ # under an asymmetric CMK. Otherwise, AWS KMS uses the metadata that it
4329
+ # adds to the ciphertext blob to determine which CMK was used to encrypt
4330
+ # the ciphertext. However, you can use this parameter to ensure that a
4331
+ # particular CMK (of any kind) is used to decrypt the ciphertext before
4332
+ # it is reencrypted.
4333
+ #
4334
+ # If you specify a `KeyId` value, the decrypt part of the `ReEncrypt`
4335
+ # operation succeeds only if the specified CMK was used to encrypt the
4336
+ # ciphertext.
4337
+ #
4338
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
4339
+ # name, or alias ARN. When using an alias name, prefix it with
4340
+ # `"alias/"`.
4341
+ #
4342
+ # For example:
4343
+ #
4344
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
4345
+ #
4346
+ # * Key ARN:
4347
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
4348
+ #
4349
+ # * Alias name: `alias/ExampleAlias`
4350
+ #
4351
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
4352
+ #
4353
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
4354
+ # To get the alias name and alias ARN, use ListAliases.
3360
4355
  #
3361
4356
  # @option params [required, String] :destination_key_id
3362
4357
  # A unique identifier for the CMK that is used to reencrypt the data.
4358
+ # Specify a symmetric or asymmetric CMK with a `KeyUsage` value of
4359
+ # `ENCRYPT_DECRYPT`. To find the `KeyUsage` value of a CMK, use the
4360
+ # DescribeKey operation.
3363
4361
  #
3364
4362
  # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
3365
4363
  # name, or alias ARN. When using an alias name, prefix it with
@@ -3381,7 +4379,46 @@ module Aws::KMS
3381
4379
  # To get the alias name and alias ARN, use ListAliases.
3382
4380
  #
3383
4381
  # @option params [Hash<String,String>] :destination_encryption_context
3384
- # Encryption context to use when the data is reencrypted.
4382
+ # Specifies that encryption context to use when the reencrypting the
4383
+ # data.
4384
+ #
4385
+ # A destination encryption context is valid only when the destination
4386
+ # CMK is a symmetric CMK. The standard ciphertext format for asymmetric
4387
+ # CMKs does not include fields for metadata.
4388
+ #
4389
+ # An *encryption context* is a collection of non-secret key-value pairs
4390
+ # that represents additional authenticated data. When you use an
4391
+ # encryption context to encrypt data, you must specify the same (an
4392
+ # exact case-sensitive match) encryption context to decrypt the data. An
4393
+ # encryption context is optional when encrypting with a symmetric CMK,
4394
+ # but it is highly recommended.
4395
+ #
4396
+ # For more information, see [Encryption Context][1] in the *AWS Key
4397
+ # Management Service Developer Guide*.
4398
+ #
4399
+ #
4400
+ #
4401
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
4402
+ #
4403
+ # @option params [String] :source_encryption_algorithm
4404
+ # Specifies the encryption algorithm that AWS KMS will use to decrypt
4405
+ # the ciphertext before it is reencrypted. The default value,
4406
+ # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric CMKs.
4407
+ #
4408
+ # Specify the same algorithm that was used to encrypt the ciphertext. If
4409
+ # you specify a different algorithm, the decrypt attempt fails.
4410
+ #
4411
+ # This parameter is required only when the ciphertext was encrypted
4412
+ # under an asymmetric CMK.
4413
+ #
4414
+ # @option params [String] :destination_encryption_algorithm
4415
+ # Specifies the encryption algorithm that AWS KMS will use to reecrypt
4416
+ # the data after it has decrypted it. The default value,
4417
+ # `SYMMETRIC_DEFAULT`, represents the encryption algorithm used for
4418
+ # symmetric CMKs.
4419
+ #
4420
+ # This parameter is required only when the destination CMK is an
4421
+ # asymmetric CMK.
3385
4422
  #
3386
4423
  # @option params [Array<String>] :grant_tokens
3387
4424
  # A list of grant tokens.
@@ -3398,6 +4435,8 @@ module Aws::KMS
3398
4435
  # * {Types::ReEncryptResponse#ciphertext_blob #ciphertext_blob} => String
3399
4436
  # * {Types::ReEncryptResponse#source_key_id #source_key_id} => String
3400
4437
  # * {Types::ReEncryptResponse#key_id #key_id} => String
4438
+ # * {Types::ReEncryptResponse#source_encryption_algorithm #source_encryption_algorithm} => String
4439
+ # * {Types::ReEncryptResponse#destination_encryption_algorithm #destination_encryption_algorithm} => String
3401
4440
  #
3402
4441
  #
3403
4442
  # @example Example: To reencrypt data
@@ -3423,10 +4462,13 @@ module Aws::KMS
3423
4462
  # source_encryption_context: {
3424
4463
  # "EncryptionContextKey" => "EncryptionContextValue",
3425
4464
  # },
4465
+ # source_key_id: "KeyIdType",
3426
4466
  # destination_key_id: "KeyIdType", # required
3427
4467
  # destination_encryption_context: {
3428
4468
  # "EncryptionContextKey" => "EncryptionContextValue",
3429
4469
  # },
4470
+ # source_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
4471
+ # destination_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
3430
4472
  # grant_tokens: ["GrantTokenType"],
3431
4473
  # })
3432
4474
  #
@@ -3435,6 +4477,8 @@ module Aws::KMS
3435
4477
  # resp.ciphertext_blob #=> String
3436
4478
  # resp.source_key_id #=> String
3437
4479
  # resp.key_id #=> String
4480
+ # resp.source_encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
4481
+ # resp.destination_encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
3438
4482
  #
3439
4483
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt AWS API Documentation
3440
4484
  #
@@ -3591,9 +4635,9 @@ module Aws::KMS
3591
4635
  # [Deleting Customer Master Keys][3] in the *AWS Key Management Service
3592
4636
  # Developer Guide*.
3593
4637
  #
3594
- # The result of this operation varies with the key state of the CMK. For
3595
- # details, see [How Key State Affects Use of a Customer Master Key][4]
3596
- # in the *AWS Key Management Service Developer Guide*.
4638
+ # The CMK that you use for this operation must be in a compatible key
4639
+ # state. For details, see [How Key State Affects Use of a Customer
4640
+ # Master Key][4] in the *AWS Key Management Service Developer Guide*.
3597
4641
  #
3598
4642
  #
3599
4643
  #
@@ -3665,6 +4709,138 @@ module Aws::KMS
3665
4709
  req.send_request(options)
3666
4710
  end
3667
4711
 
4712
+ # Creates a [digital signature][1] for a message or message digest by
4713
+ # using the private key in an asymmetric CMK. To verify the signature,
4714
+ # use the Verify operation, or use the public key in the same asymmetric
4715
+ # CMK outside of AWS KMS. For information about symmetric and asymmetric
4716
+ # CMKs, see [Using Symmetric and Asymmetric CMKs][2] in the *AWS Key
4717
+ # Management Service Developer Guide*.
4718
+ #
4719
+ # Digital signatures are generated and verified by using asymmetric key
4720
+ # pair, such as an RSA or ECC pair that is represented by an asymmetric
4721
+ # customer master key (CMK). The key owner (or an authorized user) uses
4722
+ # their private key to sign a message. Anyone with the public key can
4723
+ # verify that the message was signed with that particular private key
4724
+ # and that the message hasn't changed since it was signed.
4725
+ #
4726
+ # To use the `Sign` operation, provide the following information:
4727
+ #
4728
+ # * Use the `KeyId` parameter to identify an asymmetric CMK with a
4729
+ # `KeyUsage` value of `SIGN_VERIFY`. To get the `KeyUsage` value of a
4730
+ # CMK, use the DescribeKey operation. The caller must have `kms:Sign`
4731
+ # permission on the CMK.
4732
+ #
4733
+ # * Use the `Message` parameter to specify the message or message digest
4734
+ # to sign. You can submit messages of up to 4096 bytes. To sign a
4735
+ # larger message, generate a hash digest of the message, and then
4736
+ # provide the hash digest in the `Message` parameter. To indicate
4737
+ # whether the message is a full message or a digest, use the
4738
+ # `MessageType` parameter.
4739
+ #
4740
+ # * Choose a signing algorithm that is compatible with the CMK.
4741
+ #
4742
+ # When signing a message, be sure to record the CMK and the signing
4743
+ # algorithm. This information is required to verify the signature.
4744
+ #
4745
+ # To verify the signature that this operation generates, use the Verify
4746
+ # operation. Or use the GetPublicKey operation to download the public
4747
+ # key and then use the public key to verify the signature outside of AWS
4748
+ # KMS.
4749
+ #
4750
+ # The CMK that you use for this operation must be in a compatible key
4751
+ # state. For details, see [How Key State Affects Use of a Customer
4752
+ # Master Key][3] in the *AWS Key Management Service Developer Guide*.
4753
+ #
4754
+ #
4755
+ #
4756
+ # [1]: https://en.wikipedia.org/wiki/Digital_signature
4757
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
4758
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4759
+ #
4760
+ # @option params [required, String] :key_id
4761
+ # Identifies an asymmetric CMK. AWS KMS uses the private key in the
4762
+ # asymmetric CMK to sign the message. The `KeyUsage` type of the CMK
4763
+ # must be `SIGN_VERIFY`. To find the `KeyUsage` of a CMK, use the
4764
+ # DescribeKey operation.
4765
+ #
4766
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
4767
+ # name, or alias ARN. When using an alias name, prefix it with
4768
+ # `"alias/"`. To specify a CMK in a different AWS account, you must use
4769
+ # the key ARN or alias ARN.
4770
+ #
4771
+ # For example:
4772
+ #
4773
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
4774
+ #
4775
+ # * Key ARN:
4776
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
4777
+ #
4778
+ # * Alias name: `alias/ExampleAlias`
4779
+ #
4780
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
4781
+ #
4782
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
4783
+ # To get the alias name and alias ARN, use ListAliases.
4784
+ #
4785
+ # @option params [required, String, IO] :message
4786
+ # Specifies the message or message digest to sign. Messages can be
4787
+ # 0-4096 bytes. To sign a larger message, provide the message digest.
4788
+ #
4789
+ # If you provide a message, AWS KMS generates a hash digest of the
4790
+ # message and then signs it.
4791
+ #
4792
+ # @option params [String] :message_type
4793
+ # Tells AWS KMS whether the value of the `Message` parameter is a
4794
+ # message or message digest. To indicate a message, enter `RAW`. To
4795
+ # indicate a message digest, enter `DIGEST`.
4796
+ #
4797
+ # @option params [Array<String>] :grant_tokens
4798
+ # A list of grant tokens.
4799
+ #
4800
+ # For more information, see [Grant Tokens][1] in the *AWS Key Management
4801
+ # Service Developer Guide*.
4802
+ #
4803
+ #
4804
+ #
4805
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
4806
+ #
4807
+ # @option params [required, String] :signing_algorithm
4808
+ # Specifies the signing algorithm to use when signing the message.
4809
+ #
4810
+ # Choose an algorithm that is compatible with the type and size of the
4811
+ # specified asymmetric CMK.
4812
+ #
4813
+ # @return [Types::SignResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
4814
+ #
4815
+ # * {Types::SignResponse#key_id #key_id} => String
4816
+ # * {Types::SignResponse#signature #signature} => String
4817
+ # * {Types::SignResponse#signing_algorithm #signing_algorithm} => String
4818
+ #
4819
+ # @example Request syntax with placeholder values
4820
+ #
4821
+ # resp = client.sign({
4822
+ # key_id: "KeyIdType", # required
4823
+ # message: "data", # required
4824
+ # message_type: "RAW", # accepts RAW, DIGEST
4825
+ # grant_tokens: ["GrantTokenType"],
4826
+ # signing_algorithm: "RSASSA_PSS_SHA_256", # required, accepts RSASSA_PSS_SHA_256, RSASSA_PSS_SHA_384, RSASSA_PSS_SHA_512, RSASSA_PKCS1_V1_5_SHA_256, RSASSA_PKCS1_V1_5_SHA_384, RSASSA_PKCS1_V1_5_SHA_512, ECDSA_SHA_256, ECDSA_SHA_384, ECDSA_SHA_512
4827
+ # })
4828
+ #
4829
+ # @example Response structure
4830
+ #
4831
+ # resp.key_id #=> String
4832
+ # resp.signature #=> String
4833
+ # resp.signing_algorithm #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512"
4834
+ #
4835
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign AWS API Documentation
4836
+ #
4837
+ # @overload sign(params = {})
4838
+ # @param [Hash] params ({})
4839
+ def sign(params = {}, options = {})
4840
+ req = build_request(:sign, params)
4841
+ req.send_request(options)
4842
+ end
4843
+
3668
4844
  # Adds or edits tags for a customer master key (CMK). You cannot perform
3669
4845
  # this operation on a CMK in a different AWS account.
3670
4846
  #
@@ -3679,9 +4855,9 @@ module Aws::KMS
3679
4855
  # see [User-Defined Tag Restrictions][1] in the *AWS Billing and Cost
3680
4856
  # Management User Guide*.
3681
4857
  #
3682
- # The result of this operation varies with the key state of the CMK. For
3683
- # details, see [How Key State Affects Use of a Customer Master Key][2]
3684
- # in the *AWS Key Management Service Developer Guide*.
4858
+ # The CMK that you use for this operation must be in a compatible key
4859
+ # state. For details, see [How Key State Affects Use of a Customer
4860
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
3685
4861
  #
3686
4862
  #
3687
4863
  #
@@ -3750,9 +4926,9 @@ module Aws::KMS
3750
4926
  # To remove a tag, specify the tag key. To change the tag value of an
3751
4927
  # existing tag key, use TagResource.
3752
4928
  #
3753
- # The result of this operation varies with the key state of the CMK. For
3754
- # details, see [How Key State Affects Use of a Customer Master Key][1]
3755
- # in the *AWS Key Management Service Developer Guide*.
4929
+ # The CMK that you use for this operation must be in a compatible key
4930
+ # state. For details, see [How Key State Affects Use of a Customer
4931
+ # Master Key][1] in the *AWS Key Management Service Developer Guide*.
3756
4932
  #
3757
4933
  #
3758
4934
  #
@@ -3806,14 +4982,22 @@ module Aws::KMS
3806
4982
  req.send_request(options)
3807
4983
  end
3808
4984
 
3809
- # Associates an existing alias with a different customer master key
3810
- # (CMK). Each CMK can have multiple aliases, but the aliases must be
3811
- # unique within the account and region. You cannot perform this
4985
+ # Associates an existing AWS KMS alias with a different customer master
4986
+ # key (CMK). Each alias is associated with only one CMK at a time,
4987
+ # although a CMK can have multiple aliases. The alias and the CMK must
4988
+ # be in the same AWS account and region. You cannot perform this
3812
4989
  # operation on an alias in a different AWS account.
3813
4990
  #
3814
- # This operation works only on existing aliases. To change the alias of
3815
- # a CMK to a new value, use CreateAlias to create a new alias and
3816
- # DeleteAlias to delete the old alias.
4991
+ # The current and new CMK must be the same type (both symmetric or both
4992
+ # asymmetric), and they must have the same key usage (`ENCRYPT_DECRYPT`
4993
+ # or `SIGN_VERIFY`). This restriction prevents errors in code that uses
4994
+ # aliases. If you must assign an alias to a different type of CMK, use
4995
+ # DeleteAlias to delete the old alias and CreateAlias to create a new
4996
+ # alias.
4997
+ #
4998
+ # You cannot use `UpdateAlias` to change an alias name. To change an
4999
+ # alias name, use DeleteAlias to delete the old alias and CreateAlias to
5000
+ # create a new alias.
3817
5001
  #
3818
5002
  # Because an alias is not a property of a CMK, you can create, update,
3819
5003
  # and delete the aliases of a CMK without affecting the CMK. Also,
@@ -3821,29 +5005,28 @@ module Aws::KMS
3821
5005
  # To get the aliases of all CMKs in the account, use the ListAliases
3822
5006
  # operation.
3823
5007
  #
3824
- # The alias name must begin with `alias/` followed by a name, such as
3825
- # `alias/ExampleAlias`. It can contain only alphanumeric characters,
3826
- # forward slashes (/), underscores (\_), and dashes (-). The alias name
3827
- # cannot begin with `alias/aws/`. The `alias/aws/` prefix is reserved
3828
- # for [AWS managed CMKs][1].
3829
- #
3830
- # The result of this operation varies with the key state of the CMK. For
3831
- # details, see [How Key State Affects Use of a Customer Master Key][2]
3832
- # in the *AWS Key Management Service Developer Guide*.
5008
+ # The CMK that you use for this operation must be in a compatible key
5009
+ # state. For details, see [How Key State Affects Use of a Customer
5010
+ # Master Key][1] in the *AWS Key Management Service Developer Guide*.
3833
5011
  #
3834
5012
  #
3835
5013
  #
3836
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
3837
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
5014
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3838
5015
  #
3839
5016
  # @option params [required, String] :alias_name
3840
- # Specifies the name of the alias to change. This value must begin with
3841
- # `alias/` followed by the alias name, such as `alias/ExampleAlias`.
5017
+ # Identifies the alias that is changing its CMK. This value must begin
5018
+ # with `alias/` followed by the alias name, such as
5019
+ # `alias/ExampleAlias`. You cannot use UpdateAlias to change the alias
5020
+ # name.
3842
5021
  #
3843
5022
  # @option params [required, String] :target_key_id
3844
- # Unique identifier of the customer master key (CMK) to be mapped to the
3845
- # alias. When the update operation completes, the alias will point to
3846
- # this CMK.
5023
+ # Identifies the CMK to associate with the alias. When the update
5024
+ # operation completes, the alias will point to this CMK.
5025
+ #
5026
+ # The CMK must be in the same AWS account and Region as the alias. Also,
5027
+ # the new target CMK must be the same type as the current target CMK
5028
+ # (both symmetric or both asymmetric) and they must have the same key
5029
+ # usage.
3847
5030
  #
3848
5031
  # Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
3849
5032
  #
@@ -3994,9 +5177,9 @@ module Aws::KMS
3994
5177
  #
3995
5178
  # You cannot perform this operation on a CMK in a different AWS account.
3996
5179
  #
3997
- # The result of this operation varies with the key state of the CMK. For
3998
- # details, see [How Key State Affects Use of a Customer Master Key][1]
3999
- # in the *AWS Key Management Service Developer Guide*.
5180
+ # The CMK that you use for this operation must be in a compatible key
5181
+ # state. For details, see [How Key State Affects Use of a Customer
5182
+ # Master Key][1] in the *AWS Key Management Service Developer Guide*.
4000
5183
  #
4001
5184
  #
4002
5185
  #
@@ -4047,6 +5230,138 @@ module Aws::KMS
4047
5230
  req.send_request(options)
4048
5231
  end
4049
5232
 
5233
+ # Verifies a digital signature that was generated by the Sign operation.
5234
+ #
5235
+ #
5236
+ #
5237
+ # Verification confirms that an authorized user signed the message with
5238
+ # the specified CMK and signing algorithm, and the message hasn't
5239
+ # changed since it was signed. If the signature is verified, the value
5240
+ # of the `SignatureValid` field in the response is `True`. If the
5241
+ # signature verification fails, the `Verify` operation fails with an
5242
+ # `KMSInvalidSignatureException` exception.
5243
+ #
5244
+ # A digital signature is generated by using the private key in an
5245
+ # asymmetric CMK. The signature is verified by using the public key in
5246
+ # the same asymmetric CMK. For information about symmetric and
5247
+ # asymmetric CMKs, see [Using Symmetric and Asymmetric CMKs][1] in the
5248
+ # *AWS Key Management Service Developer Guide*.
5249
+ #
5250
+ # To verify a digital signature, you can use the `Verify` operation.
5251
+ # Specify the same asymmetric CMK, message, and signing algorithm that
5252
+ # were used to produce the signature.
5253
+ #
5254
+ # You can also verify the digital signature by using the public key of
5255
+ # the CMK outside of AWS KMS. Use the GetPublicKey operation to download
5256
+ # the public key in the asymmetric CMK and then use the public key to
5257
+ # verify the signature outside of AWS KMS. The advantage of using the
5258
+ # `Verify` operation is that it is performed within AWS KMS. As a
5259
+ # result, it's easy to call, the operation is performed within the FIPS
5260
+ # boundary, it is logged in AWS CloudTrail, and you can use key policy
5261
+ # and IAM policy to determine who is authorized to use the CMK to verify
5262
+ # signatures.
5263
+ #
5264
+ # The CMK that you use for this operation must be in a compatible key
5265
+ # state. For details, see [How Key State Affects Use of a Customer
5266
+ # Master Key][2] in the *AWS Key Management Service Developer Guide*.
5267
+ #
5268
+ #
5269
+ #
5270
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
5271
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
5272
+ #
5273
+ # @option params [required, String] :key_id
5274
+ # Identifies the asymmetric CMK that will be used to verify the
5275
+ # signature. This must be the same CMK that was used to generate the
5276
+ # signature. If you specify a different CMK, the signature verification
5277
+ # fails.
5278
+ #
5279
+ # To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias
5280
+ # name, or alias ARN. When using an alias name, prefix it with
5281
+ # `"alias/"`. To specify a CMK in a different AWS account, you must use
5282
+ # the key ARN or alias ARN.
5283
+ #
5284
+ # For example:
5285
+ #
5286
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
5287
+ #
5288
+ # * Key ARN:
5289
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
5290
+ #
5291
+ # * Alias name: `alias/ExampleAlias`
5292
+ #
5293
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
5294
+ #
5295
+ # To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
5296
+ # To get the alias name and alias ARN, use ListAliases.
5297
+ #
5298
+ # @option params [required, String, IO] :message
5299
+ # Specifies the message that was signed. You can submit a raw message of
5300
+ # up to 4096 bytes, or a hash digest of the message. If you submit a
5301
+ # digest, use the `MessageType` parameter with a value of `DIGEST`.
5302
+ #
5303
+ # If the message specified here is different from the message that was
5304
+ # signed, the signature verification fails. A message and its hash
5305
+ # digest are considered to be the same message.
5306
+ #
5307
+ # @option params [String] :message_type
5308
+ # Tells AWS KMS whether the value of the `Message` parameter is a
5309
+ # message or message digest. The default value, RAW, indicates a
5310
+ # message. To indicate a message digest, enter `DIGEST`.
5311
+ #
5312
+ # Use the `DIGEST` value only when the value of the `Message` parameter
5313
+ # is a message digest. If you use the `DIGEST` value with a raw message,
5314
+ # the security of the verification operation can be compromised.
5315
+ #
5316
+ # @option params [required, String, IO] :signature
5317
+ # The signature that the `Sign` operation generated.
5318
+ #
5319
+ # @option params [required, String] :signing_algorithm
5320
+ # The signing algorithm that was used to sign the message. If you submit
5321
+ # a different algorithm, the signature verification fails.
5322
+ #
5323
+ # @option params [Array<String>] :grant_tokens
5324
+ # A list of grant tokens.
5325
+ #
5326
+ # For more information, see [Grant Tokens][1] in the *AWS Key Management
5327
+ # Service Developer Guide*.
5328
+ #
5329
+ #
5330
+ #
5331
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token
5332
+ #
5333
+ # @return [Types::VerifyResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
5334
+ #
5335
+ # * {Types::VerifyResponse#key_id #key_id} => String
5336
+ # * {Types::VerifyResponse#signature_valid #signature_valid} => Boolean
5337
+ # * {Types::VerifyResponse#signing_algorithm #signing_algorithm} => String
5338
+ #
5339
+ # @example Request syntax with placeholder values
5340
+ #
5341
+ # resp = client.verify({
5342
+ # key_id: "KeyIdType", # required
5343
+ # message: "data", # required
5344
+ # message_type: "RAW", # accepts RAW, DIGEST
5345
+ # signature: "data", # required
5346
+ # signing_algorithm: "RSASSA_PSS_SHA_256", # required, accepts RSASSA_PSS_SHA_256, RSASSA_PSS_SHA_384, RSASSA_PSS_SHA_512, RSASSA_PKCS1_V1_5_SHA_256, RSASSA_PKCS1_V1_5_SHA_384, RSASSA_PKCS1_V1_5_SHA_512, ECDSA_SHA_256, ECDSA_SHA_384, ECDSA_SHA_512
5347
+ # grant_tokens: ["GrantTokenType"],
5348
+ # })
5349
+ #
5350
+ # @example Response structure
5351
+ #
5352
+ # resp.key_id #=> String
5353
+ # resp.signature_valid #=> Boolean
5354
+ # resp.signing_algorithm #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512"
5355
+ #
5356
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify AWS API Documentation
5357
+ #
5358
+ # @overload verify(params = {})
5359
+ # @param [Hash] params ({})
5360
+ def verify(params = {}, options = {})
5361
+ req = build_request(:verify, params)
5362
+ req.send_request(options)
5363
+ end
5364
+
4050
5365
  # @!endgroup
4051
5366
 
4052
5367
  # @param params ({})
@@ -4060,7 +5375,7 @@ module Aws::KMS
4060
5375
  params: params,
4061
5376
  config: config)
4062
5377
  context[:gem_name] = 'aws-sdk-kms'
4063
- context[:gem_version] = '1.23.0'
5378
+ context[:gem_version] = '1.28.0'
4064
5379
  Seahorse::Client::Request.new(handlers, context)
4065
5380
  end
4066
5381