aws-sdk-kms 1.55.0 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -370,8 +370,8 @@ module Aws::KMS
370
370
  # Developer Guide*.
371
371
  #
372
372
  # The KMS key that you use for this operation must be in a compatible
373
- # key state. For details, see [Key state: Effect on your KMS key][2] in
374
- # the *Key Management Service Developer Guide*.
373
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
374
+ # Management Service Developer Guide*.
375
375
  #
376
376
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
377
377
  # key in a different Amazon Web Services account.
@@ -544,8 +544,8 @@ module Aws::KMS
544
544
  # Creates a friendly name for a KMS key.
545
545
  #
546
546
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
547
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
548
- # Management Service Developer Guide*.
547
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
548
+ # Service Developer Guide*.
549
549
  #
550
550
  # </note>
551
551
  #
@@ -570,8 +570,8 @@ module Aws::KMS
570
570
  # created, use the ListAliases operation.
571
571
  #
572
572
  # The KMS key that you use for this operation must be in a compatible
573
- # key state. For details, see [Key state: Effect on your KMS key][4] in
574
- # the *Key Management Service Developer Guide*.
573
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
574
+ # Management Service Developer Guide*.
575
575
  #
576
576
  # **Cross-account use**\: No. You cannot perform this operation on an
577
577
  # alias in a different Amazon Web Services account.
@@ -674,7 +674,7 @@ module Aws::KMS
674
674
  # Creates a [custom key store][1] that is associated with an [CloudHSM
675
675
  # cluster][2] that you own and manage.
676
676
  #
677
- # This operation is part of the [Custom Key Store feature][1] feature in
677
+ # This operation is part of the [custom key store feature][1] feature in
678
678
  # KMS, which combines the convenience and extensive integration of KMS
679
679
  # with the isolation and control of a single-tenant key store.
680
680
  #
@@ -724,7 +724,7 @@ module Aws::KMS
724
724
  # Specifies a friendly name for the custom key store. The name must be
725
725
  # unique in your Amazon Web Services account.
726
726
  #
727
- # @option params [required, String] :cloud_hsm_cluster_id
727
+ # @option params [String] :cloud_hsm_cluster_id
728
728
  # Identifies the CloudHSM cluster for the custom key store. Enter the
729
729
  # cluster ID of any active CloudHSM cluster that is not already
730
730
  # associated with a custom key store. To find the cluster ID, use the
@@ -734,7 +734,7 @@ module Aws::KMS
734
734
  #
735
735
  # [1]: https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html
736
736
  #
737
- # @option params [required, String] :trust_anchor_certificate
737
+ # @option params [String] :trust_anchor_certificate
738
738
  # Enter the content of the trust anchor certificate for the cluster.
739
739
  # This is the content of the `customerCA.crt` file that you created when
740
740
  # you [initialized the cluster][1].
@@ -743,7 +743,7 @@ module Aws::KMS
743
743
  #
744
744
  # [1]: https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html
745
745
  #
746
- # @option params [required, String] :key_store_password
746
+ # @option params [String] :key_store_password
747
747
  # Enter the password of the [ `kmsuser` crypto user (CU) account][1] in
748
748
  # the specified CloudHSM cluster. KMS logs into the cluster as this user
749
749
  # to manage key material on your behalf.
@@ -783,9 +783,9 @@ module Aws::KMS
783
783
  #
784
784
  # resp = client.create_custom_key_store({
785
785
  # custom_key_store_name: "CustomKeyStoreNameType", # required
786
- # cloud_hsm_cluster_id: "CloudHsmClusterIdType", # required
787
- # trust_anchor_certificate: "TrustAnchorCertificateType", # required
788
- # key_store_password: "KeyStorePasswordType", # required
786
+ # cloud_hsm_cluster_id: "CloudHsmClusterIdType",
787
+ # trust_anchor_certificate: "TrustAnchorCertificateType",
788
+ # key_store_password: "KeyStorePasswordType",
789
789
  # })
790
790
  #
791
791
  # @example Response structure
@@ -812,7 +812,7 @@ module Aws::KMS
812
812
  # and delete it without changing your key policies or IAM policies.
813
813
  #
814
814
  # For detailed information about grants, including grant terminology,
815
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
815
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
816
816
  # Guide</i> </i>. For examples of working with grants in several
817
817
  # programming languages, see [Programming grants][2].
818
818
  #
@@ -835,8 +835,8 @@ module Aws::KMS
835
835
  # the ListGrants or ListRetirableGrants operations.
836
836
  #
837
837
  # The KMS key that you use for this operation must be in a compatible
838
- # key state. For details, see [Key state: Effect on your KMS key][4] in
839
- # the *Key Management Service Developer Guide*.
838
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
839
+ # Management Service Developer Guide*.
840
840
  #
841
841
  # **Cross-account use**\: Yes. To perform this operation on a KMS key in
842
842
  # a different Amazon Web Services account, specify the key ARN in the
@@ -921,12 +921,13 @@ module Aws::KMS
921
921
  # @option params [required, Array<String>] :operations
922
922
  # A list of operations that the grant permits.
923
923
  #
924
- # The operation must be supported on the KMS key. For example, you
925
- # cannot create a grant for a symmetric KMS key that allows the Sign
926
- # operation, or a grant for an asymmetric KMS key that allows the
927
- # GenerateDataKey operation. If you try, KMS returns a `ValidationError`
928
- # exception. For details, see [Grant operations][1] in the *Key
929
- # Management Service Developer Guide*.
924
+ # This list must include only operations that are permitted in a grant.
925
+ # Also, the operation must be supported on the KMS key. For example, you
926
+ # cannot create a grant for a symmetric encryption KMS key that allows
927
+ # the Sign operation, or a grant for an asymmetric KMS key that allows
928
+ # the GenerateDataKey operation. If you try, KMS returns a
929
+ # `ValidationError` exception. For details, see [Grant operations][1] in
930
+ # the *Key Management Service Developer Guide*.
930
931
  #
931
932
  #
932
933
  #
@@ -938,27 +939,38 @@ module Aws::KMS
938
939
  # KMS supports the `EncryptionContextEquals` and
939
940
  # `EncryptionContextSubset` grant constraints. Each constraint value can
940
941
  # include up to 8 encryption context pairs. The encryption context value
941
- # in each constraint cannot exceed 384 characters.
942
- #
943
- # These grant constraints allow the permissions in the grant only when
944
- # the encryption context in the request matches
945
- # (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
946
- # the encryption context specified in this structure. For information
947
- # about grant constraints, see [Using grant constraints][1] in the *Key
942
+ # in each constraint cannot exceed 384 characters. For information about
943
+ # grant constraints, see [Using grant constraints][1] in the *Key
948
944
  # Management Service Developer Guide*. For more information about
949
- # encryption context, see [Encryption Context][2] in the <i> <i>Key
945
+ # encryption context, see [Encryption context][2] in the <i> <i>Key
950
946
  # Management Service Developer Guide</i> </i>.
951
947
  #
952
- # The encryption context grant constraints are supported only on
953
- # operations that include an encryption context. You cannot use an
954
- # encryption context grant constraint for cryptographic operations with
955
- # asymmetric KMS keys or for management operations, such as DescribeKey
956
- # or RetireGrant.
948
+ # The encryption context grant constraints allow the permissions in the
949
+ # grant only when the encryption context in the request matches
950
+ # (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
951
+ # the encryption context specified in this structure.
952
+ #
953
+ # The encryption context grant constraints are supported only on [grant
954
+ # operations][3] that include an `EncryptionContext` parameter, such as
955
+ # cryptographic operations on symmetric encryption KMS keys. Grants with
956
+ # grant constraints can include the DescribeKey and RetireGrant
957
+ # operations, but the constraint doesn't apply to these operations. If
958
+ # a grant with a grant constraint includes the `CreateGrant` operation,
959
+ # the constraint requires that any grants created with the `CreateGrant`
960
+ # permission have an equally strict or stricter encryption context
961
+ # constraint.
962
+ #
963
+ # You cannot use an encryption context grant constraint for
964
+ # cryptographic operations with asymmetric KMS keys or HMAC KMS keys.
965
+ # These keys don't support an encryption context.
966
+ #
967
+ #
957
968
  #
958
969
  #
959
970
  #
960
971
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints
961
972
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
973
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations
962
974
  #
963
975
  # @option params [Array<String>] :grant_tokens
964
976
  # A list of grant tokens.
@@ -1020,7 +1032,7 @@ module Aws::KMS
1020
1032
  # key_id: "KeyIdType", # required
1021
1033
  # grantee_principal: "PrincipalIdType", # required
1022
1034
  # retiring_principal: "PrincipalIdType",
1023
- # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext
1035
+ # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac
1024
1036
  # constraints: {
1025
1037
  # encryption_context_subset: {
1026
1038
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -1050,35 +1062,37 @@ module Aws::KMS
1050
1062
  # Creates a unique customer managed [KMS key][1] in your Amazon Web
1051
1063
  # Services account and Region.
1052
1064
  #
1065
+ # In addition to the required parameters, you can use the optional
1066
+ # parameters to specify a key policy, description, tags, and other
1067
+ # useful elements for any key type.
1068
+ #
1053
1069
  # <note markdown="1"> KMS is replacing the term *customer master key (CMK)* with *KMS key*
1054
1070
  # and *KMS key*. The concept has not changed. To prevent breaking
1055
1071
  # changes, KMS is keeping some variations of this term.
1056
1072
  #
1057
1073
  # </note>
1058
1074
  #
1059
- # You can use the `CreateKey` operation to create symmetric or
1060
- # asymmetric KMS keys.
1075
+ # To create different types of KMS keys, use the following guidance:
1061
1076
  #
1062
- # * **Symmetric KMS keys** contain a 256-bit symmetric key that never
1063
- # leaves KMS unencrypted. To use the KMS key, you must call KMS. You
1064
- # can use a symmetric KMS key to encrypt and decrypt small amounts of
1065
- # data, but they are typically used to generate [data keys][2] and
1066
- # [data keys pairs][3]. For details, see GenerateDataKey and
1067
- # GenerateDataKeyPair.
1077
+ # Symmetric encryption KMS key
1068
1078
  #
1069
- # * **Asymmetric KMS keys** can contain an RSA key pair or an Elliptic
1070
- # Curve (ECC) key pair. The private key in an asymmetric KMS key never
1071
- # leaves KMS unencrypted. However, you can use the GetPublicKey
1072
- # operation to download the public key so it can be used outside of
1073
- # KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt
1074
- # data or sign and verify messages (but not both). KMS keys with ECC
1075
- # key pairs can be used only to sign and verify messages.
1079
+ # : To create a symmetric encryption KMS key, you aren't required to
1080
+ # specify any parameters. The default value for `KeySpec`,
1081
+ # `SYMMETRIC_DEFAULT`, and the default value for `KeyUsage`,
1082
+ # `ENCRYPT_DECRYPT`, create a symmetric encryption KMS key. For
1083
+ # technical details, see [ SYMMETRIC\_DEFAULT key spec][2] in the *Key
1084
+ # Management Service Developer Guide*.
1085
+ #
1086
+ # If you need a key for basic encryption and decryption or you are
1087
+ # creating a KMS key to protect your resources in an Amazon Web
1088
+ # Services service, create a symmetric encryption KMS key. The key
1089
+ # material in a symmetric encryption key never leaves KMS unencrypted.
1090
+ # You can use a symmetric encryption KMS key to encrypt and decrypt
1091
+ # data up to 4,096 bytes, but they are typically used to generate data
1092
+ # keys and data keys pairs. For details, see GenerateDataKey and
1093
+ # GenerateDataKeyPair.
1076
1094
  #
1077
- # For information about symmetric and asymmetric KMS keys, see [Using
1078
- # Symmetric and Asymmetric KMS keys][4] in the *Key Management Service
1079
- # Developer Guide*.
1080
1095
  #
1081
- # To create different types of KMS keys, use the following guidance:
1082
1096
  #
1083
1097
  # Asymmetric KMS keys
1084
1098
  #
@@ -1088,14 +1102,38 @@ module Aws::KMS
1088
1102
  # to encrypt and decrypt or sign and verify. You can't change these
1089
1103
  # properties after the KMS key is created.
1090
1104
  #
1105
+ # Asymmetric KMS keys contain an RSA key pair, Elliptic Curve (ECC)
1106
+ # key pair, or an SM2 key pair (China Regions only). The private key
1107
+ # in an asymmetric KMS key never leaves KMS unencrypted. However, you
1108
+ # can use the GetPublicKey operation to download the public key so it
1109
+ # can be used outside of KMS. KMS keys with RSA or SM2 key pairs can
1110
+ # be used to encrypt or decrypt data or sign and verify messages (but
1111
+ # not both). KMS keys with ECC key pairs can be used only to sign and
1112
+ # verify messages. For information about asymmetric KMS keys, see
1113
+ # [Asymmetric KMS keys][3] in the *Key Management Service Developer
1114
+ # Guide*.
1091
1115
  #
1092
1116
  #
1093
- # Symmetric KMS keys
1094
1117
  #
1095
- # : When creating a symmetric KMS key, you don't need to specify the
1096
- # `KeySpec` or `KeyUsage` parameters. The default value for `KeySpec`,
1097
- # `SYMMETRIC_DEFAULT`, and the default value for `KeyUsage`,
1098
- # `ENCRYPT_DECRYPT`, are the only valid values for symmetric KMS keys.
1118
+ # HMAC KMS key
1119
+ #
1120
+ # : To create an HMAC KMS key, set the `KeySpec` parameter to a key spec
1121
+ # value for HMAC KMS keys. Then set the `KeyUsage` parameter to
1122
+ # `GENERATE_VERIFY_MAC`. You must set the key usage even though
1123
+ # `GENERATE_VERIFY_MAC` is the only valid key usage value for HMAC KMS
1124
+ # keys. You can't change these properties after the KMS key is
1125
+ # created.
1126
+ #
1127
+ # HMAC KMS keys are symmetric keys that never leave KMS unencrypted.
1128
+ # You can use HMAC keys to generate (GenerateMac) and verify
1129
+ # (VerifyMac) HMAC codes for messages up to 4096 bytes.
1130
+ #
1131
+ # HMAC KMS keys are not supported in all Amazon Web Services Regions.
1132
+ # If you try to create an HMAC KMS key in an Amazon Web Services
1133
+ # Region in which HMAC keys are not supported, the `CreateKey`
1134
+ # operation returns an `UnsupportedOperationException`. For a list of
1135
+ # Regions in which HMAC KMS keys are supported, see [HMAC keys in
1136
+ # KMS][4] in the *Key Management Service Developer Guide*.
1099
1137
  #
1100
1138
  #
1101
1139
  #
@@ -1110,6 +1148,12 @@ module Aws::KMS
1110
1148
  # operation. To change a replica key to a primary key, and its primary
1111
1149
  # key to a replica key, use the UpdatePrimaryRegion operation.
1112
1150
  #
1151
+ # You can create multi-Region KMS keys for all supported KMS key
1152
+ # types: symmetric encryption KMS keys, HMAC KMS keys, asymmetric
1153
+ # encryption KMS keys, and asymmetric signing KMS keys. You can also
1154
+ # create multi-Region keys with imported key material. However, you
1155
+ # can't create multi-Region keys in a custom key store.
1156
+ #
1113
1157
  # This operation supports *multi-Region keys*, an KMS feature that
1114
1158
  # lets you create multiple interoperable KMS keys in different Amazon
1115
1159
  # Web Services Regions. Because these KMS keys have the same key ID,
@@ -1117,49 +1161,49 @@ module Aws::KMS
1117
1161
  # to encrypt data in one Amazon Web Services Region and decrypt it in
1118
1162
  # a different Amazon Web Services Region without re-encrypting the
1119
1163
  # data or making a cross-Region call. For more information about
1120
- # multi-Region keys, see [Using multi-Region keys][5] in the *Key
1164
+ # multi-Region keys, see [Multi-Region keys in KMS][5] in the *Key
1121
1165
  # Management Service Developer Guide*.
1122
1166
  #
1123
- # You can create symmetric and asymmetric multi-Region keys and
1124
- # multi-Region keys with imported key material. You cannot create
1125
- # multi-Region keys in a custom key store.
1126
- #
1127
1167
  #
1128
1168
  #
1129
- # : To import your own key material, begin by creating a symmetric KMS
1130
- # key with no key material. To do this, use the `Origin` parameter of
1131
- # `CreateKey` with a value of `EXTERNAL`. Next, use
1132
- # GetParametersForImport operation to get a public key and import
1169
+ # : To import your own key material, begin by creating a symmetric
1170
+ # encryption KMS key with no key material. To do this, use the
1171
+ # `Origin` parameter of `CreateKey` with a value of `EXTERNAL`. Next,
1172
+ # use GetParametersForImport operation to get a public key and import
1133
1173
  # token, and use the public key to encrypt your key material. Then,
1134
1174
  # use ImportKeyMaterial with your import token to import the key
1135
1175
  # material. For step-by-step instructions, see [Importing Key
1136
1176
  # Material][6] in the <i> <i>Key Management Service Developer
1137
- # Guide</i> </i>. You cannot import the key material into an
1138
- # asymmetric KMS key.
1177
+ # Guide</i> </i>.
1178
+ #
1179
+ # This feature supports only symmetric encryption KMS keys, including
1180
+ # multi-Region symmetric encryption KMS keys. You cannot import key
1181
+ # material into any other type of KMS key.
1139
1182
  #
1140
1183
  # To create a multi-Region primary key with imported key material, use
1141
1184
  # the `Origin` parameter of `CreateKey` with a value of `EXTERNAL` and
1142
1185
  # the `MultiRegion` parameter with a value of `True`. To create
1143
1186
  # replicas of the multi-Region primary key, use the ReplicateKey
1144
- # operation. For more information about multi-Region keys, see [Using
1145
- # multi-Region keys][5] in the *Key Management Service Developer
1146
- # Guide*.
1187
+ # operation. For more information about multi-Region keys, see
1188
+ # [Multi-Region keys in KMS][5] in the *Key Management Service
1189
+ # Developer Guide*.
1147
1190
  #
1148
1191
  #
1149
1192
  #
1150
1193
  # Custom key store
1151
1194
  #
1152
- # : To create a symmetric KMS key in a [custom key store][7], use the
1153
- # `CustomKeyStoreId` parameter to specify the custom key store. You
1154
- # must also use the `Origin` parameter with a value of `AWS_CLOUDHSM`.
1155
- # The CloudHSM cluster that is associated with the custom key store
1156
- # must have at least two active HSMs in different Availability Zones
1157
- # in the Amazon Web Services Region.
1195
+ # : To create a symmetric encryption KMS key in a [custom key store][7],
1196
+ # use the `CustomKeyStoreId` parameter to specify the custom key
1197
+ # store. You must also use the `Origin` parameter with a value of
1198
+ # `AWS_CLOUDHSM`. The CloudHSM cluster that is associated with the
1199
+ # custom key store must have at least two active HSMs in different
1200
+ # Availability Zones in the Amazon Web Services Region.
1158
1201
  #
1159
- # You cannot create an asymmetric KMS key in a custom key store. For
1160
- # information about custom key stores in KMS see [Using Custom Key
1161
- # Stores][7] in the <i> <i>Key Management Service Developer Guide</i>
1162
- # </i>.
1202
+ # Custom key stores support only symmetric encryption KMS keys. You
1203
+ # cannot create an HMAC KMS key or an asymmetric KMS key in a custom
1204
+ # key store. For information about custom key stores in KMS see
1205
+ # [Custom key stores in KMS][7] in the <i> <i>Key Management Service
1206
+ # Developer Guide</i> </i>.
1163
1207
  #
1164
1208
  # **Cross-account use**\: No. You cannot use this operation to create a
1165
1209
  # KMS key in a different Amazon Web Services account.
@@ -1180,9 +1224,9 @@ module Aws::KMS
1180
1224
  #
1181
1225
  #
1182
1226
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys
1183
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
1184
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs
1185
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1227
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-symmetric-default
1228
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1229
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
1186
1230
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
1187
1231
  # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
1188
1232
  # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
@@ -1190,16 +1234,19 @@ module Aws::KMS
1190
1234
  # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key
1191
1235
  #
1192
1236
  # @option params [String] :policy
1193
- # The key policy to attach to the KMS key.
1237
+ # The key policy to attach to the KMS key. If you do not specify a key
1238
+ # policy, KMS attaches a default key policy to the KMS key. For more
1239
+ # information, see [Default key policy][1] in the *Key Management
1240
+ # Service Developer Guide*.
1194
1241
  #
1195
1242
  # If you provide a key policy, it must meet the following criteria:
1196
1243
  #
1197
- # * If you don't set `BypassPolicyLockoutSafetyCheck` to true, the key
1198
- # policy must allow the principal that is making the `CreateKey`
1244
+ # * If you don't set `BypassPolicyLockoutSafetyCheck` to `True`, the
1245
+ # key policy must allow the principal that is making the `CreateKey`
1199
1246
  # request to make a subsequent PutKeyPolicy request on the KMS key.
1200
1247
  # This reduces the risk that the KMS key becomes unmanageable. For
1201
1248
  # more information, refer to the scenario in the [Default Key
1202
- # Policy][1] section of the <i> <i>Key Management Service Developer
1249
+ # Policy][2] section of the <i> <i>Key Management Service Developer
1203
1250
  # Guide</i> </i>.
1204
1251
  #
1205
1252
  # * Each statement in the key policy must contain one or more
@@ -1209,25 +1256,33 @@ module Aws::KMS
1209
1256
  # delay before including the new principal in a key policy because the
1210
1257
  # new principal might not be immediately visible to KMS. For more
1211
1258
  # information, see [Changes that I make are not always immediately
1212
- # visible][2] in the *Amazon Web Services Identity and Access
1259
+ # visible][3] in the *Amazon Web Services Identity and Access
1213
1260
  # Management User Guide*.
1214
1261
  #
1215
- # If you do not provide a key policy, KMS attaches a default key policy
1216
- # to the KMS key. For more information, see [Default Key Policy][3] in
1217
- # the *Key Management Service Developer Guide*.
1262
+ # A key policy document can include only the following characters:
1263
+ #
1264
+ # * Printable ASCII characters from the space character (`\u0020`)
1265
+ # through the end of the ASCII character range.
1218
1266
  #
1219
- # The key policy size quota is 32 kilobytes (32768 bytes).
1267
+ # * Printable characters in the Basic Latin and Latin-1 Supplement
1268
+ # character set (through `\u00FF`).
1220
1269
  #
1221
- # For help writing and formatting a JSON policy document, see the [IAM
1222
- # JSON Policy Reference][4] in the <i> <i>Identity and Access Management
1223
- # User Guide</i> </i>.
1270
+ # * The tab (`\u0009`), line feed (`\u000A`), and carriage return
1271
+ # (`\u000D`) special characters
1224
1272
  #
1273
+ # For information about key policies, see [Key policies in KMS][4] in
1274
+ # the *Key Management Service Developer Guide*. For help writing and
1275
+ # formatting a JSON policy document, see the [IAM JSON Policy
1276
+ # Reference][5] in the <i> <i>Identity and Access Management User
1277
+ # Guide</i> </i>.
1225
1278
  #
1226
1279
  #
1227
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
1228
- # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
1229
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
1230
- # [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
1280
+ #
1281
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
1282
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
1283
+ # [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
1284
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
1285
+ # [5]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
1231
1286
  #
1232
1287
  # @option params [String] :description
1233
1288
  # A description of the KMS key.
@@ -1242,20 +1297,26 @@ module Aws::KMS
1242
1297
  # @option params [String] :key_usage
1243
1298
  # Determines the [cryptographic operations][1] for which you can use the
1244
1299
  # KMS key. The default value is `ENCRYPT_DECRYPT`. This parameter is
1245
- # required only for asymmetric KMS keys. You can't change the
1246
- # `KeyUsage` value after the KMS key is created.
1300
+ # optional when you are creating a symmetric encryption KMS key;
1301
+ # otherwise, it is required. You can't change the `KeyUsage` value
1302
+ # after the KMS key is created.
1247
1303
  #
1248
1304
  # Select only one valid value.
1249
1305
  #
1250
- # * For symmetric KMS keys, omit the parameter or specify
1306
+ # * For symmetric encryption KMS keys, omit the parameter or specify
1251
1307
  # `ENCRYPT_DECRYPT`.
1252
1308
  #
1309
+ # * For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
1310
+ #
1253
1311
  # * For asymmetric KMS keys with RSA key material, specify
1254
1312
  # `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1255
1313
  #
1256
1314
  # * For asymmetric KMS keys with ECC key material, specify
1257
1315
  # `SIGN_VERIFY`.
1258
1316
  #
1317
+ # * For asymmetric KMS keys with SM2 key material (China Regions only),
1318
+ # specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1319
+ #
1259
1320
  #
1260
1321
  #
1261
1322
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations
@@ -1270,34 +1331,43 @@ module Aws::KMS
1270
1331
  #
1271
1332
  # @option params [String] :key_spec
1272
1333
  # Specifies the type of KMS key to create. The default value,
1273
- # `SYMMETRIC_DEFAULT`, creates a KMS key with a 256-bit symmetric key
1274
- # for encryption and decryption. For help choosing a key spec for your
1275
- # KMS key, see [How to Choose Your KMS key Configuration][1] in the <i>
1276
- # <i>Key Management Service Developer Guide</i> </i>.
1334
+ # `SYMMETRIC_DEFAULT`, creates a KMS key with a 256-bit AES-GCM key that
1335
+ # is used for encryption and decryption, except in China Regions, where
1336
+ # it creates a 128-bit symmetric key that uses SM4 encryption. For help
1337
+ # choosing a key spec for your KMS key, see [Choosing a KMS key type][1]
1338
+ # in the <i> <i>Key Management Service Developer Guide</i> </i>.
1277
1339
  #
1278
1340
  # The `KeySpec` determines whether the KMS key contains a symmetric key
1279
- # or an asymmetric key pair. It also determines the encryption
1280
- # algorithms or signing algorithms that the KMS key supports. You can't
1281
- # change the `KeySpec` after the KMS key is created. To further restrict
1282
- # the algorithms that can be used with the KMS key, use a condition key
1283
- # in its key policy or IAM policy. For more information, see
1284
- # [kms:EncryptionAlgorithm][2] or [kms:Signing Algorithm][3] in the <i>
1285
- # <i>Key Management Service Developer Guide</i> </i>.
1286
- #
1287
- # [Amazon Web Services services that are integrated with KMS][4] use
1288
- # symmetric KMS keys to protect your data. These services do not support
1289
- # asymmetric KMS keys. For help determining whether a KMS key is
1290
- # symmetric or asymmetric, see [Identifying Symmetric and Asymmetric KMS
1291
- # keys][5] in the *Key Management Service Developer Guide*.
1341
+ # or an asymmetric key pair. It also determines the cryptographic
1342
+ # algorithms that the KMS key supports. You can't change the `KeySpec`
1343
+ # after the KMS key is created. To further restrict the algorithms that
1344
+ # can be used with the KMS key, use a condition key in its key policy or
1345
+ # IAM policy. For more information, see [kms:EncryptionAlgorithm][2],
1346
+ # [kms:MacAlgorithm][3] or [kms:Signing Algorithm][4] in the <i> <i>Key
1347
+ # Management Service Developer Guide</i> </i>.
1348
+ #
1349
+ # [Amazon Web Services services that are integrated with KMS][5] use
1350
+ # symmetric encryption KMS keys to protect your data. These services do
1351
+ # not support asymmetric KMS keys or HMAC KMS keys.
1292
1352
  #
1293
1353
  # KMS supports the following key specs for KMS keys:
1294
1354
  #
1295
- # * Symmetric key (default)
1355
+ # * Symmetric encryption key (default)
1296
1356
  #
1297
- # * `SYMMETRIC_DEFAULT` (AES-256-GCM)
1357
+ # * `SYMMETRIC_DEFAULT`
1298
1358
  #
1299
1359
  # ^
1300
1360
  #
1361
+ # * HMAC keys (symmetric)
1362
+ #
1363
+ # * `HMAC_224`
1364
+ #
1365
+ # * `HMAC_256`
1366
+ #
1367
+ # * `HMAC_384`
1368
+ #
1369
+ # * `HMAC_512`
1370
+ #
1301
1371
  # * Asymmetric RSA key pairs
1302
1372
  #
1303
1373
  # * `RSA_2048`
@@ -1320,13 +1390,19 @@ module Aws::KMS
1320
1390
  #
1321
1391
  # ^
1322
1392
  #
1393
+ # * SM2 key pairs (China Regions only)
1394
+ #
1395
+ # * `SM2`
1396
+ #
1397
+ # ^
1398
+ #
1323
1399
  #
1324
1400
  #
1325
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html
1401
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose
1326
1402
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm
1327
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1328
- # [4]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1329
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html
1403
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-mac-algorithm
1404
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1405
+ # [5]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1330
1406
  #
1331
1407
  # @option params [String] :origin
1332
1408
  # The source of the key material for the KMS key. You cannot change the
@@ -1337,13 +1413,13 @@ module Aws::KMS
1337
1413
  # set the value to `EXTERNAL`. For more information about importing key
1338
1414
  # material into KMS, see [Importing Key Material][1] in the *Key
1339
1415
  # Management Service Developer Guide*. This value is valid only for
1340
- # symmetric KMS keys.
1416
+ # symmetric encryption KMS keys.
1341
1417
  #
1342
1418
  # To create a KMS key in an KMS [custom key store][2] and create its key
1343
1419
  # material in the associated CloudHSM cluster, set this value to
1344
1420
  # `AWS_CLOUDHSM`. You must also use the `CustomKeyStoreId` parameter to
1345
1421
  # identify the custom key store. This value is valid only for symmetric
1346
- # KMS keys.
1422
+ # encryption KMS keys.
1347
1423
  #
1348
1424
  #
1349
1425
  #
@@ -1358,9 +1434,9 @@ module Aws::KMS
1358
1434
  # the custom key store must have at least two active HSMs, each in a
1359
1435
  # different Availability Zone in the Region.
1360
1436
  #
1361
- # This parameter is valid only for symmetric KMS keys and regional KMS
1362
- # keys. You cannot create an asymmetric KMS key or a multi-Region key in
1363
- # a custom key store.
1437
+ # This parameter is valid only for symmetric encryption KMS keys in a
1438
+ # single Region. You cannot create any other type of KMS key in a custom
1439
+ # key store.
1364
1440
  #
1365
1441
  # To find the ID of a custom key store, use the DescribeCustomKeyStores
1366
1442
  # operation.
@@ -1368,7 +1444,7 @@ module Aws::KMS
1368
1444
  # The response includes the custom key store ID and the ID of the
1369
1445
  # CloudHSM cluster.
1370
1446
  #
1371
- # This operation is part of the [Custom Key Store feature][1] feature in
1447
+ # This operation is part of the [custom key store feature][1] feature in
1372
1448
  # KMS, which combines the convenience and extensive integration of KMS
1373
1449
  # with the isolation and control of a single-tenant key store.
1374
1450
  #
@@ -1403,8 +1479,8 @@ module Aws::KMS
1403
1479
  # TagResource operation.
1404
1480
  #
1405
1481
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
1406
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
1407
- # Service Developer Guide*.
1482
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
1483
+ # Developer Guide*.
1408
1484
  #
1409
1485
  # </note>
1410
1486
  #
@@ -1444,15 +1520,16 @@ module Aws::KMS
1444
1520
  # encrypt data in one Amazon Web Services Region and decrypt it in a
1445
1521
  # different Amazon Web Services Region without re-encrypting the data or
1446
1522
  # making a cross-Region call. For more information about multi-Region
1447
- # keys, see [Using multi-Region keys][1] in the *Key Management Service
1523
+ # keys, see [Multi-Region keys in KMS][1] in the *Key Management Service
1448
1524
  # Developer Guide*.
1449
1525
  #
1450
1526
  # This value creates a *primary key*, not a replica. To create a
1451
1527
  # *replica key*, use the ReplicateKey operation.
1452
1528
  #
1453
- # You can create a symmetric or asymmetric multi-Region key, and you can
1454
- # create a multi-Region key with imported key material. However, you
1455
- # cannot create a multi-Region key in a custom key store.
1529
+ # You can create a multi-Region version of a symmetric encryption KMS
1530
+ # key, an HMAC KMS key, an asymmetric KMS key, or a KMS key with
1531
+ # imported key material. However, you cannot create a multi-Region key
1532
+ # in a custom key store.
1456
1533
  #
1457
1534
  #
1458
1535
  #
@@ -1665,14 +1742,46 @@ module Aws::KMS
1665
1742
  # }, # Detailed information about the KMS key that this operation creates.
1666
1743
  # }
1667
1744
  #
1745
+ # @example Example: To create an HMAC KMS key
1746
+ #
1747
+ # # This example creates a 384-bit symmetric HMAC KMS key. The GENERATE_VERIFY_MAC key usage value is required even though
1748
+ # # it's the only valid value for HMAC KMS keys. The key spec and key usage can't be changed after the key is created.
1749
+ #
1750
+ # resp = client.create_key({
1751
+ # key_spec: "HMAC_384", # Describes the type of key material in the KMS key.
1752
+ # key_usage: "GENERATE_VERIFY_MAC", # The cryptographic operations for which you can use the KMS key.
1753
+ # })
1754
+ #
1755
+ # resp.to_h outputs the following:
1756
+ # {
1757
+ # key_metadata: {
1758
+ # aws_account_id: "111122223333",
1759
+ # arn: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
1760
+ # creation_date: Time.parse("2022-04-05T14:04:55-07:00"),
1761
+ # customer_master_key_spec: "HMAC_384",
1762
+ # description: "",
1763
+ # enabled: true,
1764
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
1765
+ # key_manager: "CUSTOMER",
1766
+ # key_spec: "HMAC_384",
1767
+ # key_state: "Enabled",
1768
+ # key_usage: "GENERATE_VERIFY_MAC",
1769
+ # mac_algorithms: [
1770
+ # "HMAC_SHA_384",
1771
+ # ],
1772
+ # multi_region: false,
1773
+ # origin: "AWS_KMS",
1774
+ # }, # Detailed information about the KMS key that this operation creates.
1775
+ # }
1776
+ #
1668
1777
  # @example Request syntax with placeholder values
1669
1778
  #
1670
1779
  # resp = client.create_key({
1671
1780
  # policy: "PolicyType",
1672
1781
  # description: "DescriptionType",
1673
- # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT
1674
- # 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
1675
- # 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
1782
+ # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
1783
+ # 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, HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
1784
+ # 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, HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
1676
1785
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM
1677
1786
  # custom_key_store_id: "CustomKeyStoreIdType",
1678
1787
  # bypass_policy_lockout_safety_check: false,
@@ -1693,7 +1802,7 @@ module Aws::KMS
1693
1802
  # resp.key_metadata.creation_date #=> Time
1694
1803
  # resp.key_metadata.enabled #=> Boolean
1695
1804
  # resp.key_metadata.description #=> String
1696
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
1805
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
1697
1806
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
1698
1807
  # resp.key_metadata.deletion_date #=> Time
1699
1808
  # resp.key_metadata.valid_to #=> Time
@@ -1702,12 +1811,12 @@ module Aws::KMS
1702
1811
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
1703
1812
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
1704
1813
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
1705
- # 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"
1706
- # resp.key_metadata.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"
1814
+ # 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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
1815
+ # resp.key_metadata.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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
1707
1816
  # resp.key_metadata.encryption_algorithms #=> Array
1708
- # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1817
+ # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
1709
1818
  # resp.key_metadata.signing_algorithms #=> Array
1710
- # 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"
1819
+ # 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", "SM2DSA"
1711
1820
  # resp.key_metadata.multi_region #=> Boolean
1712
1821
  # resp.key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
1713
1822
  # resp.key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -1716,6 +1825,8 @@ module Aws::KMS
1716
1825
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
1717
1826
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
1718
1827
  # resp.key_metadata.pending_deletion_window_in_days #=> Integer
1828
+ # resp.key_metadata.mac_algorithms #=> Array
1829
+ # resp.key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
1719
1830
  #
1720
1831
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey AWS API Documentation
1721
1832
  #
@@ -1740,29 +1851,30 @@ module Aws::KMS
1740
1851
  # * GenerateDataKeyPairWithoutPlaintext
1741
1852
  #
1742
1853
  # You can use this operation to decrypt ciphertext that was encrypted
1743
- # under a symmetric or asymmetric KMS key. When the KMS key is
1744
- # asymmetric, you must specify the KMS key and the encryption algorithm
1745
- # that was used to encrypt the ciphertext. For information about
1746
- # symmetric and asymmetric KMS keys, see [Using Symmetric and Asymmetric
1747
- # KMS keys][1] in the *Key Management Service Developer Guide*.
1854
+ # under a symmetric encryption KMS key or an asymmetric encryption KMS
1855
+ # key. When the KMS key is asymmetric, you must specify the KMS key and
1856
+ # the encryption algorithm that was used to encrypt the ciphertext. For
1857
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
1858
+ # the *Key Management Service Developer Guide*.
1748
1859
  #
1749
- # The Decrypt operation also decrypts ciphertext that was encrypted
1860
+ # The `Decrypt` operation also decrypts ciphertext that was encrypted
1750
1861
  # outside of KMS by the public key in an KMS asymmetric KMS key.
1751
1862
  # However, it cannot decrypt ciphertext produced by other libraries,
1752
1863
  # such as the [Amazon Web Services Encryption SDK][2] or [Amazon S3
1753
1864
  # client-side encryption][3]. These libraries return a ciphertext format
1754
1865
  # that is incompatible with KMS.
1755
1866
  #
1756
- # If the ciphertext was encrypted under a symmetric KMS key, the `KeyId`
1757
- # parameter is optional. KMS can get this information from metadata that
1758
- # it adds to the symmetric ciphertext blob. This feature adds durability
1759
- # to your implementation by ensuring that authorized users can decrypt
1760
- # ciphertext decades after it was encrypted, even if they've lost track
1761
- # of the key ID. However, specifying the KMS key is always recommended
1762
- # as a best practice. When you use the `KeyId` parameter to specify a
1763
- # KMS key, KMS only uses the KMS key you specify. If the ciphertext was
1764
- # encrypted under a different KMS key, the `Decrypt` operation fails.
1765
- # This practice ensures that you use the KMS key that you intend.
1867
+ # If the ciphertext was encrypted under a symmetric encryption KMS key,
1868
+ # the `KeyId` parameter is optional. KMS can get this information from
1869
+ # metadata that it adds to the symmetric ciphertext blob. This feature
1870
+ # adds durability to your implementation by ensuring that authorized
1871
+ # users can decrypt ciphertext decades after it was encrypted, even if
1872
+ # they've lost track of the key ID. However, specifying the KMS key is
1873
+ # always recommended as a best practice. When you use the `KeyId`
1874
+ # parameter to specify a KMS key, KMS only uses the KMS key you specify.
1875
+ # If the ciphertext was encrypted under a different KMS key, the
1876
+ # `Decrypt` operation fails. This practice ensures that you use the KMS
1877
+ # key that you intend.
1766
1878
  #
1767
1879
  # Whenever possible, use key policies to give users permission to call
1768
1880
  # the `Decrypt` operation on a particular KMS key, instead of using IAM
@@ -1781,8 +1893,8 @@ module Aws::KMS
1781
1893
  # Service Developer Guide*.
1782
1894
  #
1783
1895
  # The KMS key that you use for this operation must be in a compatible
1784
- # key state. For details, see [Key state: Effect on your KMS key][7] in
1785
- # the *Key Management Service Developer Guide*.
1896
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
1897
+ # Management Service Developer Guide*.
1786
1898
  #
1787
1899
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
1788
1900
  # in a different Amazon Web Services account, specify the key ARN or
@@ -1817,17 +1929,19 @@ module Aws::KMS
1817
1929
  # @option params [Hash<String,String>] :encryption_context
1818
1930
  # Specifies the encryption context to use when decrypting the data. An
1819
1931
  # encryption context is valid only for [cryptographic operations][1]
1820
- # with a symmetric KMS key. The standard asymmetric encryption
1821
- # algorithms that KMS uses do not support an encryption context.
1932
+ # with a symmetric encryption KMS key. The standard asymmetric
1933
+ # encryption algorithms and HMAC algorithms that KMS uses do not support
1934
+ # an encryption context.
1822
1935
  #
1823
1936
  # An *encryption context* is a collection of non-secret key-value pairs
1824
- # that represents additional authenticated data. When you use an
1937
+ # that represent additional authenticated data. When you use an
1825
1938
  # encryption context to encrypt data, you must specify the same (an
1826
1939
  # exact case-sensitive match) encryption context to decrypt the data. An
1827
- # encryption context is optional when encrypting with a symmetric KMS
1828
- # key, but it is highly recommended.
1940
+ # encryption context is supported only on operations with symmetric
1941
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
1942
+ # an encryption context is optional, but it is strongly recommended.
1829
1943
  #
1830
- # For more information, see [Encryption Context][2] in the *Key
1944
+ # For more information, see [Encryption context][2] in the *Key
1831
1945
  # Management Service Developer Guide*.
1832
1946
  #
1833
1947
  #
@@ -1849,14 +1963,18 @@ module Aws::KMS
1849
1963
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
1850
1964
  #
1851
1965
  # @option params [String] :key_id
1852
- # Specifies the KMS key that KMS uses to decrypt the ciphertext. Enter a
1853
- # key ID of the KMS key that was used to encrypt the ciphertext.
1966
+ # Specifies the KMS key that KMS uses to decrypt the ciphertext.
1967
+ #
1968
+ # Enter a key ID of the KMS key that was used to encrypt the ciphertext.
1969
+ # If you identify a different KMS key, the `Decrypt` operation throws an
1970
+ # `IncorrectKeyException`.
1854
1971
  #
1855
1972
  # This parameter is required only when the ciphertext was encrypted
1856
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
1857
- # get the KMS key from metadata that it adds to the symmetric ciphertext
1858
- # blob. However, it is always recommended as a best practice. This
1859
- # practice ensures that you use the KMS key that you intend.
1973
+ # under an asymmetric KMS key. If you used a symmetric encryption KMS
1974
+ # key, KMS can get the KMS key from metadata that it adds to the
1975
+ # symmetric ciphertext blob. However, it is always recommended as a best
1976
+ # practice. This practice ensures that you use the KMS key that you
1977
+ # intend.
1860
1978
  #
1861
1979
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
1862
1980
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -1886,7 +2004,7 @@ module Aws::KMS
1886
2004
  # This parameter is required only when the ciphertext was encrypted
1887
2005
  # under an asymmetric KMS key. The default value, `SYMMETRIC_DEFAULT`,
1888
2006
  # represents the only supported algorithm that is valid for symmetric
1889
- # KMS keys.
2007
+ # encryption KMS keys.
1890
2008
  #
1891
2009
  # @return [Types::DecryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1892
2010
  #
@@ -1919,14 +2037,14 @@ module Aws::KMS
1919
2037
  # },
1920
2038
  # grant_tokens: ["GrantTokenType"],
1921
2039
  # key_id: "KeyIdType",
1922
- # encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
2040
+ # encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, SM2PKE
1923
2041
  # })
1924
2042
  #
1925
2043
  # @example Response structure
1926
2044
  #
1927
2045
  # resp.key_id #=> String
1928
2046
  # resp.plaintext #=> String
1929
- # resp.encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
2047
+ # resp.encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
1930
2048
  #
1931
2049
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt AWS API Documentation
1932
2050
  #
@@ -1940,8 +2058,8 @@ module Aws::KMS
1940
2058
  # Deletes the specified alias.
1941
2059
  #
1942
2060
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
1943
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
1944
- # Management Service Developer Guide*.
2061
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
2062
+ # Service Developer Guide*.
1945
2063
  #
1946
2064
  # </note>
1947
2065
  #
@@ -2015,15 +2133,15 @@ module Aws::KMS
2015
2133
  # CloudHSM cluster that is associated with the custom key store, or
2016
2134
  # affect any users or keys in the cluster.
2017
2135
  #
2018
- # The custom key store that you delete cannot contain any KMS [KMS
2019
- # keys][2]. Before deleting the key store, verify that you will never
2020
- # need to use any of the KMS keys in the key store for any
2021
- # [cryptographic operations][3]. Then, use ScheduleKeyDeletion to delete
2022
- # the KMS keys from the key store. When the scheduled waiting period
2023
- # expires, the `ScheduleKeyDeletion` operation deletes the KMS keys.
2024
- # Then it makes a best effort to delete the key material from the
2025
- # associated cluster. However, you might need to manually [delete the
2026
- # orphaned key material][4] from the cluster and its backups.
2136
+ # The custom key store that you delete cannot contain any [KMS keys][2].
2137
+ # Before deleting the key store, verify that you will never need to use
2138
+ # any of the KMS keys in the key store for any [cryptographic
2139
+ # operations][3]. Then, use ScheduleKeyDeletion to delete the KMS keys
2140
+ # from the key store. When the scheduled waiting period expires, the
2141
+ # `ScheduleKeyDeletion` operation deletes the KMS keys. Then it makes a
2142
+ # best effort to delete the key material from the associated cluster.
2143
+ # However, you might need to manually [delete the orphaned key
2144
+ # material][4] from the cluster and its backups.
2027
2145
  #
2028
2146
  # After all KMS keys are deleted from KMS, use DisconnectCustomKeyStore
2029
2147
  # to disconnect the key store from KMS. Then, you can delete the custom
@@ -2038,7 +2156,7 @@ module Aws::KMS
2038
2156
  # If the operation succeeds, it returns a JSON object with no
2039
2157
  # properties.
2040
2158
  #
2041
- # This operation is part of the [Custom Key Store feature][1] feature in
2159
+ # This operation is part of the [custom key store feature][1] feature in
2042
2160
  # KMS, which combines the convenience and extensive integration of KMS
2043
2161
  # with the isolation and control of a single-tenant key store.
2044
2162
  #
@@ -2116,8 +2234,8 @@ module Aws::KMS
2116
2234
  # reimport the same key material into the KMS key.
2117
2235
  #
2118
2236
  # The KMS key that you use for this operation must be in a compatible
2119
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2120
- # the *Key Management Service Developer Guide*.
2237
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2238
+ # Management Service Developer Guide*.
2121
2239
  #
2122
2240
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2123
2241
  # key in a different Amazon Web Services account.
@@ -2182,7 +2300,7 @@ module Aws::KMS
2182
2300
  # Gets information about [custom key stores][1] in the account and
2183
2301
  # Region.
2184
2302
  #
2185
- # This operation is part of the [Custom Key Store feature][1] feature in
2303
+ # This operation is part of the [custom key store feature][1] feature in
2186
2304
  # KMS, which combines the convenience and extensive integration of KMS
2187
2305
  # with the isolation and control of a single-tenant key store.
2188
2306
  #
@@ -2267,6 +2385,8 @@ module Aws::KMS
2267
2385
  # * {Types::DescribeCustomKeyStoresResponse#next_marker #next_marker} => String
2268
2386
  # * {Types::DescribeCustomKeyStoresResponse#truncated #truncated} => Boolean
2269
2387
  #
2388
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
2389
+ #
2270
2390
  #
2271
2391
  # @example Example: To get detailed information about custom key stores in the account and Region
2272
2392
  #
@@ -2322,7 +2442,7 @@ module Aws::KMS
2322
2442
  # resp.custom_key_stores[0].cloud_hsm_cluster_id #=> String
2323
2443
  # resp.custom_key_stores[0].trust_anchor_certificate #=> String
2324
2444
  # resp.custom_key_stores[0].connection_state #=> String, one of "CONNECTED", "CONNECTING", "FAILED", "DISCONNECTED", "DISCONNECTING"
2325
- # 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", "SUBNET_NOT_FOUND"
2445
+ # 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", "SUBNET_NOT_FOUND", "INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET"
2326
2446
  # resp.custom_key_stores[0].creation_date #=> Time
2327
2447
  # resp.next_marker #=> String
2328
2448
  # resp.truncated #=> Boolean
@@ -2343,14 +2463,13 @@ module Aws::KMS
2343
2463
  # This detailed information includes the key ARN, creation date (and
2344
2464
  # deletion date, if applicable), the key state, and the origin and
2345
2465
  # expiration date (if any) of the key material. It includes fields, like
2346
- # `KeySpec`, that help you distinguish symmetric from asymmetric KMS
2347
- # keys. It also provides information that is particularly important to
2348
- # asymmetric keys, such as the key usage (encryption or signing) and the
2349
- # encryption algorithms or signing algorithms that the KMS key supports.
2350
- # For KMS keys in custom key stores, it includes information about the
2351
- # custom key store, such as the key store ID and the CloudHSM cluster
2352
- # ID. For multi-Region keys, it displays the primary key and all related
2353
- # replica keys.
2466
+ # `KeySpec`, that help you distinguish different types of KMS keys. It
2467
+ # also displays the key usage (encryption, signing, or generating and
2468
+ # verifying MACs) and the algorithms that the KMS key supports. For KMS
2469
+ # keys in custom key stores, it includes information about the custom
2470
+ # key store, such as the key store ID and the CloudHSM cluster ID. For
2471
+ # multi-Region keys, it displays the primary key and all related replica
2472
+ # keys.
2354
2473
  #
2355
2474
  # `DescribeKey` does not return the following information:
2356
2475
  #
@@ -2360,7 +2479,7 @@ module Aws::KMS
2360
2479
  # * Whether automatic key rotation is enabled on the KMS key. To get
2361
2480
  # this information, use GetKeyRotationStatus. Also, some key states
2362
2481
  # prevent a KMS key from being automatically rotated. For details, see
2363
- # [How Automatic Key Rotation Works][3] in *Key Management Service
2482
+ # [How Automatic Key Rotation Works][3] in the *Key Management Service
2364
2483
  # Developer Guide*.
2365
2484
  #
2366
2485
  # * Tags on the KMS key. To get this information, use ListResourceTags.
@@ -2368,11 +2487,10 @@ module Aws::KMS
2368
2487
  # * Key policies and grants on the KMS key. To get this information, use
2369
2488
  # GetKeyPolicy and ListGrants.
2370
2489
  #
2371
- # If you call the `DescribeKey` operation on a *predefined Amazon Web
2372
- # Services alias*, that is, an Amazon Web Services alias with no key ID,
2373
- # KMS creates an [Amazon Web Services managed key][2]. Then, it
2374
- # associates the alias with the new KMS key, and returns the `KeyId` and
2375
- # `Arn` of the new KMS key in the response.
2490
+ # In general, `DescribeKey` is a non-mutating operation. It returns data
2491
+ # about KMS keys, but doesn't change them. However, Amazon Web Services
2492
+ # services use `DescribeKey` to create [Amazon Web Services managed
2493
+ # keys][2] from a *predefined Amazon Web Services alias* with no key ID.
2376
2494
  #
2377
2495
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2378
2496
  # in a different Amazon Web Services account, specify the key ARN or
@@ -2454,10 +2572,10 @@ module Aws::KMS
2454
2572
  #
2455
2573
  # @example Example: To get details about a KMS key
2456
2574
  #
2457
- # # The following example gets metadata about a symmetric KMS key.
2575
+ # # The following example gets metadata for a symmetric encryption KMS key.
2458
2576
  #
2459
2577
  # resp = client.describe_key({
2460
- # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key that you want information about. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
2578
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # An identifier for the KMS key. You can use the key ID, key ARN, alias name, alias ARN of the KMS key.
2461
2579
  # })
2462
2580
  #
2463
2581
  # resp.to_h outputs the following:
@@ -2482,6 +2600,121 @@ module Aws::KMS
2482
2600
  # }, # An object that contains information about the specified KMS key.
2483
2601
  # }
2484
2602
  #
2603
+ # @example Example: To get details about an RSA asymmetric KMS key
2604
+ #
2605
+ # # The following example gets metadata for an asymmetric RSA KMS key used for signing and verification.
2606
+ #
2607
+ # resp = client.describe_key({
2608
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # An identifier for the KMS key. You can use the key ID, key ARN, alias name, alias ARN of the KMS key.
2609
+ # })
2610
+ #
2611
+ # resp.to_h outputs the following:
2612
+ # {
2613
+ # key_metadata: {
2614
+ # aws_account_id: "111122223333",
2615
+ # arn: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
2616
+ # creation_date: Time.parse(1571767572.317),
2617
+ # customer_master_key_spec: "RSA_2048",
2618
+ # description: "",
2619
+ # enabled: false,
2620
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
2621
+ # key_manager: "CUSTOMER",
2622
+ # key_spec: "RSA_2048",
2623
+ # key_state: "Disabled",
2624
+ # key_usage: "SIGN_VERIFY",
2625
+ # multi_region: false,
2626
+ # origin: "AWS_KMS",
2627
+ # signing_algorithms: [
2628
+ # "RSASSA_PKCS1_V1_5_SHA_256",
2629
+ # "RSASSA_PKCS1_V1_5_SHA_384",
2630
+ # "RSASSA_PKCS1_V1_5_SHA_512",
2631
+ # "RSASSA_PSS_SHA_256",
2632
+ # "RSASSA_PSS_SHA_384",
2633
+ # "RSASSA_PSS_SHA_512",
2634
+ # ],
2635
+ # }, # An object that contains information about the specified KMS key.
2636
+ # }
2637
+ #
2638
+ # @example Example: To get details about a multi-Region key
2639
+ #
2640
+ # # The following example gets metadata for a multi-Region replica key. This multi-Region key is a symmetric encryption key.
2641
+ # # DescribeKey returns information about the primary key and all of its replicas.
2642
+ #
2643
+ # resp = client.describe_key({
2644
+ # key_id: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab", # An identifier for the KMS key. You can use the key ID, key ARN, alias name, alias ARN of the KMS key.
2645
+ # })
2646
+ #
2647
+ # resp.to_h outputs the following:
2648
+ # {
2649
+ # key_metadata: {
2650
+ # aws_account_id: "111122223333",
2651
+ # arn: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2652
+ # creation_date: Time.parse(1586329200.918),
2653
+ # customer_master_key_spec: "SYMMETRIC_DEFAULT",
2654
+ # description: "",
2655
+ # enabled: true,
2656
+ # encryption_algorithms: [
2657
+ # "SYMMETRIC_DEFAULT",
2658
+ # ],
2659
+ # key_id: "mrk-1234abcd12ab34cd56ef1234567890ab",
2660
+ # key_manager: "CUSTOMER",
2661
+ # key_state: "Enabled",
2662
+ # key_usage: "ENCRYPT_DECRYPT",
2663
+ # multi_region: true,
2664
+ # multi_region_configuration: {
2665
+ # multi_region_key_type: "PRIMARY",
2666
+ # primary_key: {
2667
+ # arn: "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2668
+ # region: "us-west-2",
2669
+ # },
2670
+ # replica_keys: [
2671
+ # {
2672
+ # arn: "arn:aws:kms:eu-west-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2673
+ # region: "eu-west-1",
2674
+ # },
2675
+ # {
2676
+ # arn: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2677
+ # region: "ap-northeast-1",
2678
+ # },
2679
+ # {
2680
+ # arn: "arn:aws:kms:sa-east-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2681
+ # region: "sa-east-1",
2682
+ # },
2683
+ # ],
2684
+ # },
2685
+ # origin: "AWS_KMS",
2686
+ # }, # An object that contains information about the specified KMS key.
2687
+ # }
2688
+ #
2689
+ # @example Example: To get details about an HMAC KMS key
2690
+ #
2691
+ # # The following example gets the metadata of an HMAC KMS key.
2692
+ #
2693
+ # resp = client.describe_key({
2694
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # An identifier for the KMS key. You can use the key ID, key ARN, alias name, alias ARN of the KMS key.
2695
+ # })
2696
+ #
2697
+ # resp.to_h outputs the following:
2698
+ # {
2699
+ # key_metadata: {
2700
+ # aws_account_id: "123456789012",
2701
+ # arn: "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
2702
+ # creation_date: Time.parse(1566160362.664),
2703
+ # customer_master_key_spec: "HMAC_256",
2704
+ # description: "Development test key",
2705
+ # enabled: true,
2706
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
2707
+ # key_manager: "CUSTOMER",
2708
+ # key_state: "Enabled",
2709
+ # key_usage: "GENERATE_VERIFY_MAC",
2710
+ # mac_algorithms: [
2711
+ # "HMAC_SHA_256",
2712
+ # ],
2713
+ # multi_region: false,
2714
+ # origin: "AWS_KMS",
2715
+ # }, # An object that contains information about the specified KMS key.
2716
+ # }
2717
+ #
2485
2718
  # @example Request syntax with placeholder values
2486
2719
  #
2487
2720
  # resp = client.describe_key({
@@ -2497,7 +2730,7 @@ module Aws::KMS
2497
2730
  # resp.key_metadata.creation_date #=> Time
2498
2731
  # resp.key_metadata.enabled #=> Boolean
2499
2732
  # resp.key_metadata.description #=> String
2500
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
2733
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
2501
2734
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
2502
2735
  # resp.key_metadata.deletion_date #=> Time
2503
2736
  # resp.key_metadata.valid_to #=> Time
@@ -2506,12 +2739,12 @@ module Aws::KMS
2506
2739
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
2507
2740
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
2508
2741
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
2509
- # 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"
2510
- # resp.key_metadata.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"
2742
+ # 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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
2743
+ # resp.key_metadata.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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
2511
2744
  # resp.key_metadata.encryption_algorithms #=> Array
2512
- # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
2745
+ # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
2513
2746
  # resp.key_metadata.signing_algorithms #=> Array
2514
- # 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"
2747
+ # 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", "SM2DSA"
2515
2748
  # resp.key_metadata.multi_region #=> Boolean
2516
2749
  # resp.key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
2517
2750
  # resp.key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -2520,6 +2753,8 @@ module Aws::KMS
2520
2753
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
2521
2754
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
2522
2755
  # resp.key_metadata.pending_deletion_window_in_days #=> Integer
2756
+ # resp.key_metadata.mac_algorithms #=> Array
2757
+ # resp.key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
2523
2758
  #
2524
2759
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey AWS API Documentation
2525
2760
  #
@@ -2534,12 +2769,12 @@ module Aws::KMS
2534
2769
  # prevents use of the KMS key for [cryptographic operations][1].
2535
2770
  #
2536
2771
  # For more information about how key state affects the use of a KMS key,
2537
- # see [Key state: Effect on your KMS key][2] in the <i> <i>Key
2538
- # Management Service Developer Guide</i> </i>.
2772
+ # see [Key states of KMS keys][2] in the <i> <i>Key Management Service
2773
+ # Developer Guide</i> </i>.
2539
2774
  #
2540
2775
  # The KMS key that you use for this operation must be in a compatible
2541
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2542
- # the *Key Management Service Developer Guide*.
2776
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2777
+ # Management Service Developer Guide*.
2543
2778
  #
2544
2779
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2545
2780
  # key in a different Amazon Web Services account.
@@ -2595,22 +2830,37 @@ module Aws::KMS
2595
2830
  req.send_request(options)
2596
2831
  end
2597
2832
 
2598
- # Disables [automatic rotation of the key material][1] for the specified
2599
- # symmetric KMS key.
2833
+ # Disables [automatic rotation of the key material][1] of the specified
2834
+ # symmetric encryption KMS key.
2835
+ #
2836
+ # Automatic key rotation is supported only on symmetric encryption KMS
2837
+ # keys. You cannot enable or disable automatic rotation of [asymmetric
2838
+ # KMS keys][2], [HMAC KMS keys][3], KMS keys with [imported key
2839
+ # material][4], or KMS keys in a [custom key store][5]. The key rotation
2840
+ # status of these KMS keys is always `false`. To enable or disable
2841
+ # automatic rotation of a set of related [multi-Region keys][6], set the
2842
+ # property on the primary key.
2843
+ #
2844
+ # You can enable (EnableKeyRotation) and disable automatic rotation of
2845
+ # the key material in [customer managed KMS keys][7]. Key material
2846
+ # rotation of [Amazon Web Services managed KMS keys][8] is not
2847
+ # configurable. KMS always rotates the key material for every year.
2848
+ # Rotation of [Amazon Web Services owned KMS keys][9] varies.
2849
+ #
2850
+ # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
2851
+ # managed keys from every three years to every year. For details, see
2852
+ # EnableKeyRotation.
2600
2853
  #
2601
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2602
- # keys with [imported key material][3], or KMS keys in a [custom key
2603
- # store][4]. To enable or disable automatic rotation of a set of related
2604
- # [multi-Region keys][5], set the property on the primary key.
2854
+ # </note>
2605
2855
  #
2606
2856
  # The KMS key that you use for this operation must be in a compatible
2607
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2608
- # the *Key Management Service Developer Guide*.
2857
+ # key state. For details, see [Key states of KMS keys][10] in the *Key
2858
+ # Management Service Developer Guide*.
2609
2859
  #
2610
2860
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2611
2861
  # key in a different Amazon Web Services account.
2612
2862
  #
2613
- # **Required permissions**\: [kms:DisableKeyRotation][7] (key policy)
2863
+ # **Required permissions**\: [kms:DisableKeyRotation][11] (key policy)
2614
2864
  #
2615
2865
  # **Related operations:**
2616
2866
  #
@@ -2621,17 +2871,22 @@ module Aws::KMS
2621
2871
  #
2622
2872
  #
2623
2873
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2624
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2625
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2626
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2627
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2628
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2629
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2874
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
2875
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
2876
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2877
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2878
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
2879
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
2880
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
2881
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
2882
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2883
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2630
2884
  #
2631
2885
  # @option params [required, String] :key_id
2632
- # Identifies a symmetric KMS key. You cannot enable or disable automatic
2633
- # rotation of [asymmetric KMS keys][1], KMS keys with [imported key
2634
- # material][2], or KMS keys in a [custom key store][3].
2886
+ # Identifies a symmetric encryption KMS key. You cannot enable or
2887
+ # disable automatic rotation of [asymmetric KMS keys][1], [HMAC KMS
2888
+ # keys][2], KMS keys with [imported key material][3], or KMS keys in a
2889
+ # [custom key store][4].
2635
2890
  #
2636
2891
  # Specify the key ID or key ARN of the KMS key.
2637
2892
  #
@@ -2648,8 +2903,9 @@ module Aws::KMS
2648
2903
  #
2649
2904
  #
2650
2905
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks
2651
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2652
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2906
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
2907
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2908
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2653
2909
  #
2654
2910
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2655
2911
  #
@@ -2699,7 +2955,7 @@ module Aws::KMS
2699
2955
  # If the operation succeeds, it returns a JSON object with no
2700
2956
  # properties.
2701
2957
  #
2702
- # This operation is part of the [Custom Key Store feature][1] feature in
2958
+ # This operation is part of the [custom key store feature][1] feature in
2703
2959
  # KMS, which combines the convenience and extensive integration of KMS
2704
2960
  # with the isolation and control of a single-tenant key store.
2705
2961
  #
@@ -2767,8 +3023,8 @@ module Aws::KMS
2767
3023
  # KMS key for [cryptographic operations][1].
2768
3024
  #
2769
3025
  # The KMS key that you use for this operation must be in a compatible
2770
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2771
- # the *Key Management Service Developer Guide*.
3026
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
3027
+ # Management Service Developer Guide*.
2772
3028
  #
2773
3029
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2774
3030
  # key in a different Amazon Web Services account.
@@ -2824,22 +3080,49 @@ module Aws::KMS
2824
3080
  req.send_request(options)
2825
3081
  end
2826
3082
 
2827
- # Enables [automatic rotation of the key material][1] for the specified
2828
- # symmetric KMS key.
3083
+ # Enables [automatic rotation of the key material][1] of the specified
3084
+ # symmetric encryption KMS key.
3085
+ #
3086
+ # When you enable automatic rotation of a[customer managed KMS key][2],
3087
+ # KMS rotates the key material of the KMS key one year (approximately
3088
+ # 365 days) from the enable date and every year thereafter. You can
3089
+ # monitor rotation of the key material for your KMS keys in CloudTrail
3090
+ # and Amazon CloudWatch. To disable rotation of the key material in a
3091
+ # customer managed KMS key, use the DisableKeyRotation operation.
3092
+ #
3093
+ # Automatic key rotation is supported only on [symmetric encryption KMS
3094
+ # keys][3]. You cannot enable or disable automatic rotation of
3095
+ # [asymmetric KMS keys][4], [HMAC KMS keys][5], KMS keys with [imported
3096
+ # key material][6], or KMS keys in a [custom key store][7]. The key
3097
+ # rotation status of these KMS keys is always `false`. To enable or
3098
+ # disable automatic rotation of a set of related [multi-Region keys][8],
3099
+ # set the property on the primary key.
3100
+ #
3101
+ # You cannot enable or disable automatic rotation [Amazon Web Services
3102
+ # managed KMS keys][9]. KMS always rotates the key material of Amazon
3103
+ # Web Services managed keys every year. Rotation of [Amazon Web Services
3104
+ # owned KMS keys][10] varies.
3105
+ #
3106
+ # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
3107
+ # managed keys from every three years (approximately 1,095 days) to
3108
+ # every year (approximately 365 days).
3109
+ #
3110
+ # New Amazon Web Services managed keys are automatically rotated one
3111
+ # year after they are created, and approximately every year thereafter.
3112
+ #
3113
+ # Existing Amazon Web Services managed keys are automatically rotated
3114
+ # one year after their most recent rotation, and every year thereafter.
2829
3115
  #
2830
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2831
- # keys with [imported key material][3], or KMS keys in a [custom key
2832
- # store][4]. To enable or disable automatic rotation of a set of related
2833
- # [multi-Region keys][5], set the property on the primary key.
3116
+ # </note>
2834
3117
  #
2835
3118
  # The KMS key that you use for this operation must be in a compatible
2836
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2837
- # the *Key Management Service Developer Guide*.
3119
+ # key state. For details, see [Key states of KMS keys][11] in the *Key
3120
+ # Management Service Developer Guide*.
2838
3121
  #
2839
3122
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2840
3123
  # key in a different Amazon Web Services account.
2841
3124
  #
2842
- # **Required permissions**\: [kms:EnableKeyRotation][7] (key policy)
3125
+ # **Required permissions**\: [kms:EnableKeyRotation][12] (key policy)
2843
3126
  #
2844
3127
  # **Related operations:**
2845
3128
  #
@@ -2850,19 +3133,25 @@ module Aws::KMS
2850
3133
  #
2851
3134
  #
2852
3135
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2853
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2854
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2855
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2856
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2857
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2858
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3136
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
3137
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
3138
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3139
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
3140
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3141
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3142
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
3143
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
3144
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
3145
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3146
+ # [12]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2859
3147
  #
2860
3148
  # @option params [required, String] :key_id
2861
- # Identifies a symmetric KMS key. You cannot enable automatic rotation
2862
- # of [asymmetric KMS keys][1], KMS keys with [imported key material][2],
2863
- # or KMS keys in a [custom key store][3]. To enable or disable automatic
2864
- # rotation of a set of related [multi-Region keys][4], set the property
2865
- # on the primary key.
3149
+ # Identifies a symmetric encryption KMS key. You cannot enable or
3150
+ # disable automatic rotation of [asymmetric KMS keys][1], [HMAC KMS
3151
+ # keys][2], KMS keys with [imported key material][3], or KMS keys in a
3152
+ # [custom key store][4]. The key rotation status of these KMS keys is
3153
+ # always `false`. To enable or disable automatic rotation of a set of
3154
+ # related [multi-Region keys][5], set the property on the primary key.
2866
3155
  #
2867
3156
  # Specify the key ID or key ARN of the KMS key.
2868
3157
  #
@@ -2878,10 +3167,11 @@ module Aws::KMS
2878
3167
  #
2879
3168
  #
2880
3169
  #
2881
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2882
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2883
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2884
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
3170
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3171
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
3172
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3173
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3174
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
2885
3175
  #
2886
3176
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2887
3177
  #
@@ -2909,41 +3199,27 @@ module Aws::KMS
2909
3199
  req.send_request(options)
2910
3200
  end
2911
3201
 
2912
- # Encrypts plaintext into ciphertext by using a KMS key. The `Encrypt`
2913
- # operation has two primary use cases:
2914
- #
2915
- # * You can encrypt small amounts of arbitrary data, such as a personal
2916
- # identifier or database password, or other sensitive information.
2917
- #
2918
- # * You can use the `Encrypt` operation to move encrypted data from one
2919
- # Amazon Web Services Region to another. For example, in Region A,
2920
- # generate a data key and use the plaintext key to encrypt your data.
2921
- # Then, in Region A, use the `Encrypt` operation to encrypt the
2922
- # plaintext data key under a KMS key in Region B. Now, you can move
2923
- # the encrypted data and the encrypted data key to Region B. When
2924
- # necessary, you can decrypt the encrypted data key and the encrypted
2925
- # data entirely within in Region B.
2926
- #
2927
- # You don't need to use the `Encrypt` operation to encrypt a data key.
2928
- # The GenerateDataKey and GenerateDataKeyPair operations return a
2929
- # plaintext data key and an encrypted copy of that data key.
2930
- #
2931
- # When you encrypt data, you must specify a symmetric or asymmetric KMS
2932
- # key to use in the encryption operation. The KMS key must have a
2933
- # `KeyUsage` value of `ENCRYPT_DECRYPT.` To find the `KeyUsage` of a KMS
2934
- # key, use the DescribeKey operation.
2935
- #
2936
- # If you use a symmetric KMS key, you can use an encryption context to
2937
- # add additional security to your encryption operation. If you specify
2938
- # an `EncryptionContext` when encrypting data, you must specify the same
2939
- # encryption context (a case-sensitive exact match) when decrypting the
2940
- # data. Otherwise, the request to decrypt fails with an
2941
- # `InvalidCiphertextException`. For more information, see [Encryption
3202
+ # Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a
3203
+ # symmetric or asymmetric KMS key with a `KeyUsage` of
3204
+ # `ENCRYPT_DECRYPT`.
3205
+ #
3206
+ # You can use this operation to encrypt small amounts of arbitrary data,
3207
+ # such as a personal identifier or database password, or other sensitive
3208
+ # information. You don't need to use the `Encrypt` operation to encrypt
3209
+ # a data key. The GenerateDataKey and GenerateDataKeyPair operations
3210
+ # return a plaintext data key and an encrypted copy of that data key.
3211
+ #
3212
+ # If you use a symmetric encryption KMS key, you can use an encryption
3213
+ # context to add additional security to your encryption operation. If
3214
+ # you specify an `EncryptionContext` when encrypting data, you must
3215
+ # specify the same encryption context (a case-sensitive exact match)
3216
+ # when decrypting the data. Otherwise, the request to decrypt fails with
3217
+ # an `InvalidCiphertextException`. For more information, see [Encryption
2942
3218
  # Context][1] in the *Key Management Service Developer Guide*.
2943
3219
  #
2944
3220
  # If you specify an asymmetric KMS key, you must also specify the
2945
3221
  # encryption algorithm. The algorithm must be compatible with the KMS
2946
- # key type.
3222
+ # key spec.
2947
3223
  #
2948
3224
  # When you use an asymmetric KMS key to encrypt or reencrypt data, be
2949
3225
  # sure to record the KMS key and encryption algorithm that you choose.
@@ -2953,15 +3229,15 @@ module Aws::KMS
2953
3229
  # fails.
2954
3230
  #
2955
3231
  # You are not required to supply the key ID and encryption algorithm
2956
- # when you decrypt with symmetric KMS keys because KMS stores this
2957
- # information in the ciphertext blob. KMS cannot store metadata in
3232
+ # when you decrypt with symmetric encryption KMS keys because KMS stores
3233
+ # this information in the ciphertext blob. KMS cannot store metadata in
2958
3234
  # ciphertext generated with asymmetric keys. The standard format for
2959
3235
  # asymmetric key ciphertext does not include configurable fields.
2960
3236
  #
2961
3237
  # The maximum size of the data that you can encrypt varies with the type
2962
3238
  # of KMS key and the encryption algorithm that you choose.
2963
3239
  #
2964
- # * Symmetric KMS keys
3240
+ # * Symmetric encryption KMS keys
2965
3241
  #
2966
3242
  # * `SYMMETRIC_DEFAULT`\: 4096 bytes
2967
3243
  #
@@ -2985,9 +3261,11 @@ module Aws::KMS
2985
3261
  #
2986
3262
  # * `RSAES_OAEP_SHA_256`\: 446 bytes
2987
3263
  #
3264
+ # * `SM2PKE`\: 1024 bytes (China Regions only)
3265
+ #
2988
3266
  # The KMS key that you use for this operation must be in a compatible
2989
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2990
- # the *Key Management Service Developer Guide*.
3267
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
3268
+ # Management Service Developer Guide*.
2991
3269
  #
2992
3270
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2993
3271
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3010,7 +3288,9 @@ module Aws::KMS
3010
3288
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3011
3289
  #
3012
3290
  # @option params [required, String] :key_id
3013
- # Identifies the KMS key to use in the encryption operation.
3291
+ # Identifies the KMS key to use in the encryption operation. The KMS key
3292
+ # must have a `KeyUsage` of `ENCRYPT_DECRYPT`. To find the `KeyUsage` of
3293
+ # a KMS key, use the DescribeKey operation.
3014
3294
  #
3015
3295
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3016
3296
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3037,18 +3317,19 @@ module Aws::KMS
3037
3317
  # @option params [Hash<String,String>] :encryption_context
3038
3318
  # Specifies the encryption context that will be used to encrypt the
3039
3319
  # data. An encryption context is valid only for [cryptographic
3040
- # operations][1] with a symmetric KMS key. The standard asymmetric
3041
- # encryption algorithms that KMS uses do not support an encryption
3042
- # context.
3320
+ # operations][1] with a symmetric encryption KMS key. The standard
3321
+ # asymmetric encryption algorithms and HMAC algorithms that KMS uses do
3322
+ # not support an encryption context.
3043
3323
  #
3044
3324
  # An *encryption context* is a collection of non-secret key-value pairs
3045
- # that represents additional authenticated data. When you use an
3325
+ # that represent additional authenticated data. When you use an
3046
3326
  # encryption context to encrypt data, you must specify the same (an
3047
3327
  # exact case-sensitive match) encryption context to decrypt the data. An
3048
- # encryption context is optional when encrypting with a symmetric KMS
3049
- # key, but it is highly recommended.
3328
+ # encryption context is supported only on operations with symmetric
3329
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3330
+ # an encryption context is optional, but it is strongly recommended.
3050
3331
  #
3051
- # For more information, see [Encryption Context][2] in the *Key
3332
+ # For more information, see [Encryption context][2] in the *Key
3052
3333
  # Management Service Developer Guide*.
3053
3334
  #
3054
3335
  #
@@ -3075,9 +3356,9 @@ module Aws::KMS
3075
3356
  # that you specify.
3076
3357
  #
3077
3358
  # This parameter is required only for asymmetric KMS keys. The default
3078
- # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric KMS
3079
- # keys. If you are using an asymmetric KMS key, we recommend
3080
- # RSAES\_OAEP\_SHA\_256.
3359
+ # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric
3360
+ # encryption KMS keys. If you are using an asymmetric KMS key, we
3361
+ # recommend RSAES\_OAEP\_SHA\_256.
3081
3362
  #
3082
3363
  # @return [Types::EncryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3083
3364
  #
@@ -3110,14 +3391,14 @@ module Aws::KMS
3110
3391
  # "EncryptionContextKey" => "EncryptionContextValue",
3111
3392
  # },
3112
3393
  # grant_tokens: ["GrantTokenType"],
3113
- # encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
3394
+ # encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, SM2PKE
3114
3395
  # })
3115
3396
  #
3116
3397
  # @example Response structure
3117
3398
  #
3118
3399
  # resp.ciphertext_blob #=> String
3119
3400
  # resp.key_id #=> String
3120
- # resp.encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
3401
+ # resp.encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
3121
3402
  #
3122
3403
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt AWS API Documentation
3123
3404
  #
@@ -3128,22 +3409,27 @@ module Aws::KMS
3128
3409
  req.send_request(options)
3129
3410
  end
3130
3411
 
3131
- # Generates a unique symmetric data key for client-side encryption. This
3412
+ # Returns a unique symmetric data key for use outside of KMS. This
3132
3413
  # operation returns a plaintext copy of the data key and a copy that is
3133
- # encrypted under a KMS key that you specify. You can use the plaintext
3134
- # key to encrypt your data outside of KMS and store the encrypted data
3135
- # key with the encrypted data.
3414
+ # encrypted under a symmetric encryption KMS key that you specify. The
3415
+ # bytes in the plaintext key are random; they are not related to the
3416
+ # caller or the KMS key. You can use the plaintext key to encrypt your
3417
+ # data outside of KMS and store the encrypted data key with the
3418
+ # encrypted data.
3419
+ #
3420
+ # To generate a data key, specify the symmetric encryption KMS key that
3421
+ # will be used to encrypt the data key. You cannot use an asymmetric KMS
3422
+ # key to encrypt data keys. To get the type of your KMS key, use the
3423
+ # DescribeKey operation.
3136
3424
  #
3137
- # `GenerateDataKey` returns a unique data key for each request. The
3138
- # bytes in the plaintext key are not related to the caller or the KMS
3139
- # key.
3425
+ # You must also specify the length of the data key. Use either the
3426
+ # `KeySpec` or `NumberOfBytes` parameters (but not both). For 128-bit
3427
+ # and 256-bit data keys, use the `KeySpec` parameter.
3140
3428
  #
3141
- # To generate a data key, specify the symmetric KMS key that will be
3142
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3143
- # generate data keys. To get the type of your KMS key, use the
3144
- # DescribeKey operation. You must also specify the length of the data
3145
- # key. Use either the `KeySpec` or `NumberOfBytes` parameters (but not
3146
- # both). For 128-bit and 256-bit data keys, use the `KeySpec` parameter.
3429
+ # To generate an SM4 data key (China Regions only), specify a `KeySpec`
3430
+ # value of `AES_128` or `NumberOfBytes` value of `128`. The symmetric
3431
+ # encryption key used in China Regions to encrypt your data key is an
3432
+ # SM4 encryption key.
3147
3433
  #
3148
3434
  # To get only an encrypted copy of the data key, use
3149
3435
  # GenerateDataKeyWithoutPlaintext. To generate an asymmetric data key
@@ -3151,7 +3437,7 @@ module Aws::KMS
3151
3437
  # GenerateDataKeyPairWithoutPlaintext operation. To get a
3152
3438
  # cryptographically secure random byte string, use GenerateRandom.
3153
3439
  #
3154
- # You can use the optional encryption context to add additional security
3440
+ # You can use an optional encryption context to add additional security
3155
3441
  # to the encryption operation. If you specify an `EncryptionContext`,
3156
3442
  # you must specify the same encryption context (a case-sensitive exact
3157
3443
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3166,8 +3452,8 @@ module Aws::KMS
3166
3452
  # Service Developer Guide*.
3167
3453
  #
3168
3454
  # The KMS key that you use for this operation must be in a compatible
3169
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3170
- # the *Key Management Service Developer Guide*.
3455
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
3456
+ # Management Service Developer Guide*.
3171
3457
  #
3172
3458
  # **How to use your data key**
3173
3459
  #
@@ -3226,7 +3512,10 @@ module Aws::KMS
3226
3512
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3227
3513
  #
3228
3514
  # @option params [required, String] :key_id
3229
- # Identifies the symmetric KMS key that encrypts the data key.
3515
+ # Specifies the symmetric encryption KMS key that encrypts the data key.
3516
+ # You cannot specify an asymmetric KMS key or a KMS key in a custom key
3517
+ # store. To get the type and origin of your KMS key, use the DescribeKey
3518
+ # operation.
3230
3519
  #
3231
3520
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3232
3521
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3252,13 +3541,14 @@ module Aws::KMS
3252
3541
  # data key.
3253
3542
  #
3254
3543
  # An *encryption context* is a collection of non-secret key-value pairs
3255
- # that represents additional authenticated data. When you use an
3544
+ # that represent additional authenticated data. When you use an
3256
3545
  # encryption context to encrypt data, you must specify the same (an
3257
3546
  # exact case-sensitive match) encryption context to decrypt the data. An
3258
- # encryption context is optional when encrypting with a symmetric KMS
3259
- # key, but it is highly recommended.
3547
+ # encryption context is supported only on operations with symmetric
3548
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3549
+ # an encryption context is optional, but it is strongly recommended.
3260
3550
  #
3261
- # For more information, see [Encryption Context][1] in the *Key
3551
+ # For more information, see [Encryption context][1] in the *Key
3262
3552
  # Management Service Developer Guide*.
3263
3553
  #
3264
3554
  #
@@ -3346,11 +3636,13 @@ module Aws::KMS
3346
3636
  req.send_request(options)
3347
3637
  end
3348
3638
 
3349
- # Generates a unique asymmetric data key pair. The `GenerateDataKeyPair`
3639
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3350
3640
  # operation returns a plaintext public key, a plaintext private key, and
3351
- # a copy of the private key that is encrypted under the symmetric KMS
3352
- # key you specify. You can use the data key pair to perform asymmetric
3353
- # cryptography and implement digital signatures outside of KMS.
3641
+ # a copy of the private key that is encrypted under the symmetric
3642
+ # encryption KMS key you specify. You can use the data key pair to
3643
+ # perform asymmetric cryptography and implement digital signatures
3644
+ # outside of KMS. The bytes in the keys are random; they not related to
3645
+ # the caller or to the KMS key that is used to encrypt the private key.
3354
3646
  #
3355
3647
  # You can use the public key that `GenerateDataKeyPair` returns to
3356
3648
  # encrypt data or verify a signature outside of KMS. Then, store the
@@ -3358,16 +3650,17 @@ module Aws::KMS
3358
3650
  # data or sign a message, you can use the Decrypt operation to decrypt
3359
3651
  # the encrypted private key.
3360
3652
  #
3361
- # To generate a data key pair, you must specify a symmetric KMS key to
3362
- # encrypt the private key in a data key pair. You cannot use an
3363
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3364
- # and origin of your KMS key, use the DescribeKey operation.
3653
+ # To generate a data key pair, you must specify a symmetric encryption
3654
+ # KMS key to encrypt the private key in a data key pair. You cannot use
3655
+ # an asymmetric KMS key or a KMS key in a custom key store. To get the
3656
+ # type and origin of your KMS key, use the DescribeKey operation.
3365
3657
  #
3366
3658
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3367
- # (ECC) data key pair. KMS recommends that your use ECC key pairs for
3368
- # signing, and use RSA key pairs for either encryption or signing, but
3369
- # not both. However, KMS cannot enforce any restrictions on the use of
3370
- # data key pairs outside of KMS.
3659
+ # (ECC) data key pair. In China Regions, you can also choose an SM2 data
3660
+ # key pair. KMS recommends that you use ECC key pairs for signing, and
3661
+ # use RSA and SM2 key pairs for either encryption or signing, but not
3662
+ # both. However, KMS cannot enforce any restrictions on the use of data
3663
+ # key pairs outside of KMS.
3371
3664
  #
3372
3665
  # If you are using the data key pair to encrypt data, or for any
3373
3666
  # operation where you don't immediately need a private key, consider
@@ -3379,13 +3672,13 @@ module Aws::KMS
3379
3672
  # to decrypt the encrypted private key in the data key pair.
3380
3673
  #
3381
3674
  # `GenerateDataKeyPair` returns a unique data key pair for each request.
3382
- # The bytes in the keys are not related to the caller or the KMS key
3383
- # that is used to encrypt the private key. The public key is a
3384
- # DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC 5280][1].
3385
- # The private key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in
3386
- # [RFC 5958][2].
3675
+ # The bytes in the keys are random; they are not related to the caller
3676
+ # or the KMS key that is used to encrypt the private key. The public key
3677
+ # is a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3678
+ # 5280][1]. The private key is a DER-encoded PKCS8 PrivateKeyInfo, as
3679
+ # specified in [RFC 5958][2].
3387
3680
  #
3388
- # You can use the optional encryption context to add additional security
3681
+ # You can use an optional encryption context to add additional security
3389
3682
  # to the encryption operation. If you specify an `EncryptionContext`,
3390
3683
  # you must specify the same encryption context (a case-sensitive exact
3391
3684
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3394,8 +3687,8 @@ module Aws::KMS
3394
3687
  # Service Developer Guide*.
3395
3688
  #
3396
3689
  # The KMS key that you use for this operation must be in a compatible
3397
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3398
- # the *Key Management Service Developer Guide*.
3690
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
3691
+ # Management Service Developer Guide*.
3399
3692
  #
3400
3693
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3401
3694
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3428,13 +3721,14 @@ module Aws::KMS
3428
3721
  # private key in the data key pair.
3429
3722
  #
3430
3723
  # An *encryption context* is a collection of non-secret key-value pairs
3431
- # that represents additional authenticated data. When you use an
3724
+ # that represent additional authenticated data. When you use an
3432
3725
  # encryption context to encrypt data, you must specify the same (an
3433
3726
  # exact case-sensitive match) encryption context to decrypt the data. An
3434
- # encryption context is optional when encrypting with a symmetric KMS
3435
- # key, but it is highly recommended.
3727
+ # encryption context is supported only on operations with symmetric
3728
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3729
+ # an encryption context is optional, but it is strongly recommended.
3436
3730
  #
3437
- # For more information, see [Encryption Context][1] in the *Key
3731
+ # For more information, see [Encryption context][1] in the *Key
3438
3732
  # Management Service Developer Guide*.
3439
3733
  #
3440
3734
  #
@@ -3442,10 +3736,10 @@ module Aws::KMS
3442
3736
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3443
3737
  #
3444
3738
  # @option params [required, String] :key_id
3445
- # Specifies the symmetric KMS key that encrypts the private key in the
3446
- # data key pair. You cannot specify an asymmetric KMS key or a KMS key
3447
- # in a custom key store. To get the type and origin of your KMS key, use
3448
- # the DescribeKey operation.
3739
+ # Specifies the symmetric encryption KMS key that encrypts the private
3740
+ # key in the data key pair. You cannot specify an asymmetric KMS key or
3741
+ # a KMS key in a custom key store. To get the type and origin of your
3742
+ # KMS key, use the DescribeKey operation.
3449
3743
  #
3450
3744
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3451
3745
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3469,10 +3763,12 @@ module Aws::KMS
3469
3763
  # @option params [required, String] :key_pair_spec
3470
3764
  # Determines the type of data key pair that is generated.
3471
3765
  #
3472
- # The KMS rule that restricts the use of asymmetric RSA KMS keys to
3473
- # encrypt and decrypt or to sign and verify (but not both), and the rule
3474
- # that permits you to use ECC KMS keys only to sign and verify, are not
3475
- # effective on data key pairs, which are used outside of KMS.
3766
+ # The KMS rule that restricts the use of asymmetric RSA and SM2 KMS keys
3767
+ # to encrypt and decrypt or to sign and verify (but not both), and the
3768
+ # rule that permits you to use ECC KMS keys only to sign and verify, are
3769
+ # not effective on data key pairs, which are used outside of KMS. The
3770
+ # SM2 key spec is only available in China Regions. RSA and ECC
3771
+ # asymmetric key pairs are also available in China Regions.
3476
3772
  #
3477
3773
  # @option params [Array<String>] :grant_tokens
3478
3774
  # A list of grant tokens.
@@ -3499,16 +3795,16 @@ module Aws::KMS
3499
3795
  # @example Example: To generate an RSA key pair for encryption and decryption
3500
3796
  #
3501
3797
  # # This example generates an RSA data key pair for encryption and decryption. The operation returns a plaintext public key
3502
- # # and private key, and a copy of the private key that is encrypted under a symmetric KMS key that you specify.
3798
+ # # and private key, and a copy of the private key that is encrypted under a symmetric encryption KMS key that you specify.
3503
3799
  #
3504
3800
  # resp = client.generate_data_key_pair({
3505
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ID of the symmetric KMS key that encrypts the private RSA key in the data key pair.
3801
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ID of the symmetric encryption KMS key that encrypts the private RSA key in the data key pair.
3506
3802
  # key_pair_spec: "RSA_3072", # The requested key spec of the RSA data key pair.
3507
3803
  # })
3508
3804
  #
3509
3805
  # resp.to_h outputs the following:
3510
3806
  # {
3511
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric KMS key that was used to encrypt the private key.
3807
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric encryption KMS key that was used to encrypt the private key.
3512
3808
  # key_pair_spec: "RSA_3072", # The actual key spec of the RSA data key pair.
3513
3809
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the RSA data key pair.
3514
3810
  # private_key_plaintext: "<binary data>", # The plaintext private key of the RSA data key pair.
@@ -3522,7 +3818,7 @@ module Aws::KMS
3522
3818
  # "EncryptionContextKey" => "EncryptionContextValue",
3523
3819
  # },
3524
3820
  # key_id: "KeyIdType", # required
3525
- # 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
3821
+ # 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, SM2
3526
3822
  # grant_tokens: ["GrantTokenType"],
3527
3823
  # })
3528
3824
  #
@@ -3532,7 +3828,7 @@ module Aws::KMS
3532
3828
  # resp.private_key_plaintext #=> String
3533
3829
  # resp.public_key #=> String
3534
3830
  # resp.key_id #=> String
3535
- # 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"
3831
+ # 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", "SM2"
3536
3832
  #
3537
3833
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair AWS API Documentation
3538
3834
  #
@@ -3543,11 +3839,12 @@ module Aws::KMS
3543
3839
  req.send_request(options)
3544
3840
  end
3545
3841
 
3546
- # Generates a unique asymmetric data key pair. The
3547
- # `GenerateDataKeyPairWithoutPlaintext` operation returns a plaintext
3548
- # public key and a copy of the private key that is encrypted under the
3549
- # symmetric KMS key you specify. Unlike GenerateDataKeyPair, this
3550
- # operation does not return a plaintext private key.
3842
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3843
+ # operation returns a plaintext public key and a copy of the private key
3844
+ # that is encrypted under the symmetric encryption KMS key you specify.
3845
+ # Unlike GenerateDataKeyPair, this operation does not return a plaintext
3846
+ # private key. The bytes in the keys are random; they are not related to
3847
+ # the caller or to the KMS key that is used to encrypt the private key.
3551
3848
  #
3552
3849
  # You can use the public key that `GenerateDataKeyPairWithoutPlaintext`
3553
3850
  # returns to encrypt data or verify a signature outside of KMS. Then,
@@ -3555,16 +3852,17 @@ module Aws::KMS
3555
3852
  # decrypt data or sign a message, you can use the Decrypt operation to
3556
3853
  # decrypt the encrypted private key.
3557
3854
  #
3558
- # To generate a data key pair, you must specify a symmetric KMS key to
3559
- # encrypt the private key in a data key pair. You cannot use an
3560
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3561
- # and origin of your KMS key, use the DescribeKey operation.
3855
+ # To generate a data key pair, you must specify a symmetric encryption
3856
+ # KMS key to encrypt the private key in a data key pair. You cannot use
3857
+ # an asymmetric KMS key or a KMS key in a custom key store. To get the
3858
+ # type and origin of your KMS key, use the DescribeKey operation.
3562
3859
  #
3563
3860
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3564
- # (ECC) data key pair. KMS recommends that your use ECC key pairs for
3565
- # signing, and use RSA key pairs for either encryption or signing, but
3566
- # not both. However, KMS cannot enforce any restrictions on the use of
3567
- # data key pairs outside of KMS.
3861
+ # (ECC) data key pair. In China Regions, you can also choose an SM2 data
3862
+ # key pair. KMS recommends that you use ECC key pairs for signing, and
3863
+ # use RSA and SM2 key pairs for either encryption or signing, but not
3864
+ # both. However, KMS cannot enforce any restrictions on the use of data
3865
+ # key pairs outside of KMS.
3568
3866
  #
3569
3867
  # `GenerateDataKeyPairWithoutPlaintext` returns a unique data key pair
3570
3868
  # for each request. The bytes in the key are not related to the caller
@@ -3572,7 +3870,7 @@ module Aws::KMS
3572
3870
  # a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3573
3871
  # 5280][1].
3574
3872
  #
3575
- # You can use the optional encryption context to add additional security
3873
+ # You can use an optional encryption context to add additional security
3576
3874
  # to the encryption operation. If you specify an `EncryptionContext`,
3577
3875
  # you must specify the same encryption context (a case-sensitive exact
3578
3876
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3581,8 +3879,8 @@ module Aws::KMS
3581
3879
  # Service Developer Guide*.
3582
3880
  #
3583
3881
  # The KMS key that you use for this operation must be in a compatible
3584
- # key state. For details, see [Key state: Effect on your KMS key][3] in
3585
- # the *Key Management Service Developer Guide*.
3882
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
3883
+ # Management Service Developer Guide*.
3586
3884
  #
3587
3885
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3588
3886
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3615,13 +3913,14 @@ module Aws::KMS
3615
3913
  # private key in the data key pair.
3616
3914
  #
3617
3915
  # An *encryption context* is a collection of non-secret key-value pairs
3618
- # that represents additional authenticated data. When you use an
3916
+ # that represent additional authenticated data. When you use an
3619
3917
  # encryption context to encrypt data, you must specify the same (an
3620
3918
  # exact case-sensitive match) encryption context to decrypt the data. An
3621
- # encryption context is optional when encrypting with a symmetric KMS
3622
- # key, but it is highly recommended.
3919
+ # encryption context is supported only on operations with symmetric
3920
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3921
+ # an encryption context is optional, but it is strongly recommended.
3623
3922
  #
3624
- # For more information, see [Encryption Context][1] in the *Key
3923
+ # For more information, see [Encryption context][1] in the *Key
3625
3924
  # Management Service Developer Guide*.
3626
3925
  #
3627
3926
  #
@@ -3629,10 +3928,10 @@ module Aws::KMS
3629
3928
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3630
3929
  #
3631
3930
  # @option params [required, String] :key_id
3632
- # Specifies the KMS key that encrypts the private key in the data key
3633
- # pair. You must specify a symmetric KMS key. You cannot use an
3634
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3635
- # and origin of your KMS key, use the DescribeKey operation.
3931
+ # Specifies the symmetric encryption KMS key that encrypts the private
3932
+ # key in the data key pair. You cannot specify an asymmetric KMS key or
3933
+ # a KMS key in a custom key store. To get the type and origin of your
3934
+ # KMS key, use the DescribeKey operation.
3636
3935
  #
3637
3936
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3638
3937
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3656,10 +3955,12 @@ module Aws::KMS
3656
3955
  # @option params [required, String] :key_pair_spec
3657
3956
  # Determines the type of data key pair that is generated.
3658
3957
  #
3659
- # The KMS rule that restricts the use of asymmetric RSA KMS keys to
3660
- # encrypt and decrypt or to sign and verify (but not both), and the rule
3661
- # that permits you to use ECC KMS keys only to sign and verify, are not
3662
- # effective on data key pairs, which are used outside of KMS.
3958
+ # The KMS rule that restricts the use of asymmetric RSA and SM2 KMS keys
3959
+ # to encrypt and decrypt or to sign and verify (but not both), and the
3960
+ # rule that permits you to use ECC KMS keys only to sign and verify, are
3961
+ # not effective on data key pairs, which are used outside of KMS. The
3962
+ # SM2 key spec is only available in China Regions. RSA and ECC
3963
+ # asymmetric key pairs are also available in China Regions.
3663
3964
  #
3664
3965
  # @option params [Array<String>] :grant_tokens
3665
3966
  # A list of grant tokens.
@@ -3685,16 +3986,16 @@ module Aws::KMS
3685
3986
  # @example Example: To generate an asymmetric data key pair without a plaintext key
3686
3987
  #
3687
3988
  # # This example returns an asymmetric elliptic curve (ECC) data key pair. The private key is encrypted under the symmetric
3688
- # # KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
3989
+ # # encryption KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
3689
3990
  #
3690
3991
  # resp = client.generate_data_key_pair_without_plaintext({
3691
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The symmetric KMS key that encrypts the private key of the ECC data key pair.
3992
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The symmetric encryption KMS key that encrypts the private key of the ECC data key pair.
3692
3993
  # key_pair_spec: "ECC_NIST_P521", # The requested key spec of the ECC asymmetric data key pair.
3693
3994
  # })
3694
3995
  #
3695
3996
  # resp.to_h outputs the following:
3696
3997
  # {
3697
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric KMS key that encrypted the private key in the ECC asymmetric data key pair.
3998
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric encryption KMS key that encrypted the private key in the ECC asymmetric data key pair.
3698
3999
  # key_pair_spec: "ECC_NIST_P521", # The actual key spec of the ECC asymmetric data key pair.
3699
4000
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the asymmetric ECC data key pair.
3700
4001
  # public_key: "<binary data>", # The public key (plaintext).
@@ -3707,7 +4008,7 @@ module Aws::KMS
3707
4008
  # "EncryptionContextKey" => "EncryptionContextValue",
3708
4009
  # },
3709
4010
  # key_id: "KeyIdType", # required
3710
- # 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
4011
+ # 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, SM2
3711
4012
  # grant_tokens: ["GrantTokenType"],
3712
4013
  # })
3713
4014
  #
@@ -3716,7 +4017,7 @@ module Aws::KMS
3716
4017
  # resp.private_key_ciphertext_blob #=> String
3717
4018
  # resp.public_key #=> String
3718
4019
  # resp.key_id #=> String
3719
- # 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"
4020
+ # 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", "SM2"
3720
4021
  #
3721
4022
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext AWS API Documentation
3722
4023
  #
@@ -3727,13 +4028,15 @@ module Aws::KMS
3727
4028
  req.send_request(options)
3728
4029
  end
3729
4030
 
3730
- # Generates a unique symmetric data key. This operation returns a data
3731
- # key that is encrypted under a KMS key that you specify. To request an
3732
- # asymmetric data key pair, use the GenerateDataKeyPair or
3733
- # GenerateDataKeyPairWithoutPlaintext operations.
4031
+ # Returns a unique symmetric data key for use outside of KMS. This
4032
+ # operation returns a data key that is encrypted under a symmetric
4033
+ # encryption KMS key that you specify. The bytes in the key are random;
4034
+ # they are not related to the caller or to the KMS key.
3734
4035
  #
3735
4036
  # `GenerateDataKeyWithoutPlaintext` is identical to the GenerateDataKey
3736
- # operation except that returns only the encrypted copy of the data key.
4037
+ # operation except that it does not return a plaintext copy of the data
4038
+ # key.
4039
+ #
3737
4040
  # This operation is useful for systems that need to encrypt data at some
3738
4041
  # point, but not immediately. When you need to encrypt the data, you
3739
4042
  # call the Decrypt operation on the encrypted copy of the key.
@@ -3748,19 +4051,18 @@ module Aws::KMS
3748
4051
  # data key. In this system, the component that creates the containers
3749
4052
  # never sees the plaintext data key.
3750
4053
  #
3751
- # `GenerateDataKeyWithoutPlaintext` returns a unique data key for each
3752
- # request. The bytes in the keys are not related to the caller or KMS
3753
- # key that is used to encrypt the private key.
4054
+ # To request an asymmetric data key pair, use the GenerateDataKeyPair or
4055
+ # GenerateDataKeyPairWithoutPlaintext operations.
3754
4056
  #
3755
- # To generate a data key, you must specify the symmetric KMS key that is
3756
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3757
- # generate a data key. To get the type of your KMS key, use the
3758
- # DescribeKey operation.
4057
+ # To generate a data key, you must specify the symmetric encryption KMS
4058
+ # key that is used to encrypt the data key. You cannot use an asymmetric
4059
+ # KMS key or a key in a custom key store to generate a data key. To get
4060
+ # the type of your KMS key, use the DescribeKey operation.
3759
4061
  #
3760
4062
  # If the operation succeeds, you will find the encrypted copy of the
3761
4063
  # data key in the `CiphertextBlob` field.
3762
4064
  #
3763
- # You can use the optional encryption context to add additional security
4065
+ # You can use an optional encryption context to add additional security
3764
4066
  # to the encryption operation. If you specify an `EncryptionContext`,
3765
4067
  # you must specify the same encryption context (a case-sensitive exact
3766
4068
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3769,8 +4071,8 @@ module Aws::KMS
3769
4071
  # Service Developer Guide*.
3770
4072
  #
3771
4073
  # The KMS key that you use for this operation must be in a compatible
3772
- # key state. For details, see [Key state: Effect on your KMS key][2] in
3773
- # the *Key Management Service Developer Guide*.
4074
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
4075
+ # Management Service Developer Guide*.
3774
4076
  #
3775
4077
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3776
4078
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3798,7 +4100,10 @@ module Aws::KMS
3798
4100
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3799
4101
  #
3800
4102
  # @option params [required, String] :key_id
3801
- # The identifier of the symmetric KMS key that encrypts the data key.
4103
+ # Specifies the symmetric encryption KMS key that encrypts the data key.
4104
+ # You cannot specify an asymmetric KMS key or a KMS key in a custom key
4105
+ # store. To get the type and origin of your KMS key, use the DescribeKey
4106
+ # operation.
3802
4107
  #
3803
4108
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3804
4109
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3824,13 +4129,14 @@ module Aws::KMS
3824
4129
  # data key.
3825
4130
  #
3826
4131
  # An *encryption context* is a collection of non-secret key-value pairs
3827
- # that represents additional authenticated data. When you use an
4132
+ # that represent additional authenticated data. When you use an
3828
4133
  # encryption context to encrypt data, you must specify the same (an
3829
4134
  # exact case-sensitive match) encryption context to decrypt the data. An
3830
- # encryption context is optional when encrypting with a symmetric KMS
3831
- # key, but it is highly recommended.
4135
+ # encryption context is supported only on operations with symmetric
4136
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
4137
+ # an encryption context is optional, but it is strongly recommended.
3832
4138
  #
3833
- # For more information, see [Encryption Context][1] in the *Key
4139
+ # For more information, see [Encryption context][1] in the *Key
3834
4140
  # Management Service Developer Guide*.
3835
4141
  #
3836
4142
  #
@@ -3908,8 +4214,140 @@ module Aws::KMS
3908
4214
  req.send_request(options)
3909
4215
  end
3910
4216
 
4217
+ # Generates a hash-based message authentication code (HMAC) for a
4218
+ # message using an HMAC KMS key and a MAC algorithm that the key
4219
+ # supports. The MAC algorithm computes the HMAC for the message and the
4220
+ # key as described in [RFC 2104][1].
4221
+ #
4222
+ # You can use the HMAC that this operation generates with the VerifyMac
4223
+ # operation to demonstrate that the original message has not changed.
4224
+ # Also, because a secret key is used to create the hash, you can verify
4225
+ # that the party that generated the hash has the required secret key.
4226
+ # This operation is part of KMS support for HMAC KMS keys. For details,
4227
+ # see [HMAC keys in KMS][2] in the <i> <i>Key Management Service
4228
+ # Developer Guide</i> </i>.
4229
+ #
4230
+ # <note markdown="1"> Best practices recommend that you limit the time during which any
4231
+ # signing mechanism, including an HMAC, is effective. This deters an
4232
+ # attack where the actor uses a signed message to establish validity
4233
+ # repeatedly or long after the message is superseded. HMAC tags do not
4234
+ # include a timestamp, but you can include a timestamp in the token or
4235
+ # message to help you detect when its time to refresh the HMAC.
4236
+ #
4237
+ # </note>
4238
+ #
4239
+ # The KMS key that you use for this operation must be in a compatible
4240
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
4241
+ # Management Service Developer Guide*.
4242
+ #
4243
+ # **Cross-account use**\: Yes. To perform this operation with a KMS key
4244
+ # in a different Amazon Web Services account, specify the key ARN or
4245
+ # alias ARN in the value of the `KeyId` parameter.
4246
+ #
4247
+ # **Required permissions**\: [kms:GenerateMac][4] (key policy)
4248
+ #
4249
+ # **Related operations**\: VerifyMac
4250
+ #
4251
+ #
4252
+ #
4253
+ # [1]: https://datatracker.ietf.org/doc/html/rfc2104
4254
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
4255
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4256
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4257
+ #
4258
+ # @option params [required, String, StringIO, File] :message
4259
+ # The message to be hashed. Specify a message of up to 4,096 bytes.
4260
+ #
4261
+ # `GenerateMac` and VerifyMac do not provide special handling for
4262
+ # message digests. If you generate an HMAC for a hash digest of a
4263
+ # message, you must verify the HMAC of the same hash digest.
4264
+ #
4265
+ # @option params [required, String] :key_id
4266
+ # The HMAC KMS key to use in the operation. The MAC algorithm computes
4267
+ # the HMAC for the message and the key as described in [RFC 2104][1].
4268
+ #
4269
+ # To identify an HMAC KMS key, use the DescribeKey operation and see the
4270
+ # `KeySpec` field in the response.
4271
+ #
4272
+ #
4273
+ #
4274
+ # [1]: https://datatracker.ietf.org/doc/html/rfc2104
4275
+ #
4276
+ # @option params [required, String] :mac_algorithm
4277
+ # The MAC algorithm used in the operation.
4278
+ #
4279
+ # The algorithm must be compatible with the HMAC KMS key that you
4280
+ # specify. To find the MAC algorithms that your HMAC KMS key supports,
4281
+ # use the DescribeKey operation and see the `MacAlgorithms` field in the
4282
+ # `DescribeKey` response.
4283
+ #
4284
+ # @option params [Array<String>] :grant_tokens
4285
+ # A list of grant tokens.
4286
+ #
4287
+ # Use a grant token when your permission to call this operation comes
4288
+ # from a new grant that has not yet achieved *eventual consistency*. For
4289
+ # more information, see [Grant token][1] and [Using a grant token][2] in
4290
+ # the *Key Management Service Developer Guide*.
4291
+ #
4292
+ #
4293
+ #
4294
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
4295
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
4296
+ #
4297
+ # @return [Types::GenerateMacResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
4298
+ #
4299
+ # * {Types::GenerateMacResponse#mac #mac} => String
4300
+ # * {Types::GenerateMacResponse#mac_algorithm #mac_algorithm} => String
4301
+ # * {Types::GenerateMacResponse#key_id #key_id} => String
4302
+ #
4303
+ #
4304
+ # @example Example: To generate an HMAC for a message
4305
+ #
4306
+ # # This example generates an HMAC for a message, an HMAC KMS key, and a MAC algorithm. The algorithm must be supported by
4307
+ # # the specified HMAC KMS key.
4308
+ #
4309
+ # resp = client.generate_mac({
4310
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The HMAC KMS key input to the HMAC algorithm.
4311
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm requested for the operation.
4312
+ # message: "Hello World", # The message input to the HMAC algorithm.
4313
+ # })
4314
+ #
4315
+ # resp.to_h outputs the following:
4316
+ # {
4317
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the HMAC KMS key used in the operation.
4318
+ # mac: "<HMAC_TAG>", # The HMAC tag that results from this operation.
4319
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm used in the operation.
4320
+ # }
4321
+ #
4322
+ # @example Request syntax with placeholder values
4323
+ #
4324
+ # resp = client.generate_mac({
4325
+ # message: "data", # required
4326
+ # key_id: "KeyIdType", # required
4327
+ # mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
4328
+ # grant_tokens: ["GrantTokenType"],
4329
+ # })
4330
+ #
4331
+ # @example Response structure
4332
+ #
4333
+ # resp.mac #=> String
4334
+ # resp.mac_algorithm #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
4335
+ # resp.key_id #=> String
4336
+ #
4337
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateMac AWS API Documentation
4338
+ #
4339
+ # @overload generate_mac(params = {})
4340
+ # @param [Hash] params ({})
4341
+ def generate_mac(params = {}, options = {})
4342
+ req = build_request(:generate_mac, params)
4343
+ req.send_request(options)
4344
+ end
4345
+
3911
4346
  # Returns a random byte string that is cryptographically secure.
3912
4347
  #
4348
+ # You must use the `NumberOfBytes` parameter to specify the length of
4349
+ # the random byte string. There is no default value for string length.
4350
+ #
3913
4351
  # By default, the random byte string is generated in KMS. To generate
3914
4352
  # the byte string in the CloudHSM cluster that is associated with a
3915
4353
  # [custom key store][1], specify the custom key store ID.
@@ -3923,6 +4361,9 @@ module Aws::KMS
3923
4361
  # For more information about entropy and random number generation, see
3924
4362
  # [Key Management Service Cryptographic Details][4].
3925
4363
  #
4364
+ # **Cross-account use**\: Not applicable. `GenerateRandom` does not use
4365
+ # any account-specific resources, such as KMS keys.
4366
+ #
3926
4367
  # **Required permissions**\: [kms:GenerateRandom][5] (IAM policy)
3927
4368
  #
3928
4369
  #
@@ -3934,7 +4375,7 @@ module Aws::KMS
3934
4375
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3935
4376
  #
3936
4377
  # @option params [Integer] :number_of_bytes
3937
- # The length of the byte string.
4378
+ # The length of the random byte string. This parameter is required.
3938
4379
  #
3939
4380
  # @option params [String] :custom_key_store_id
3940
4381
  # Generates the random byte string in the CloudHSM cluster that is
@@ -4057,30 +4498,56 @@ module Aws::KMS
4057
4498
  # Gets a Boolean value that indicates whether [automatic rotation of the
4058
4499
  # key material][1] is enabled for the specified KMS key.
4059
4500
  #
4060
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
4061
- # keys with [imported key material][3], or KMS keys in a [custom key
4062
- # store][4]. To enable or disable automatic rotation of a set of related
4063
- # [multi-Region keys][5], set the property on the primary key. The key
4064
- # rotation status for these KMS keys is always `false`.
4501
+ # When you enable automatic rotation for [customer managed KMS keys][2],
4502
+ # KMS rotates the key material of the KMS key one year (approximately
4503
+ # 365 days) from the enable date and every year thereafter. You can
4504
+ # monitor rotation of the key material for your KMS keys in CloudTrail
4505
+ # and Amazon CloudWatch.
4506
+ #
4507
+ # Automatic key rotation is supported only on [symmetric encryption KMS
4508
+ # keys][3]. You cannot enable or disable automatic rotation of
4509
+ # [asymmetric KMS keys][4], [HMAC KMS keys][5], KMS keys with [imported
4510
+ # key material][6], or KMS keys in a [custom key store][7]. The key
4511
+ # rotation status of these KMS keys is always `false`. To enable or
4512
+ # disable automatic rotation of a set of related [multi-Region keys][8],
4513
+ # set the property on the primary key..
4514
+ #
4515
+ # You can enable (EnableKeyRotation) and disable automatic rotation
4516
+ # (DisableKeyRotation) of the key material in customer managed KMS keys.
4517
+ # Key material rotation of [Amazon Web Services managed KMS keys][9] is
4518
+ # not configurable. KMS always rotates the key material in Amazon Web
4519
+ # Services managed KMS keys every year. The key rotation status for
4520
+ # Amazon Web Services managed KMS keys is always `true`.
4521
+ #
4522
+ # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
4523
+ # managed keys from every three years to every year. For details, see
4524
+ # EnableKeyRotation.
4525
+ #
4526
+ # </note>
4065
4527
  #
4066
4528
  # The KMS key that you use for this operation must be in a compatible
4067
- # key state. For details, see [Key state: Effect on your KMS key][6] in
4068
- # the *Key Management Service Developer Guide*.
4529
+ # key state. For details, see [Key states of KMS keys][10] in the *Key
4530
+ # Management Service Developer Guide*.
4069
4531
  #
4070
4532
  # * Disabled: The key rotation status does not change when you disable a
4071
4533
  # KMS key. However, while the KMS key is disabled, KMS does not rotate
4072
- # the key material.
4534
+ # the key material. When you re-enable the KMS key, rotation resumes.
4535
+ # If the key material in the re-enabled KMS key hasn't been rotated
4536
+ # in one year, KMS rotates it immediately, and every year thereafter.
4537
+ # If it's been less than a year since the key material in the
4538
+ # re-enabled KMS key was rotated, the KMS key resumes its prior
4539
+ # rotation schedule.
4073
4540
  #
4074
4541
  # * Pending deletion: While a KMS key is pending deletion, its key
4075
4542
  # rotation status is `false` and KMS does not rotate the key material.
4076
- # If you cancel the deletion, the original key rotation status is
4077
- # restored.
4543
+ # If you cancel the deletion, the original key rotation status returns
4544
+ # to `true`.
4078
4545
  #
4079
4546
  # **Cross-account use**\: Yes. To perform this operation on a KMS key in
4080
4547
  # a different Amazon Web Services account, specify the key ARN in the
4081
4548
  # value of the `KeyId` parameter.
4082
4549
  #
4083
- # **Required permissions**\: [kms:GetKeyRotationStatus][7] (key policy)
4550
+ # **Required permissions**\: [kms:GetKeyRotationStatus][11] (key policy)
4084
4551
  #
4085
4552
  # **Related operations:**
4086
4553
  #
@@ -4091,12 +4558,16 @@ module Aws::KMS
4091
4558
  #
4092
4559
  #
4093
4560
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
4094
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
4095
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4096
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4097
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
4098
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4099
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4561
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
4562
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
4563
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
4564
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
4565
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4566
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4567
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
4568
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
4569
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4570
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4100
4571
  #
4101
4572
  # @option params [required, String] :key_id
4102
4573
  # Gets the rotation status for the specified KMS key.
@@ -4151,21 +4622,22 @@ module Aws::KMS
4151
4622
  req.send_request(options)
4152
4623
  end
4153
4624
 
4154
- # Returns the items you need to import key material into a symmetric,
4155
- # customer managed KMS key. For more information about importing key
4156
- # material into KMS, see [Importing Key Material][1] in the *Key
4157
- # Management Service Developer Guide*.
4625
+ # Returns the items you need to import key material into a symmetric
4626
+ # encryption KMS key. For more information about importing key material
4627
+ # into KMS, see [Importing key material][1] in the *Key Management
4628
+ # Service Developer Guide*.
4158
4629
  #
4159
4630
  # This operation returns a public key and an import token. Use the
4160
4631
  # public key to encrypt the symmetric key material. Store the import
4161
4632
  # token to send with a subsequent ImportKeyMaterial request.
4162
4633
  #
4163
- # You must specify the key ID of the symmetric KMS key into which you
4164
- # will import key material. This KMS key's `Origin` must be `EXTERNAL`.
4165
- # You must also specify the wrapping algorithm and type of wrapping key
4166
- # (public key) that you will use to encrypt the key material. You cannot
4167
- # perform this operation on an asymmetric KMS key or on any KMS key in a
4168
- # different Amazon Web Services account.
4634
+ # You must specify the key ID of the symmetric encryption KMS key into
4635
+ # which you will import key material. This KMS key's `Origin` must be
4636
+ # `EXTERNAL`. You must also specify the wrapping algorithm and type of
4637
+ # wrapping key (public key) that you will use to encrypt the key
4638
+ # material. You cannot perform this operation on an asymmetric KMS key,
4639
+ # an HMAC KMS key, or on any KMS key in a different Amazon Web Services
4640
+ # account.
4169
4641
  #
4170
4642
  # To import key material, you must use the public key and import token
4171
4643
  # from the same response. These items are valid for 24 hours. The
@@ -4175,8 +4647,8 @@ module Aws::KMS
4175
4647
  # `GetParametersForImport` request.
4176
4648
  #
4177
4649
  # The KMS key that you use for this operation must be in a compatible
4178
- # key state. For details, see [Key state: Effect on your KMS key][2] in
4179
- # the *Key Management Service Developer Guide*.
4650
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
4651
+ # Management Service Developer Guide*.
4180
4652
  #
4181
4653
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4182
4654
  # key in a different Amazon Web Services account.
@@ -4197,8 +4669,8 @@ module Aws::KMS
4197
4669
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4198
4670
  #
4199
4671
  # @option params [required, String] :key_id
4200
- # The identifier of the symmetric KMS key into which you will import key
4201
- # material. The `Origin` of the KMS key must be `EXTERNAL`.
4672
+ # The identifier of the symmetric encryption KMS key into which you will
4673
+ # import key material. The `Origin` of the KMS key must be `EXTERNAL`.
4202
4674
  #
4203
4675
  # Specify the key ID or key ARN of the KMS key.
4204
4676
  #
@@ -4281,9 +4753,8 @@ module Aws::KMS
4281
4753
  # callers with `kms:GetPublicKey` permission can download the public key
4282
4754
  # of an asymmetric KMS key. You can share the public key to allow others
4283
4755
  # to encrypt messages and verify signatures outside of KMS. For
4284
- # information about symmetric and asymmetric KMS keys, see [Using
4285
- # Symmetric and Asymmetric KMS keys][1] in the *Key Management Service
4286
- # Developer Guide*.
4756
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
4757
+ # the *Key Management Service Developer Guide*.
4287
4758
  #
4288
4759
  # You do not need to download the public key. Instead, you can use the
4289
4760
  # public key within KMS by calling the Encrypt, ReEncrypt, or Verify
@@ -4291,8 +4762,12 @@ module Aws::KMS
4291
4762
  # the public key within KMS, you benefit from the authentication,
4292
4763
  # authorization, and logging that are part of every KMS operation. You
4293
4764
  # also reduce of risk of encrypting data that cannot be decrypted. These
4294
- # features are not effective outside of KMS. For details, see [Special
4295
- # Considerations for Downloading Public Keys][2].
4765
+ # features are not effective outside of KMS.
4766
+ #
4767
+ # To verify a signature outside of KMS with an SM2 public key (China
4768
+ # Regions only), you must specify the distinguishing ID. By default, KMS
4769
+ # uses `1234567812345678` as the distinguishing ID. For more
4770
+ # information, see [Offline verification with SM2 key pairs][2].
4296
4771
  #
4297
4772
  # To help you use the public key safely outside of KMS, `GetPublicKey`
4298
4773
  # returns important information about the public key in the response,
@@ -4315,8 +4790,8 @@ module Aws::KMS
4315
4790
  # in a verification operation.
4316
4791
  #
4317
4792
  # The KMS key that you use for this operation must be in a compatible
4318
- # key state. For details, see [Key state: Effect on your KMS key][7] in
4319
- # the *Key Management Service Developer Guide*.
4793
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
4794
+ # Management Service Developer Guide*.
4320
4795
  #
4321
4796
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
4322
4797
  # in a different Amazon Web Services account, specify the key ARN or
@@ -4329,7 +4804,7 @@ module Aws::KMS
4329
4804
  #
4330
4805
  #
4331
4806
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
4332
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/download-public-key.html#download-public-key-considerations
4807
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification
4333
4808
  # [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeySpec
4334
4809
  # [4]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage
4335
4810
  # [5]: https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms
@@ -4416,13 +4891,13 @@ module Aws::KMS
4416
4891
  #
4417
4892
  # resp.key_id #=> String
4418
4893
  # resp.public_key #=> String
4419
- # 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"
4420
- # resp.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"
4421
- # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
4894
+ # 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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
4895
+ # resp.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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
4896
+ # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
4422
4897
  # resp.encryption_algorithms #=> Array
4423
- # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
4898
+ # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
4424
4899
  # resp.signing_algorithms #=> Array
4425
- # 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"
4900
+ # 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", "SM2DSA"
4426
4901
  #
4427
4902
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey AWS API Documentation
4428
4903
  #
@@ -4433,16 +4908,17 @@ module Aws::KMS
4433
4908
  req.send_request(options)
4434
4909
  end
4435
4910
 
4436
- # Imports key material into an existing symmetric KMS KMS key that was
4437
- # created without key material. After you successfully import key
4438
- # material into a KMS key, you can [reimport the same key material][1]
4439
- # into that KMS key, but you cannot import different key material.
4440
- #
4441
- # You cannot perform this operation on an asymmetric KMS key or on any
4442
- # KMS key in a different Amazon Web Services account. For more
4443
- # information about creating KMS keys with no key material and then
4444
- # importing key material, see [Importing Key Material][2] in the *Key
4445
- # Management Service Developer Guide*.
4911
+ # Imports key material into an existing symmetric encryption KMS key
4912
+ # that was created without key material. After you successfully import
4913
+ # key material into a KMS key, you can [reimport the same key
4914
+ # material][1] into that KMS key, but you cannot import different key
4915
+ # material.
4916
+ #
4917
+ # You cannot perform this operation on an asymmetric KMS key, an HMAC
4918
+ # KMS key, or on any KMS key in a different Amazon Web Services account.
4919
+ # For more information about creating KMS keys with no key material and
4920
+ # then importing key material, see [Importing Key Material][2] in the
4921
+ # *Key Management Service Developer Guide*.
4446
4922
  #
4447
4923
  # Before using this operation, call GetParametersForImport. Its response
4448
4924
  # includes a public key and an import token. Use the public key to
@@ -4484,8 +4960,8 @@ module Aws::KMS
4484
4960
  # Service Developer Guide*.
4485
4961
  #
4486
4962
  # The KMS key that you use for this operation must be in a compatible
4487
- # key state. For details, see [Key state: Effect on your KMS key][4] in
4488
- # the *Key Management Service Developer Guide*.
4963
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
4964
+ # Management Service Developer Guide*.
4489
4965
  #
4490
4966
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4491
4967
  # key in a different Amazon Web Services account.
@@ -4507,10 +4983,13 @@ module Aws::KMS
4507
4983
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4508
4984
  #
4509
4985
  # @option params [required, String] :key_id
4510
- # The identifier of the symmetric KMS key that receives the imported key
4511
- # material. The KMS key's `Origin` must be `EXTERNAL`. This must be the
4512
- # same KMS key specified in the `KeyID` parameter of the corresponding
4513
- # GetParametersForImport request.
4986
+ # The identifier of the symmetric encryption KMS key that receives the
4987
+ # imported key material. This must be the same KMS key specified in the
4988
+ # `KeyID` parameter of the corresponding GetParametersForImport request.
4989
+ # The `Origin` of the KMS key must be `EXTERNAL`. You cannot perform
4990
+ # this operation on an asymmetric KMS key, an HMAC KMS key, a KMS key in
4991
+ # a custom key store, or on a KMS key in a different Amazon Web Services
4992
+ # account
4514
4993
  #
4515
4994
  # Specify the key ID or key ARN of the KMS key.
4516
4995
  #
@@ -4752,7 +5231,7 @@ module Aws::KMS
4752
5231
  # list by grant ID or grantee principal.
4753
5232
  #
4754
5233
  # For detailed information about grants, including grant terminology,
4755
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
5234
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
4756
5235
  # Guide</i> </i>. For examples of working with grants in several
4757
5236
  # programming languages, see [Programming grants][2].
4758
5237
  #
@@ -4922,7 +5401,7 @@ module Aws::KMS
4922
5401
  # resp.grants[0].retiring_principal #=> String
4923
5402
  # resp.grants[0].issuing_account #=> String
4924
5403
  # resp.grants[0].operations #=> Array
4925
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
5404
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
4926
5405
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
4927
5406
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
4928
5407
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5215,6 +5694,8 @@ module Aws::KMS
5215
5694
  # * {Types::ListResourceTagsResponse#next_marker #next_marker} => String
5216
5695
  # * {Types::ListResourceTagsResponse#truncated #truncated} => Boolean
5217
5696
  #
5697
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
5698
+ #
5218
5699
  #
5219
5700
  # @example Example: To list tags for a KMS key
5220
5701
  #
@@ -5278,7 +5759,7 @@ module Aws::KMS
5278
5759
  # a grant, use the RetireGrant operation.
5279
5760
  #
5280
5761
  # For detailed information about grants, including grant terminology,
5281
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
5762
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
5282
5763
  # Guide</i> </i>. For examples of working with grants in several
5283
5764
  # programming languages, see [Programming grants][2].
5284
5765
  #
@@ -5343,6 +5824,8 @@ module Aws::KMS
5343
5824
  # * {Types::ListGrantsResponse#next_marker #next_marker} => String
5344
5825
  # * {Types::ListGrantsResponse#truncated #truncated} => Boolean
5345
5826
  #
5827
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
5828
+ #
5346
5829
  #
5347
5830
  # @example Example: To list grants that the specified principal can retire
5348
5831
  #
@@ -5390,7 +5873,7 @@ module Aws::KMS
5390
5873
  # resp.grants[0].retiring_principal #=> String
5391
5874
  # resp.grants[0].issuing_account #=> String
5392
5875
  # resp.grants[0].operations #=> Array
5393
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
5876
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
5394
5877
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
5395
5878
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
5396
5879
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5471,15 +5954,29 @@ module Aws::KMS
5471
5954
  # visible][2] in the *Amazon Web Services Identity and Access
5472
5955
  # Management User Guide*.
5473
5956
  #
5474
- # The key policy cannot exceed 32 kilobytes (32768 bytes). For more
5475
- # information, see [Resource Quotas][3] in the *Key Management Service
5476
- # Developer Guide*.
5957
+ # A key policy document can include only the following characters:
5958
+ #
5959
+ # * Printable ASCII characters from the space character (`\u0020`)
5960
+ # through the end of the ASCII character range.
5961
+ #
5962
+ # * Printable characters in the Basic Latin and Latin-1 Supplement
5963
+ # character set (through `\u00FF`).
5964
+ #
5965
+ # * The tab (`\u0009`), line feed (`\u000A`), and carriage return
5966
+ # (`\u000D`) special characters
5967
+ #
5968
+ # For information about key policies, see [Key policies in KMS][3] in
5969
+ # the *Key Management Service Developer Guide*. For help writing and
5970
+ # formatting a JSON policy document, see the [IAM JSON Policy
5971
+ # Reference][4] in the <i> <i>Identity and Access Management User
5972
+ # Guide</i> </i>.
5477
5973
  #
5478
5974
  #
5479
5975
  #
5480
5976
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
5481
5977
  # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
5482
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html
5978
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
5979
+ # [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
5483
5980
  #
5484
5981
  # @option params [Boolean] :bypass_policy_lockout_safety_check
5485
5982
  # A flag to indicate whether to bypass the key policy lockout safety
@@ -5540,7 +6037,7 @@ module Aws::KMS
5540
6037
  # [encryption context][2] of a ciphertext.
5541
6038
  #
5542
6039
  # The `ReEncrypt` operation can decrypt ciphertext that was encrypted by
5543
- # using an KMS KMS key in an KMS operation, such as Encrypt or
6040
+ # using a KMS key in an KMS operation, such as Encrypt or
5544
6041
  # GenerateDataKey. It can also decrypt ciphertext that was encrypted by
5545
6042
  # using the public key of an [asymmetric KMS key][3] outside of KMS.
5546
6043
  # However, it cannot decrypt ciphertext produced by other libraries,
@@ -5558,25 +6055,24 @@ module Aws::KMS
5558
6055
  # algorithm that was used. This information is required to decrypt the
5559
6056
  # data.
5560
6057
  #
5561
- # * If your ciphertext was encrypted under a symmetric KMS key, the
5562
- # `SourceKeyId` parameter is optional. KMS can get this information
5563
- # from metadata that it adds to the symmetric ciphertext blob. This
5564
- # feature adds durability to your implementation by ensuring that
5565
- # authorized users can decrypt ciphertext decades after it was
5566
- # encrypted, even if they've lost track of the key ID. However,
5567
- # specifying the source KMS key is always recommended as a best
5568
- # practice. When you use the `SourceKeyId` parameter to specify a KMS
5569
- # key, KMS uses only the KMS key you specify. If the ciphertext was
5570
- # encrypted under a different KMS key, the `ReEncrypt` operation
6058
+ # * If your ciphertext was encrypted under a symmetric encryption KMS
6059
+ # key, the `SourceKeyId` parameter is optional. KMS can get this
6060
+ # information from metadata that it adds to the symmetric ciphertext
6061
+ # blob. This feature adds durability to your implementation by
6062
+ # ensuring that authorized users can decrypt ciphertext decades after
6063
+ # it was encrypted, even if they've lost track of the key ID.
6064
+ # However, specifying the source KMS key is always recommended as a
6065
+ # best practice. When you use the `SourceKeyId` parameter to specify a
6066
+ # KMS key, KMS uses only the KMS key you specify. If the ciphertext
6067
+ # was encrypted under a different KMS key, the `ReEncrypt` operation
5571
6068
  # fails. This practice ensures that you use the KMS key that you
5572
6069
  # intend.
5573
6070
  #
5574
6071
  # * To reencrypt the data, you must use the `DestinationKeyId` parameter
5575
6072
  # specify the KMS key that re-encrypts the data after it is decrypted.
5576
- # You can select a symmetric or asymmetric KMS key. If the destination
5577
- # KMS key is an asymmetric KMS key, you must also provide the
5578
- # encryption algorithm. The algorithm that you choose must be
5579
- # compatible with the KMS key.
6073
+ # If the destination KMS key is an asymmetric KMS key, you must also
6074
+ # provide the encryption algorithm. The algorithm that you choose must
6075
+ # be compatible with the KMS key.
5580
6076
  #
5581
6077
  # When you use an asymmetric KMS key to encrypt or reencrypt data, be
5582
6078
  # sure to record the KMS key and encryption algorithm that you choose.
@@ -5586,14 +6082,15 @@ module Aws::KMS
5586
6082
  # fails.
5587
6083
  #
5588
6084
  # You are not required to supply the key ID and encryption algorithm
5589
- # when you decrypt with symmetric KMS keys because KMS stores this
5590
- # information in the ciphertext blob. KMS cannot store metadata in
5591
- # ciphertext generated with asymmetric keys. The standard format for
5592
- # asymmetric key ciphertext does not include configurable fields.
6085
+ # when you decrypt with symmetric encryption KMS keys because KMS
6086
+ # stores this information in the ciphertext blob. KMS cannot store
6087
+ # metadata in ciphertext generated with asymmetric keys. The standard
6088
+ # format for asymmetric key ciphertext does not include configurable
6089
+ # fields.
5593
6090
  #
5594
6091
  # The KMS key that you use for this operation must be in a compatible
5595
- # key state. For details, see [Key state: Effect on your KMS key][6] in
5596
- # the *Key Management Service Developer Guide*.
6092
+ # key state. For details, see [Key states of KMS keys][6] in the *Key
6093
+ # Management Service Developer Guide*.
5597
6094
  #
5598
6095
  # **Cross-account use**\: Yes. The source KMS key and destination KMS
5599
6096
  # key can be in different Amazon Web Services accounts. Either or both
@@ -5644,13 +6141,14 @@ module Aws::KMS
5644
6141
  # ciphertext.
5645
6142
  #
5646
6143
  # An *encryption context* is a collection of non-secret key-value pairs
5647
- # that represents additional authenticated data. When you use an
6144
+ # that represent additional authenticated data. When you use an
5648
6145
  # encryption context to encrypt data, you must specify the same (an
5649
6146
  # exact case-sensitive match) encryption context to decrypt the data. An
5650
- # encryption context is optional when encrypting with a symmetric KMS
5651
- # key, but it is highly recommended.
6147
+ # encryption context is supported only on operations with symmetric
6148
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
6149
+ # an encryption context is optional, but it is strongly recommended.
5652
6150
  #
5653
- # For more information, see [Encryption Context][1] in the *Key
6151
+ # For more information, see [Encryption context][1] in the *Key
5654
6152
  # Management Service Developer Guide*.
5655
6153
  #
5656
6154
  #
@@ -5659,14 +6157,18 @@ module Aws::KMS
5659
6157
  #
5660
6158
  # @option params [String] :source_key_id
5661
6159
  # Specifies the KMS key that KMS will use to decrypt the ciphertext
5662
- # before it is re-encrypted. Enter a key ID of the KMS key that was used
5663
- # to encrypt the ciphertext.
6160
+ # before it is re-encrypted.
6161
+ #
6162
+ # Enter a key ID of the KMS key that was used to encrypt the ciphertext.
6163
+ # If you identify a different KMS key, the `ReEncrypt` operation throws
6164
+ # an `IncorrectKeyException`.
5664
6165
  #
5665
6166
  # This parameter is required only when the ciphertext was encrypted
5666
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
5667
- # get the KMS key from metadata that it adds to the symmetric ciphertext
5668
- # blob. However, it is always recommended as a best practice. This
5669
- # practice ensures that you use the KMS key that you intend.
6167
+ # under an asymmetric KMS key. If you used a symmetric encryption KMS
6168
+ # key, KMS can get the KMS key from metadata that it adds to the
6169
+ # symmetric ciphertext blob. However, it is always recommended as a best
6170
+ # practice. This practice ensures that you use the KMS key that you
6171
+ # intend.
5670
6172
  #
5671
6173
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5672
6174
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5689,9 +6191,9 @@ module Aws::KMS
5689
6191
  #
5690
6192
  # @option params [required, String] :destination_key_id
5691
6193
  # A unique identifier for the KMS key that is used to reencrypt the
5692
- # data. Specify a symmetric or asymmetric KMS key with a `KeyUsage`
5693
- # value of `ENCRYPT_DECRYPT`. To find the `KeyUsage` value of a KMS key,
5694
- # use the DescribeKey operation.
6194
+ # data. Specify a symmetric encryption KMS key or an asymmetric KMS key
6195
+ # with a `KeyUsage` value of `ENCRYPT_DECRYPT`. To find the `KeyUsage`
6196
+ # value of a KMS key, use the DescribeKey operation.
5695
6197
  #
5696
6198
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5697
6199
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5717,17 +6219,18 @@ module Aws::KMS
5717
6219
  # data.
5718
6220
  #
5719
6221
  # A destination encryption context is valid only when the destination
5720
- # KMS key is a symmetric KMS key. The standard ciphertext format for
5721
- # asymmetric KMS keys does not include fields for metadata.
6222
+ # KMS key is a symmetric encryption KMS key. The standard ciphertext
6223
+ # format for asymmetric KMS keys does not include fields for metadata.
5722
6224
  #
5723
6225
  # An *encryption context* is a collection of non-secret key-value pairs
5724
- # that represents additional authenticated data. When you use an
6226
+ # that represent additional authenticated data. When you use an
5725
6227
  # encryption context to encrypt data, you must specify the same (an
5726
6228
  # exact case-sensitive match) encryption context to decrypt the data. An
5727
- # encryption context is optional when encrypting with a symmetric KMS
5728
- # key, but it is highly recommended.
6229
+ # encryption context is supported only on operations with symmetric
6230
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
6231
+ # an encryption context is optional, but it is strongly recommended.
5729
6232
  #
5730
- # For more information, see [Encryption Context][1] in the *Key
6233
+ # For more information, see [Encryption context][1] in the *Key
5731
6234
  # Management Service Developer Guide*.
5732
6235
  #
5733
6236
  #
@@ -5737,8 +6240,8 @@ module Aws::KMS
5737
6240
  # @option params [String] :source_encryption_algorithm
5738
6241
  # Specifies the encryption algorithm that KMS will use to decrypt the
5739
6242
  # ciphertext before it is reencrypted. The default value,
5740
- # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric KMS
5741
- # keys.
6243
+ # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric
6244
+ # encryption KMS keys.
5742
6245
  #
5743
6246
  # Specify the same algorithm that was used to encrypt the ciphertext. If
5744
6247
  # you specify a different algorithm, the decrypt attempt fails.
@@ -5750,7 +6253,7 @@ module Aws::KMS
5750
6253
  # Specifies the encryption algorithm that KMS will use to reecrypt the
5751
6254
  # data after it has decrypted it. The default value,
5752
6255
  # `SYMMETRIC_DEFAULT`, represents the encryption algorithm used for
5753
- # symmetric KMS keys.
6256
+ # symmetric encryption KMS keys.
5754
6257
  #
5755
6258
  # This parameter is required only when the destination KMS key is an
5756
6259
  # asymmetric KMS key.
@@ -5805,8 +6308,8 @@ module Aws::KMS
5805
6308
  # destination_encryption_context: {
5806
6309
  # "EncryptionContextKey" => "EncryptionContextValue",
5807
6310
  # },
5808
- # source_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
5809
- # destination_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256
6311
+ # source_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, SM2PKE
6312
+ # destination_encryption_algorithm: "SYMMETRIC_DEFAULT", # accepts SYMMETRIC_DEFAULT, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, SM2PKE
5810
6313
  # grant_tokens: ["GrantTokenType"],
5811
6314
  # })
5812
6315
  #
@@ -5815,8 +6318,8 @@ module Aws::KMS
5815
6318
  # resp.ciphertext_blob #=> String
5816
6319
  # resp.source_key_id #=> String
5817
6320
  # resp.key_id #=> String
5818
- # resp.source_encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
5819
- # resp.destination_encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
6321
+ # resp.source_encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
6322
+ # resp.destination_encryption_algorithm #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
5820
6323
  #
5821
6324
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt AWS API Documentation
5822
6325
  #
@@ -5841,7 +6344,7 @@ module Aws::KMS
5841
6344
  # encrypt data in one Amazon Web Services Region and decrypt it in a
5842
6345
  # different Amazon Web Services Region without re-encrypting the data or
5843
6346
  # making a cross-Region call. For more information about multi-Region
5844
- # keys, see [Using multi-Region keys][1] in the *Key Management Service
6347
+ # keys, see [Multi-Region keys in KMS][1] in the *Key Management Service
5845
6348
  # Developer Guide*.
5846
6349
  #
5847
6350
  # A *replica key* is a fully-functional KMS key that can be used
@@ -5852,8 +6355,8 @@ module Aws::KMS
5852
6355
  # [automatic key rotation status][6]. KMS automatically synchronizes
5853
6356
  # these shared properties among related multi-Region keys. All other
5854
6357
  # properties of a replica key can differ, including its [key policy][7],
5855
- # [tags][8], [aliases][9], and [key state][10]. KMS pricing and quotas
5856
- # for KMS keys apply to each primary key and replica key.
6358
+ # [tags][8], [aliases][9], and [Key states of KMS keys][10]. KMS pricing
6359
+ # and quotas for KMS keys apply to each primary key and replica key.
5857
6360
  #
5858
6361
  # When this operation completes, the new replica key has a transient key
5859
6362
  # state of `Creating`. This key state changes to `Enabled` (or
@@ -5863,9 +6366,17 @@ module Aws::KMS
5863
6366
  # If you are creating and using the replica key programmatically, retry
5864
6367
  # on `KMSInvalidStateException` or call `DescribeKey` to check its
5865
6368
  # `KeyState` value before using it. For details about the `Creating` key
5866
- # state, see [Key state: Effect on your KMS
5867
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
5868
- # Service Developer Guide*.
6369
+ # state, see [Key states of KMS keys][10] in the *Key Management Service
6370
+ # Developer Guide*.
6371
+ #
6372
+ # You cannot create more than one replica of a primary key in any
6373
+ # Region. If the Region already includes a replica of the key you're
6374
+ # trying to replicate, `ReplicateKey` returns an
6375
+ # `AlreadyExistsException` error. If the key state of the existing
6376
+ # replica is `PendingDeletion`, you can cancel the scheduled key
6377
+ # deletion (CancelKeyDeletion) or wait for the key to be deleted. The
6378
+ # new replica key you create will have the same [shared properties][11]
6379
+ # as the original replica key.
5869
6380
  #
5870
6381
  # The CloudTrail log of a `ReplicateKey` operation records a
5871
6382
  # `ReplicateKey` operation in the primary key's Region and a CreateKey
@@ -5918,6 +6429,7 @@ module Aws::KMS
5918
6429
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html
5919
6430
  # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html
5920
6431
  # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
6432
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-sync-properties
5921
6433
  #
5922
6434
  # @option params [required, String] :key_id
5923
6435
  # Identifies the multi-Region primary key that is being replicated. To
@@ -5945,24 +6457,33 @@ module Aws::KMS
5945
6457
  # [KMS service endpoints][1] in the *Amazon Web Services General
5946
6458
  # Reference*.
5947
6459
  #
6460
+ # <note markdown="1"> HMAC KMS keys are not supported in all Amazon Web Services Regions. If
6461
+ # you try to replicate an HMAC KMS key in an Amazon Web Services Region
6462
+ # in which HMAC keys are not supported, the `ReplicateKey` operation
6463
+ # returns an `UnsupportedOperationException`. For a list of Regions in
6464
+ # which HMAC KMS keys are supported, see [HMAC keys in KMS][2] in the
6465
+ # *Key Management Service Developer Guide*.
6466
+ #
6467
+ # </note>
6468
+ #
5948
6469
  # The replica must be in a different Amazon Web Services Region than its
5949
6470
  # primary key and other replicas of that primary key, but in the same
5950
6471
  # Amazon Web Services partition. KMS must be available in the replica
5951
6472
  # Region. If the Region is not enabled by default, the Amazon Web
5952
- # Services account must be enabled in the Region.
5953
- #
5954
- # For information about Amazon Web Services partitions, see [Amazon
5955
- # Resource Names (ARNs) in the *Amazon Web Services General
5956
- # Reference*.][2] For information about enabling and disabling Regions,
5957
- # see [Enabling a Region][3] and [Disabling a Region][4] in the *Amazon
5958
- # Web Services General Reference*.
6473
+ # Services account must be enabled in the Region. For information about
6474
+ # Amazon Web Services partitions, see [Amazon Resource Names (ARNs)][3]
6475
+ # in the *Amazon Web Services General Reference*. For information about
6476
+ # enabling and disabling Regions, see [Enabling a Region][4] and
6477
+ # [Disabling a Region][5] in the *Amazon Web Services General
6478
+ # Reference*.
5959
6479
  #
5960
6480
  #
5961
6481
  #
5962
6482
  # [1]: https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region
5963
- # [2]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
5964
- # [3]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
5965
- # [4]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable
6483
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
6484
+ # [3]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
6485
+ # [4]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
6486
+ # [5]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable
5966
6487
  #
5967
6488
  # @option params [String] :policy
5968
6489
  # The key policy to attach to the KMS key. This parameter is optional.
@@ -5993,13 +6514,30 @@ module Aws::KMS
5993
6514
  # visible][3] in the <i> <i>Identity and Access Management User
5994
6515
  # Guide</i> </i>.
5995
6516
  #
5996
- # * The key policy size quota is 32 kilobytes (32768 bytes).
6517
+ # A key policy document can include only the following characters:
6518
+ #
6519
+ # * Printable ASCII characters from the space character (`\u0020`)
6520
+ # through the end of the ASCII character range.
6521
+ #
6522
+ # * Printable characters in the Basic Latin and Latin-1 Supplement
6523
+ # character set (through `\u00FF`).
6524
+ #
6525
+ # * The tab (`\u0009`), line feed (`\u000A`), and carriage return
6526
+ # (`\u000D`) special characters
6527
+ #
6528
+ # For information about key policies, see [Key policies in KMS][4] in
6529
+ # the *Key Management Service Developer Guide*. For help writing and
6530
+ # formatting a JSON policy document, see the [IAM JSON Policy
6531
+ # Reference][5] in the <i> <i>Identity and Access Management User
6532
+ # Guide</i> </i>.
5997
6533
  #
5998
6534
  #
5999
6535
  #
6000
6536
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
6001
6537
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
6002
6538
  # [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
6539
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
6540
+ # [5]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
6003
6541
  #
6004
6542
  # @option params [Boolean] :bypass_policy_lockout_safety_check
6005
6543
  # A flag to indicate whether to bypass the key policy lockout safety
@@ -6036,8 +6574,8 @@ module Aws::KMS
6036
6574
  # TagResource operation.
6037
6575
  #
6038
6576
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6039
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
6040
- # Service Developer Guide*.
6577
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
6578
+ # Developer Guide*.
6041
6579
  #
6042
6580
  # </note>
6043
6581
  #
@@ -6142,7 +6680,7 @@ module Aws::KMS
6142
6680
  # resp.replica_key_metadata.creation_date #=> Time
6143
6681
  # resp.replica_key_metadata.enabled #=> Boolean
6144
6682
  # resp.replica_key_metadata.description #=> String
6145
- # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
6683
+ # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
6146
6684
  # resp.replica_key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
6147
6685
  # resp.replica_key_metadata.deletion_date #=> Time
6148
6686
  # resp.replica_key_metadata.valid_to #=> Time
@@ -6151,12 +6689,12 @@ module Aws::KMS
6151
6689
  # resp.replica_key_metadata.cloud_hsm_cluster_id #=> String
6152
6690
  # resp.replica_key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
6153
6691
  # resp.replica_key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
6154
- # resp.replica_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"
6155
- # resp.replica_key_metadata.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"
6692
+ # resp.replica_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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
6693
+ # resp.replica_key_metadata.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", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
6156
6694
  # resp.replica_key_metadata.encryption_algorithms #=> Array
6157
- # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
6695
+ # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
6158
6696
  # resp.replica_key_metadata.signing_algorithms #=> Array
6159
- # resp.replica_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"
6697
+ # resp.replica_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", "SM2DSA"
6160
6698
  # resp.replica_key_metadata.multi_region #=> Boolean
6161
6699
  # resp.replica_key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
6162
6700
  # resp.replica_key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -6165,6 +6703,8 @@ module Aws::KMS
6165
6703
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
6166
6704
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].region #=> String
6167
6705
  # resp.replica_key_metadata.pending_deletion_window_in_days #=> Integer
6706
+ # resp.replica_key_metadata.mac_algorithms #=> Array
6707
+ # resp.replica_key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
6168
6708
  # resp.replica_policy #=> String
6169
6709
  # resp.replica_tags #=> Array
6170
6710
  # resp.replica_tags[0].tag_key #=> String
@@ -6186,14 +6726,13 @@ module Aws::KMS
6186
6726
  #
6187
6727
  # This operation can be called by the *retiring principal* for a grant,
6188
6728
  # by the *grantee principal* if the grant allows the `RetireGrant`
6189
- # operation, and by the Amazon Web Services account (root user) in which
6190
- # the grant is created. It can also be called by principals to whom
6191
- # permission for retiring a grant is delegated. For details, see
6192
- # [Retiring and revoking grants][2] in the *Key Management Service
6193
- # Developer Guide*.
6729
+ # operation, and by the Amazon Web Services account in which the grant
6730
+ # is created. It can also be called by principals to whom permission for
6731
+ # retiring a grant is delegated. For details, see [Retiring and revoking
6732
+ # grants][2] in the *Key Management Service Developer Guide*.
6194
6733
  #
6195
6734
  # For detailed information about grants, including grant terminology,
6196
- # see [Using grants][3] in the <i> <i>Key Management Service Developer
6735
+ # see [Grants in KMS][3] in the <i> <i>Key Management Service Developer
6197
6736
  # Guide</i> </i>. For examples of working with grants in several
6198
6737
  # programming languages, see [Programming grants][4].
6199
6738
  #
@@ -6291,7 +6830,7 @@ module Aws::KMS
6291
6830
  # Service Developer Guide</i> </i>.
6292
6831
  #
6293
6832
  # For detailed information about grants, including grant terminology,
6294
- # see [Using grants][3] in the <i> <i>Key Management Service Developer
6833
+ # see [Grants in KMS][3] in the <i> <i>Key Management Service Developer
6295
6834
  # Guide</i> </i>. For examples of working with grants in several
6296
6835
  # programming languages, see [Programming grants][4].
6297
6836
  #
@@ -6408,8 +6947,8 @@ module Aws::KMS
6408
6947
  # Guide*.
6409
6948
  #
6410
6949
  # The KMS key that you use for this operation must be in a compatible
6411
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6412
- # the *Key Management Service Developer Guide*.
6950
+ # key state. For details, see [Key states of KMS keys][5] in the *Key
6951
+ # Management Service Developer Guide*.
6413
6952
  #
6414
6953
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6415
6954
  # key in a different Amazon Web Services account.
@@ -6449,7 +6988,7 @@ module Aws::KMS
6449
6988
  # The waiting period, specified in number of days. After the waiting
6450
6989
  # period ends, KMS deletes the KMS key.
6451
6990
  #
6452
- # If the KMS key is a multi-Region primary key with replicas, the
6991
+ # If the KMS key is a multi-Region primary key with replica keys, the
6453
6992
  # waiting period begins when the last of its replica keys is deleted.
6454
6993
  # Otherwise, the waiting period begins immediately.
6455
6994
  #
@@ -6503,11 +7042,11 @@ module Aws::KMS
6503
7042
  end
6504
7043
 
6505
7044
  # Creates a [digital signature][1] for a message or message digest by
6506
- # using the private key in an asymmetric KMS key. To verify the
7045
+ # using the private key in an asymmetric signing KMS key. To verify the
6507
7046
  # signature, use the Verify operation, or use the public key in the same
6508
- # asymmetric KMS key outside of KMS. For information about symmetric and
6509
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][2]
6510
- # in the *Key Management Service Developer Guide*.
7047
+ # asymmetric KMS key outside of KMS. For information about asymmetric
7048
+ # KMS keys, see [Asymmetric KMS keys][2] in the *Key Management Service
7049
+ # Developer Guide*.
6511
7050
  #
6512
7051
  # Digital signatures are generated and verified by using asymmetric key
6513
7052
  # pair, such as an RSA or ECC pair that is represented by an asymmetric
@@ -6535,14 +7074,23 @@ module Aws::KMS
6535
7074
  # When signing a message, be sure to record the KMS key and the signing
6536
7075
  # algorithm. This information is required to verify the signature.
6537
7076
  #
7077
+ # <note markdown="1"> Best practices recommend that you limit the time during which any
7078
+ # signature is effective. This deters an attack where the actor uses a
7079
+ # signed message to establish validity repeatedly or long after the
7080
+ # message is superseded. Signatures do not include a timestamp, but you
7081
+ # can include a timestamp in the signed message to help you detect when
7082
+ # its time to refresh the signature.
7083
+ #
7084
+ # </note>
7085
+ #
6538
7086
  # To verify the signature that this operation generates, use the Verify
6539
7087
  # operation. Or use the GetPublicKey operation to download the public
6540
7088
  # key and then use the public key to verify the signature outside of
6541
7089
  # KMS.
6542
7090
  #
6543
7091
  # The KMS key that you use for this operation must be in a compatible
6544
- # key state. For details, see [Key state: Effect on your KMS key][3] in
6545
- # the *Key Management Service Developer Guide*.
7092
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
7093
+ # Management Service Developer Guide*.
6546
7094
  #
6547
7095
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
6548
7096
  # in a different Amazon Web Services account, specify the key ARN or
@@ -6648,14 +7196,14 @@ module Aws::KMS
6648
7196
  # message: "data", # required
6649
7197
  # message_type: "RAW", # accepts RAW, DIGEST
6650
7198
  # grant_tokens: ["GrantTokenType"],
6651
- # 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
7199
+ # 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, SM2DSA
6652
7200
  # })
6653
7201
  #
6654
7202
  # @example Response structure
6655
7203
  #
6656
7204
  # resp.key_id #=> String
6657
7205
  # resp.signature #=> String
6658
- # 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"
7206
+ # 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", "SM2DSA"
6659
7207
  #
6660
7208
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign AWS API Documentation
6661
7209
  #
@@ -6669,8 +7217,8 @@ module Aws::KMS
6669
7217
  # Adds or edits tags on a [customer managed key][1].
6670
7218
  #
6671
7219
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6672
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6673
- # Service Developer Guide*.
7220
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7221
+ # Developer Guide*.
6674
7222
  #
6675
7223
  # </note>
6676
7224
  #
@@ -6692,8 +7240,8 @@ module Aws::KMS
6692
7240
  # General Reference*.
6693
7241
  #
6694
7242
  # The KMS key that you use for this operation must be in a compatible
6695
- # key state. For details, see [Key state: Effect on your KMS key][9] in
6696
- # the *Key Management Service Developer Guide*.
7243
+ # key state. For details, see [Key states of KMS keys][9] in the *Key
7244
+ # Management Service Developer Guide*.
6697
7245
  #
6698
7246
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6699
7247
  # key in a different Amazon Web Services account.
@@ -6790,8 +7338,8 @@ module Aws::KMS
6790
7338
  # specify the tag key and the KMS key.
6791
7339
  #
6792
7340
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6793
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6794
- # Service Developer Guide*.
7341
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7342
+ # Developer Guide*.
6795
7343
  #
6796
7344
  # </note>
6797
7345
  #
@@ -6806,8 +7354,8 @@ module Aws::KMS
6806
7354
  # General Reference*.
6807
7355
  #
6808
7356
  # The KMS key that you use for this operation must be in a compatible
6809
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6810
- # the *Key Management Service Developer Guide*.
7357
+ # key state. For details, see [Key states of KMS keys][5] in the *Key
7358
+ # Management Service Developer Guide*.
6811
7359
  #
6812
7360
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6813
7361
  # key in a different Amazon Web Services account.
@@ -6888,8 +7436,8 @@ module Aws::KMS
6888
7436
  # Amazon Web Services account and Region.
6889
7437
  #
6890
7438
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
6891
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
6892
- # Management Service Developer Guide*.
7439
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
7440
+ # Service Developer Guide*.
6893
7441
  #
6894
7442
  # </note>
6895
7443
  #
@@ -6911,8 +7459,8 @@ module Aws::KMS
6911
7459
  # ListAliases operation.
6912
7460
  #
6913
7461
  # The KMS key that you use for this operation must be in a compatible
6914
- # key state. For details, see [Key state: Effect on your KMS key][2] in
6915
- # the *Key Management Service Developer Guide*.
7462
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
7463
+ # Management Service Developer Guide*.
6916
7464
  #
6917
7465
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6918
7466
  # key in a different Amazon Web Services account.
@@ -6946,7 +7494,7 @@ module Aws::KMS
6946
7494
  # @option params [required, String] :alias_name
6947
7495
  # Identifies the alias that is changing its KMS key. This value must
6948
7496
  # begin with `alias/` followed by the alias name, such as
6949
- # `alias/ExampleAlias`. You cannot use UpdateAlias to change the alias
7497
+ # `alias/ExampleAlias`. You cannot use `UpdateAlias` to change the alias
6950
7498
  # name.
6951
7499
  #
6952
7500
  # @option params [required, String] :target_key_id
@@ -7045,7 +7593,7 @@ module Aws::KMS
7045
7593
  # If the operation succeeds, it returns a JSON object with no
7046
7594
  # properties.
7047
7595
  #
7048
- # This operation is part of the [Custom Key Store feature][3] feature in
7596
+ # This operation is part of the [custom key store feature][3] feature in
7049
7597
  # KMS, which combines the convenience and extensive integration of KMS
7050
7598
  # with the isolation and control of a single-tenant key store.
7051
7599
  #
@@ -7177,8 +7725,8 @@ module Aws::KMS
7177
7725
  # key, use DescribeKey.
7178
7726
  #
7179
7727
  # The KMS key that you use for this operation must be in a compatible
7180
- # key state. For details, see [Key state: Effect on your KMS key][1] in
7181
- # the *Key Management Service Developer Guide*.
7728
+ # key state. For details, see [Key states of KMS keys][1] in the *Key
7729
+ # Management Service Developer Guide*.
7182
7730
  #
7183
7731
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
7184
7732
  # key in a different Amazon Web Services account.
@@ -7260,7 +7808,7 @@ module Aws::KMS
7260
7808
  # encrypt data in one Amazon Web Services Region and decrypt it in a
7261
7809
  # different Amazon Web Services Region without re-encrypting the data or
7262
7810
  # making a cross-Region call. For more information about multi-Region
7263
- # keys, see [Using multi-Region keys][2] in the *Key Management Service
7811
+ # keys, see [Multi-Region keys in KMS][2] in the *Key Management Service
7264
7812
  # Developer Guide*.
7265
7813
  #
7266
7814
  # The *primary key* of a multi-Region key is the source for properties
@@ -7290,9 +7838,8 @@ module Aws::KMS
7290
7838
  # can use the keys in cryptographic operations, but you cannot replicate
7291
7839
  # the new primary key or perform certain management operations, such as
7292
7840
  # enabling or disabling these keys. For details about the `Updating` key
7293
- # state, see [Key state: Effect on your KMS
7294
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
7295
- # Service Developer Guide*.
7841
+ # state, see [Key states of KMS keys][9] in the *Key Management Service
7842
+ # Developer Guide*.
7296
7843
  #
7297
7844
  # This operation does not return any output. To verify that primary key
7298
7845
  # is changed, use the DescribeKey operation.
@@ -7325,6 +7872,7 @@ module Aws::KMS
7325
7872
  # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin
7326
7873
  # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
7327
7874
  # [8]: https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html
7875
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
7328
7876
  #
7329
7877
  # @option params [required, String] :key_id
7330
7878
  # Identifies the current primary key. When the operation completes, this
@@ -7381,9 +7929,9 @@ module Aws::KMS
7381
7929
  #
7382
7930
  # A digital signature is generated by using the private key in an
7383
7931
  # asymmetric KMS key. The signature is verified by using the public key
7384
- # in the same asymmetric KMS key. For information about symmetric and
7385
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][1]
7386
- # in the *Key Management Service Developer Guide*.
7932
+ # in the same asymmetric KMS key. For information about asymmetric KMS
7933
+ # keys, see [Asymmetric KMS keys][1] in the *Key Management Service
7934
+ # Developer Guide*.
7387
7935
  #
7388
7936
  # To verify a digital signature, you can use the `Verify` operation.
7389
7937
  # Specify the same asymmetric KMS key, message, and signing algorithm
@@ -7392,7 +7940,11 @@ module Aws::KMS
7392
7940
  # You can also verify the digital signature by using the public key of
7393
7941
  # the KMS key outside of KMS. Use the GetPublicKey operation to download
7394
7942
  # the public key in the asymmetric KMS key and then use the public key
7395
- # to verify the signature outside of KMS. The advantage of using the
7943
+ # to verify the signature outside of KMS. To verify a signature outside
7944
+ # of KMS with an SM2 public key, you must specify the distinguishing ID.
7945
+ # By default, KMS uses `1234567812345678` as the distinguishing ID. For
7946
+ # more information, see [Offline verification with SM2 key pairs][2] in
7947
+ # *Key Management Service Developer Guide*. The advantage of using the
7396
7948
  # `Verify` operation is that it is performed within KMS. As a result,
7397
7949
  # it's easy to call, the operation is performed within the FIPS
7398
7950
  # boundary, it is logged in CloudTrail, and you can use key policy and
@@ -7400,22 +7952,23 @@ module Aws::KMS
7400
7952
  # signatures.
7401
7953
  #
7402
7954
  # The KMS key that you use for this operation must be in a compatible
7403
- # key state. For details, see [Key state: Effect on your KMS key][2] in
7404
- # the *Key Management Service Developer Guide*.
7955
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
7956
+ # Management Service Developer Guide*.
7405
7957
  #
7406
7958
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
7407
7959
  # in a different Amazon Web Services account, specify the key ARN or
7408
7960
  # alias ARN in the value of the `KeyId` parameter.
7409
7961
  #
7410
- # **Required permissions**\: [kms:Verify][3] (key policy)
7962
+ # **Required permissions**\: [kms:Verify][4] (key policy)
7411
7963
  #
7412
7964
  # **Related operations**\: Sign
7413
7965
  #
7414
7966
  #
7415
7967
  #
7416
7968
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
7417
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
7418
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
7969
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-sm-offline-verification
7970
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
7971
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
7419
7972
  #
7420
7973
  # @option params [required, String] :key_id
7421
7974
  # Identifies the asymmetric KMS key that will be used to verify the
@@ -7503,7 +8056,7 @@ module Aws::KMS
7503
8056
  # resp.to_h outputs the following:
7504
8057
  # {
7505
8058
  # key_id: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the asymmetric KMS key that was used to verify the digital signature.
7506
- # signature_valid: true, # Indicates whether the signature was verified (true) or failed verification (false).
8059
+ # signature_valid: true, # A value of 'true' Indicates that the signature was verified. If verification fails, the call to Verify fails.
7507
8060
  # signing_algorithm: "ECDSA_SHA_384", # The signing algorithm that was used to verify the signature.
7508
8061
  # }
7509
8062
  #
@@ -7514,7 +8067,7 @@ module Aws::KMS
7514
8067
  # message: "data", # required
7515
8068
  # message_type: "RAW", # accepts RAW, DIGEST
7516
8069
  # signature: "data", # required
7517
- # 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
8070
+ # 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, SM2DSA
7518
8071
  # grant_tokens: ["GrantTokenType"],
7519
8072
  # })
7520
8073
  #
@@ -7522,7 +8075,7 @@ module Aws::KMS
7522
8075
  #
7523
8076
  # resp.key_id #=> String
7524
8077
  # resp.signature_valid #=> Boolean
7525
- # 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"
8078
+ # 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", "SM2DSA"
7526
8079
  #
7527
8080
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify AWS API Documentation
7528
8081
  #
@@ -7533,6 +8086,128 @@ module Aws::KMS
7533
8086
  req.send_request(options)
7534
8087
  end
7535
8088
 
8089
+ # Verifies the hash-based message authentication code (HMAC) for a
8090
+ # specified message, HMAC KMS key, and MAC algorithm. To verify the
8091
+ # HMAC, `VerifyMac` computes an HMAC using the message, HMAC KMS key,
8092
+ # and MAC algorithm that you specify, and compares the computed HMAC to
8093
+ # the HMAC that you specify. If the HMACs are identical, the
8094
+ # verification succeeds; otherwise, it fails.
8095
+ #
8096
+ # Verification indicates that the message hasn't changed since the HMAC
8097
+ # was calculated, and the specified key was used to generate and verify
8098
+ # the HMAC.
8099
+ #
8100
+ # This operation is part of KMS support for HMAC KMS keys. For details,
8101
+ # see [HMAC keys in KMS][1] in the *Key Management Service Developer
8102
+ # Guide*.
8103
+ #
8104
+ # The KMS key that you use for this operation must be in a compatible
8105
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
8106
+ # Management Service Developer Guide*.
8107
+ #
8108
+ # **Cross-account use**\: Yes. To perform this operation with a KMS key
8109
+ # in a different Amazon Web Services account, specify the key ARN or
8110
+ # alias ARN in the value of the `KeyId` parameter.
8111
+ #
8112
+ # **Required permissions**\: [kms:VerifyMac][3] (key policy)
8113
+ #
8114
+ # **Related operations**\: GenerateMac
8115
+ #
8116
+ #
8117
+ #
8118
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
8119
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
8120
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
8121
+ #
8122
+ # @option params [required, String, StringIO, File] :message
8123
+ # The message that will be used in the verification. Enter the same
8124
+ # message that was used to generate the HMAC.
8125
+ #
8126
+ # GenerateMac and `VerifyMac` do not provide special handling for
8127
+ # message digests. If you generated an HMAC for a hash digest of a
8128
+ # message, you must verify the HMAC for the same hash digest.
8129
+ #
8130
+ # @option params [required, String] :key_id
8131
+ # The KMS key that will be used in the verification.
8132
+ #
8133
+ # Enter a key ID of the KMS key that was used to generate the HMAC. If
8134
+ # you identify a different KMS key, the `VerifyMac` operation fails.
8135
+ #
8136
+ # @option params [required, String] :mac_algorithm
8137
+ # The MAC algorithm that will be used in the verification. Enter the
8138
+ # same MAC algorithm that was used to compute the HMAC. This algorithm
8139
+ # must be supported by the HMAC KMS key identified by the `KeyId`
8140
+ # parameter.
8141
+ #
8142
+ # @option params [required, String, StringIO, File] :mac
8143
+ # The HMAC to verify. Enter the HMAC that was generated by the
8144
+ # GenerateMac operation when you specified the same message, HMAC KMS
8145
+ # key, and MAC algorithm as the values specified in this request.
8146
+ #
8147
+ # @option params [Array<String>] :grant_tokens
8148
+ # A list of grant tokens.
8149
+ #
8150
+ # Use a grant token when your permission to call this operation comes
8151
+ # from a new grant that has not yet achieved *eventual consistency*. For
8152
+ # more information, see [Grant token][1] and [Using a grant token][2] in
8153
+ # the *Key Management Service Developer Guide*.
8154
+ #
8155
+ #
8156
+ #
8157
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
8158
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
8159
+ #
8160
+ # @return [Types::VerifyMacResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
8161
+ #
8162
+ # * {Types::VerifyMacResponse#key_id #key_id} => String
8163
+ # * {Types::VerifyMacResponse#mac_valid #mac_valid} => Boolean
8164
+ # * {Types::VerifyMacResponse#mac_algorithm #mac_algorithm} => String
8165
+ #
8166
+ #
8167
+ # @example Example: To verify an HMAC
8168
+ #
8169
+ # # This example verifies an HMAC for a particular message, HMAC KMS keys, and MAC algorithm. A value of 'true' in the
8170
+ # # MacValid value in the response indicates that the HMAC is valid.
8171
+ #
8172
+ # resp = client.verify_mac({
8173
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The HMAC KMS key input to the HMAC algorithm.
8174
+ # mac: "<HMAC_TAG>", # The HMAC to be verified.
8175
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm requested for the operation.
8176
+ # message: "Hello World", # The message input to the HMAC algorithm.
8177
+ # })
8178
+ #
8179
+ # resp.to_h outputs the following:
8180
+ # {
8181
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the HMAC key used in the operation.
8182
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm used in the operation.
8183
+ # mac_valid: true, # A value of 'true' indicates that verification succeeded. If verification fails, the call to VerifyMac fails.
8184
+ # }
8185
+ #
8186
+ # @example Request syntax with placeholder values
8187
+ #
8188
+ # resp = client.verify_mac({
8189
+ # message: "data", # required
8190
+ # key_id: "KeyIdType", # required
8191
+ # mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
8192
+ # mac: "data", # required
8193
+ # grant_tokens: ["GrantTokenType"],
8194
+ # })
8195
+ #
8196
+ # @example Response structure
8197
+ #
8198
+ # resp.key_id #=> String
8199
+ # resp.mac_valid #=> Boolean
8200
+ # resp.mac_algorithm #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
8201
+ #
8202
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/VerifyMac AWS API Documentation
8203
+ #
8204
+ # @overload verify_mac(params = {})
8205
+ # @param [Hash] params ({})
8206
+ def verify_mac(params = {}, options = {})
8207
+ req = build_request(:verify_mac, params)
8208
+ req.send_request(options)
8209
+ end
8210
+
7536
8211
  # @!endgroup
7537
8212
 
7538
8213
  # @param params ({})
@@ -7546,7 +8221,7 @@ module Aws::KMS
7546
8221
  params: params,
7547
8222
  config: config)
7548
8223
  context[:gem_name] = 'aws-sdk-kms'
7549
- context[:gem_version] = '1.55.0'
8224
+ context[:gem_version] = '1.58.0'
7550
8225
  Seahorse::Client::Request.new(handlers, context)
7551
8226
  end
7552
8227