aws-sdk-kms 1.54.0 → 1.57.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,6 +27,7 @@ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
27
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
+ require 'aws-sdk-core/plugins/checksum_algorithm.rb'
30
31
  require 'aws-sdk-core/plugins/defaults_mode.rb'
31
32
  require 'aws-sdk-core/plugins/recursion_detection.rb'
32
33
  require 'aws-sdk-core/plugins/signature_v4.rb'
@@ -75,6 +76,7 @@ module Aws::KMS
75
76
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
76
77
  add_plugin(Aws::Plugins::TransferEncoding)
77
78
  add_plugin(Aws::Plugins::HttpChecksum)
79
+ add_plugin(Aws::Plugins::ChecksumAlgorithm)
78
80
  add_plugin(Aws::Plugins::DefaultsMode)
79
81
  add_plugin(Aws::Plugins::RecursionDetection)
80
82
  add_plugin(Aws::Plugins::SignatureV4)
@@ -368,8 +370,8 @@ module Aws::KMS
368
370
  # Developer Guide*.
369
371
  #
370
372
  # The KMS key that you use for this operation must be in a compatible
371
- # key state. For details, see [Key state: Effect on your KMS key][2] in
372
- # 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*.
373
375
  #
374
376
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
375
377
  # key in a different Amazon Web Services account.
@@ -542,8 +544,8 @@ module Aws::KMS
542
544
  # Creates a friendly name for a KMS key.
543
545
  #
544
546
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
545
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
546
- # Management Service Developer Guide*.
547
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
548
+ # Service Developer Guide*.
547
549
  #
548
550
  # </note>
549
551
  #
@@ -568,8 +570,8 @@ module Aws::KMS
568
570
  # created, use the ListAliases operation.
569
571
  #
570
572
  # The KMS key that you use for this operation must be in a compatible
571
- # key state. For details, see [Key state: Effect on your KMS key][4] in
572
- # 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*.
573
575
  #
574
576
  # **Cross-account use**\: No. You cannot perform this operation on an
575
577
  # alias in a different Amazon Web Services account.
@@ -810,7 +812,7 @@ module Aws::KMS
810
812
  # and delete it without changing your key policies or IAM policies.
811
813
  #
812
814
  # For detailed information about grants, including grant terminology,
813
- # 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
814
816
  # Guide</i> </i>. For examples of working with grants in several
815
817
  # programming languages, see [Programming grants][2].
816
818
  #
@@ -833,8 +835,8 @@ module Aws::KMS
833
835
  # the ListGrants or ListRetirableGrants operations.
834
836
  #
835
837
  # The KMS key that you use for this operation must be in a compatible
836
- # key state. For details, see [Key state: Effect on your KMS key][4] in
837
- # 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*.
838
840
  #
839
841
  # **Cross-account use**\: Yes. To perform this operation on a KMS key in
840
842
  # a different Amazon Web Services account, specify the key ARN in the
@@ -919,12 +921,13 @@ module Aws::KMS
919
921
  # @option params [required, Array<String>] :operations
920
922
  # A list of operations that the grant permits.
921
923
  #
922
- # The operation must be supported on the KMS key. For example, you
923
- # cannot create a grant for a symmetric KMS key that allows the Sign
924
- # operation, or a grant for an asymmetric KMS key that allows the
925
- # GenerateDataKey operation. If you try, KMS returns a `ValidationError`
926
- # exception. For details, see [Grant operations][1] in the *Key
927
- # 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*.
928
931
  #
929
932
  #
930
933
  #
@@ -936,27 +939,38 @@ module Aws::KMS
936
939
  # KMS supports the `EncryptionContextEquals` and
937
940
  # `EncryptionContextSubset` grant constraints. Each constraint value can
938
941
  # include up to 8 encryption context pairs. The encryption context value
939
- # in each constraint cannot exceed 384 characters.
940
- #
941
- # These grant constraints allow the permissions in the grant only when
942
- # the encryption context in the request matches
943
- # (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
944
- # the encryption context specified in this structure. For information
945
- # 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
946
944
  # Management Service Developer Guide*. For more information about
947
- # encryption context, see [Encryption Context][2] in the <i> <i>Key
945
+ # encryption context, see [Encryption context][2] in the <i> <i>Key
948
946
  # Management Service Developer Guide</i> </i>.
949
947
  #
950
- # The encryption context grant constraints are supported only on
951
- # operations that include an encryption context. You cannot use an
952
- # encryption context grant constraint for cryptographic operations with
953
- # asymmetric KMS keys or for management operations, such as DescribeKey
954
- # 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
+ #
955
968
  #
956
969
  #
957
970
  #
958
971
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints
959
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
960
974
  #
961
975
  # @option params [Array<String>] :grant_tokens
962
976
  # A list of grant tokens.
@@ -1018,7 +1032,7 @@ module Aws::KMS
1018
1032
  # key_id: "KeyIdType", # required
1019
1033
  # grantee_principal: "PrincipalIdType", # required
1020
1034
  # retiring_principal: "PrincipalIdType",
1021
- # 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
1022
1036
  # constraints: {
1023
1037
  # encryption_context_subset: {
1024
1038
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -1048,35 +1062,35 @@ module Aws::KMS
1048
1062
  # Creates a unique customer managed [KMS key][1] in your Amazon Web
1049
1063
  # Services account and Region.
1050
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
+ #
1051
1069
  # <note markdown="1"> KMS is replacing the term *customer master key (CMK)* with *KMS key*
1052
1070
  # and *KMS key*. The concept has not changed. To prevent breaking
1053
1071
  # changes, KMS is keeping some variations of this term.
1054
1072
  #
1055
1073
  # </note>
1056
1074
  #
1057
- # You can use the `CreateKey` operation to create symmetric or
1058
- # asymmetric KMS keys.
1075
+ # To create different types of KMS keys, use the following guidance:
1059
1076
  #
1060
- # * **Symmetric KMS keys** contain a 256-bit symmetric key that never
1061
- # leaves KMS unencrypted. To use the KMS key, you must call KMS. You
1062
- # can use a symmetric KMS key to encrypt and decrypt small amounts of
1063
- # data, but they are typically used to generate [data keys][2] and
1064
- # [data keys pairs][3]. For details, see GenerateDataKey and
1065
- # GenerateDataKeyPair.
1077
+ # Symmetric encryption KMS key
1066
1078
  #
1067
- # * **Asymmetric KMS keys** can contain an RSA key pair or an Elliptic
1068
- # Curve (ECC) key pair. The private key in an asymmetric KMS key never
1069
- # leaves KMS unencrypted. However, you can use the GetPublicKey
1070
- # operation to download the public key so it can be used outside of
1071
- # KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt
1072
- # data or sign and verify messages (but not both). KMS keys with ECC
1073
- # 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.
1083
+ #
1084
+ # If you need a key for basic encryption and decryption or you are
1085
+ # creating a KMS key to protect your resources in an Amazon Web
1086
+ # Services service, create a symmetric encryption KMS key. The key
1087
+ # material in a symmetric encryption key never leaves KMS unencrypted.
1088
+ # You can use a symmetric encryption KMS key to encrypt and decrypt
1089
+ # data up to 4,096 bytes, but they are typically used to generate data
1090
+ # keys and data keys pairs. For details, see GenerateDataKey and
1091
+ # GenerateDataKeyPair.
1074
1092
  #
1075
- # For information about symmetric and asymmetric KMS keys, see [Using
1076
- # Symmetric and Asymmetric KMS keys][4] in the *Key Management Service
1077
- # Developer Guide*.
1078
1093
  #
1079
- # To create different types of KMS keys, use the following guidance:
1080
1094
  #
1081
1095
  # Asymmetric KMS keys
1082
1096
  #
@@ -1086,14 +1100,37 @@ module Aws::KMS
1086
1100
  # to encrypt and decrypt or sign and verify. You can't change these
1087
1101
  # properties after the KMS key is created.
1088
1102
  #
1103
+ # Asymmetric KMS keys contain an RSA key pair or an Elliptic Curve
1104
+ # (ECC) key pair. The private key in an asymmetric KMS key never
1105
+ # leaves KMS unencrypted. However, you can use the GetPublicKey
1106
+ # operation to download the public key so it can be used outside of
1107
+ # KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt
1108
+ # data or sign and verify messages (but not both). KMS keys with ECC
1109
+ # key pairs can be used only to sign and verify messages. For
1110
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][2]
1111
+ # in the *Key Management Service Developer Guide*.
1089
1112
  #
1090
1113
  #
1091
- # Symmetric KMS keys
1092
1114
  #
1093
- # : When creating a symmetric KMS key, you don't need to specify the
1094
- # `KeySpec` or `KeyUsage` parameters. The default value for `KeySpec`,
1095
- # `SYMMETRIC_DEFAULT`, and the default value for `KeyUsage`,
1096
- # `ENCRYPT_DECRYPT`, are the only valid values for symmetric KMS keys.
1115
+ # HMAC KMS key
1116
+ #
1117
+ # : To create an HMAC KMS key, set the `KeySpec` parameter to a key spec
1118
+ # value for HMAC KMS keys. Then set the `KeyUsage` parameter to
1119
+ # `GENERATE_VERIFY_MAC`. You must set the key usage even though
1120
+ # `GENERATE_VERIFY_MAC` is the only valid key usage value for HMAC KMS
1121
+ # keys. You can't change these properties after the KMS key is
1122
+ # created.
1123
+ #
1124
+ # HMAC KMS keys are symmetric keys that never leave KMS unencrypted.
1125
+ # You can use HMAC keys to generate (GenerateMac) and verify
1126
+ # (VerifyMac) HMAC codes for messages up to 4096 bytes.
1127
+ #
1128
+ # HMAC KMS keys are not supported in all Amazon Web Services Regions.
1129
+ # If you try to create an HMAC KMS key in an Amazon Web Services
1130
+ # Region in which HMAC keys are not supported, the `CreateKey`
1131
+ # operation returns an `UnsupportedOperationException`. For a list of
1132
+ # Regions in which HMAC KMS keys are supported, see [HMAC keys in
1133
+ # KMS][3] in the *Key Management Service Developer Guide*.
1097
1134
  #
1098
1135
  #
1099
1136
  #
@@ -1108,6 +1145,12 @@ module Aws::KMS
1108
1145
  # operation. To change a replica key to a primary key, and its primary
1109
1146
  # key to a replica key, use the UpdatePrimaryRegion operation.
1110
1147
  #
1148
+ # You can create multi-Region KMS keys for all supported KMS key
1149
+ # types: symmetric encryption KMS keys, HMAC KMS keys, asymmetric
1150
+ # encryption KMS keys, and asymmetric signing KMS keys. You can also
1151
+ # create multi-Region keys with imported key material. However, you
1152
+ # can't create multi-Region keys in a custom key store.
1153
+ #
1111
1154
  # This operation supports *multi-Region keys*, an KMS feature that
1112
1155
  # lets you create multiple interoperable KMS keys in different Amazon
1113
1156
  # Web Services Regions. Because these KMS keys have the same key ID,
@@ -1115,57 +1158,57 @@ module Aws::KMS
1115
1158
  # to encrypt data in one Amazon Web Services Region and decrypt it in
1116
1159
  # a different Amazon Web Services Region without re-encrypting the
1117
1160
  # data or making a cross-Region call. For more information about
1118
- # multi-Region keys, see [Using multi-Region keys][5] in the *Key
1161
+ # multi-Region keys, see [Multi-Region keys in KMS][4] in the *Key
1119
1162
  # Management Service Developer Guide*.
1120
1163
  #
1121
- # You can create symmetric and asymmetric multi-Region keys and
1122
- # multi-Region keys with imported key material. You cannot create
1123
- # multi-Region keys in a custom key store.
1124
- #
1125
1164
  #
1126
1165
  #
1127
- # : To import your own key material, begin by creating a symmetric KMS
1128
- # key with no key material. To do this, use the `Origin` parameter of
1129
- # `CreateKey` with a value of `EXTERNAL`. Next, use
1130
- # GetParametersForImport operation to get a public key and import
1166
+ # : To import your own key material, begin by creating a symmetric
1167
+ # encryption KMS key with no key material. To do this, use the
1168
+ # `Origin` parameter of `CreateKey` with a value of `EXTERNAL`. Next,
1169
+ # use GetParametersForImport operation to get a public key and import
1131
1170
  # token, and use the public key to encrypt your key material. Then,
1132
1171
  # use ImportKeyMaterial with your import token to import the key
1133
1172
  # material. For step-by-step instructions, see [Importing Key
1134
- # Material][6] in the <i> <i>Key Management Service Developer
1135
- # Guide</i> </i>. You cannot import the key material into an
1136
- # asymmetric KMS key.
1173
+ # Material][5] in the <i> <i>Key Management Service Developer
1174
+ # Guide</i> </i>.
1175
+ #
1176
+ # This feature supports only symmetric encryption KMS keys, including
1177
+ # multi-Region symmetric encryption KMS keys. You cannot import key
1178
+ # material into any other type of KMS key.
1137
1179
  #
1138
1180
  # To create a multi-Region primary key with imported key material, use
1139
1181
  # the `Origin` parameter of `CreateKey` with a value of `EXTERNAL` and
1140
1182
  # the `MultiRegion` parameter with a value of `True`. To create
1141
1183
  # replicas of the multi-Region primary key, use the ReplicateKey
1142
- # operation. For more information about multi-Region keys, see [Using
1143
- # multi-Region keys][5] in the *Key Management Service Developer
1144
- # Guide*.
1184
+ # operation. For more information about multi-Region keys, see
1185
+ # [Multi-Region keys in KMS][4] in the *Key Management Service
1186
+ # Developer Guide*.
1145
1187
  #
1146
1188
  #
1147
1189
  #
1148
1190
  # Custom key store
1149
1191
  #
1150
- # : To create a symmetric KMS key in a [custom key store][7], use the
1151
- # `CustomKeyStoreId` parameter to specify the custom key store. You
1152
- # must also use the `Origin` parameter with a value of `AWS_CLOUDHSM`.
1153
- # The CloudHSM cluster that is associated with the custom key store
1154
- # must have at least two active HSMs in different Availability Zones
1155
- # in the Amazon Web Services Region.
1192
+ # : To create a symmetric encryption KMS key in a [custom key store][6],
1193
+ # use the `CustomKeyStoreId` parameter to specify the custom key
1194
+ # store. You must also use the `Origin` parameter with a value of
1195
+ # `AWS_CLOUDHSM`. The CloudHSM cluster that is associated with the
1196
+ # custom key store must have at least two active HSMs in different
1197
+ # Availability Zones in the Amazon Web Services Region.
1156
1198
  #
1157
- # You cannot create an asymmetric KMS key in a custom key store. For
1158
- # information about custom key stores in KMS see [Using Custom Key
1159
- # Stores][7] in the <i> <i>Key Management Service Developer Guide</i>
1160
- # </i>.
1199
+ # Custom key stores support only symmetric encryption KMS keys. You
1200
+ # cannot create an HMAC KMS key or an asymmetric KMS key in a custom
1201
+ # key store. For information about custom key stores in KMS see
1202
+ # [Custom key stores in KMS][6] in the <i> <i>Key Management Service
1203
+ # Developer Guide</i> </i>.
1161
1204
  #
1162
1205
  # **Cross-account use**\: No. You cannot use this operation to create a
1163
1206
  # KMS key in a different Amazon Web Services account.
1164
1207
  #
1165
- # **Required permissions**\: [kms:CreateKey][8] (IAM policy). To use the
1166
- # `Tags` parameter, [kms:TagResource][8] (IAM policy). For examples and
1208
+ # **Required permissions**\: [kms:CreateKey][7] (IAM policy). To use the
1209
+ # `Tags` parameter, [kms:TagResource][7] (IAM policy). For examples and
1167
1210
  # information about related permissions, see [Allow a user to create KMS
1168
- # keys][9] in the *Key Management Service Developer Guide*.
1211
+ # keys][8] in the *Key Management Service Developer Guide*.
1169
1212
  #
1170
1213
  # **Related operations:**
1171
1214
  #
@@ -1178,26 +1221,28 @@ module Aws::KMS
1178
1221
  #
1179
1222
  #
1180
1223
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys
1181
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
1182
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs
1183
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1184
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
1185
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
1186
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
1187
- # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
1188
- # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key
1224
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1225
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
1226
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
1227
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
1228
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
1229
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
1230
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key
1189
1231
  #
1190
1232
  # @option params [String] :policy
1191
- # The key policy to attach to the KMS key.
1233
+ # The key policy to attach to the KMS key. If you do not specify a key
1234
+ # policy, KMS attaches a default key policy to the KMS key. For more
1235
+ # information, see [Default key policy][1] in the *Key Management
1236
+ # Service Developer Guide*.
1192
1237
  #
1193
1238
  # If you provide a key policy, it must meet the following criteria:
1194
1239
  #
1195
- # * If you don't set `BypassPolicyLockoutSafetyCheck` to true, the key
1196
- # policy must allow the principal that is making the `CreateKey`
1240
+ # * If you don't set `BypassPolicyLockoutSafetyCheck` to `True`, the
1241
+ # key policy must allow the principal that is making the `CreateKey`
1197
1242
  # request to make a subsequent PutKeyPolicy request on the KMS key.
1198
1243
  # This reduces the risk that the KMS key becomes unmanageable. For
1199
1244
  # more information, refer to the scenario in the [Default Key
1200
- # Policy][1] section of the <i> <i>Key Management Service Developer
1245
+ # Policy][2] section of the <i> <i>Key Management Service Developer
1201
1246
  # Guide</i> </i>.
1202
1247
  #
1203
1248
  # * Each statement in the key policy must contain one or more
@@ -1207,14 +1252,23 @@ module Aws::KMS
1207
1252
  # delay before including the new principal in a key policy because the
1208
1253
  # new principal might not be immediately visible to KMS. For more
1209
1254
  # information, see [Changes that I make are not always immediately
1210
- # visible][2] in the *Amazon Web Services Identity and Access
1255
+ # visible][3] in the *Amazon Web Services Identity and Access
1211
1256
  # Management User Guide*.
1212
1257
  #
1213
- # If you do not provide a key policy, KMS attaches a default key policy
1214
- # to the KMS key. For more information, see [Default Key Policy][3] in
1215
- # the *Key Management Service Developer Guide*.
1258
+ # A key policy document must conform to the following rules.
1216
1259
  #
1217
- # The key policy size quota is 32 kilobytes (32768 bytes).
1260
+ # * Up to 32 kilobytes (32768 bytes)
1261
+ #
1262
+ # * Must be UTF-8 encoded
1263
+ #
1264
+ # * The only Unicode characters that are permitted in a key policy
1265
+ # document are the horizontal tab (U+0009), linefeed (U+000A),
1266
+ # carriage return (U+000D), and characters in the range U+0020 to
1267
+ # U+00FF.
1268
+ #
1269
+ # * The `Sid` element in a key policy statement can include spaces.
1270
+ # (Spaces are prohibited in the `Sid` element of an IAM policy
1271
+ # document.)
1218
1272
  #
1219
1273
  # For help writing and formatting a JSON policy document, see the [IAM
1220
1274
  # JSON Policy Reference][4] in the <i> <i>Identity and Access Management
@@ -1222,9 +1276,9 @@ module Aws::KMS
1222
1276
  #
1223
1277
  #
1224
1278
  #
1225
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
1226
- # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
1227
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
1279
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
1280
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
1281
+ # [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
1228
1282
  # [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
1229
1283
  #
1230
1284
  # @option params [String] :description
@@ -1240,14 +1294,17 @@ module Aws::KMS
1240
1294
  # @option params [String] :key_usage
1241
1295
  # Determines the [cryptographic operations][1] for which you can use the
1242
1296
  # KMS key. The default value is `ENCRYPT_DECRYPT`. This parameter is
1243
- # required only for asymmetric KMS keys. You can't change the
1244
- # `KeyUsage` value after the KMS key is created.
1297
+ # optional when you are creating a symmetric encryption KMS key;
1298
+ # otherwise, it is required. You can't change the `KeyUsage` value
1299
+ # after the KMS key is created.
1245
1300
  #
1246
1301
  # Select only one valid value.
1247
1302
  #
1248
- # * For symmetric KMS keys, omit the parameter or specify
1303
+ # * For symmetric encryption KMS keys, omit the parameter or specify
1249
1304
  # `ENCRYPT_DECRYPT`.
1250
1305
  #
1306
+ # * For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
1307
+ #
1251
1308
  # * For asymmetric KMS keys with RSA key material, specify
1252
1309
  # `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1253
1310
  #
@@ -1270,32 +1327,40 @@ module Aws::KMS
1270
1327
  # Specifies the type of KMS key to create. The default value,
1271
1328
  # `SYMMETRIC_DEFAULT`, creates a KMS key with a 256-bit symmetric key
1272
1329
  # for encryption and decryption. For help choosing a key spec for your
1273
- # KMS key, see [How to Choose Your KMS key Configuration][1] in the <i>
1274
- # <i>Key Management Service Developer Guide</i> </i>.
1330
+ # KMS key, see [Choosing a KMS key type][1] in the <i> <i>Key Management
1331
+ # Service Developer Guide</i> </i>.
1275
1332
  #
1276
1333
  # The `KeySpec` determines whether the KMS key contains a symmetric key
1277
- # or an asymmetric key pair. It also determines the encryption
1278
- # algorithms or signing algorithms that the KMS key supports. You can't
1279
- # change the `KeySpec` after the KMS key is created. To further restrict
1280
- # the algorithms that can be used with the KMS key, use a condition key
1281
- # in its key policy or IAM policy. For more information, see
1282
- # [kms:EncryptionAlgorithm][2] or [kms:Signing Algorithm][3] in the <i>
1283
- # <i>Key Management Service Developer Guide</i> </i>.
1284
- #
1285
- # [Amazon Web Services services that are integrated with KMS][4] use
1286
- # symmetric KMS keys to protect your data. These services do not support
1287
- # asymmetric KMS keys. For help determining whether a KMS key is
1288
- # symmetric or asymmetric, see [Identifying Symmetric and Asymmetric KMS
1289
- # keys][5] in the *Key Management Service Developer Guide*.
1334
+ # or an asymmetric key pair. It also determines the cryptographic
1335
+ # algorithms that the KMS key supports. You can't change the `KeySpec`
1336
+ # after the KMS key is created. To further restrict the algorithms that
1337
+ # can be used with the KMS key, use a condition key in its key policy or
1338
+ # IAM policy. For more information, see [kms:EncryptionAlgorithm][2],
1339
+ # [kms:MacAlgorithm][3] or [kms:Signing Algorithm][4] in the <i> <i>Key
1340
+ # Management Service Developer Guide</i> </i>.
1341
+ #
1342
+ # [Amazon Web Services services that are integrated with KMS][5] use
1343
+ # symmetric encryption KMS keys to protect your data. These services do
1344
+ # not support asymmetric KMS keys or HMAC KMS keys.
1290
1345
  #
1291
1346
  # KMS supports the following key specs for KMS keys:
1292
1347
  #
1293
- # * Symmetric key (default)
1348
+ # * Symmetric encryption key (default)
1294
1349
  #
1295
1350
  # * `SYMMETRIC_DEFAULT` (AES-256-GCM)
1296
1351
  #
1297
1352
  # ^
1298
1353
  #
1354
+ # * HMAC keys (symmetric)
1355
+ #
1356
+ # * `HMAC_224`
1357
+ #
1358
+ # * `HMAC_256`
1359
+ #
1360
+ # * `HMAC_384`
1361
+ #
1362
+ # * `HMAC_512`
1363
+ #
1299
1364
  # * Asymmetric RSA key pairs
1300
1365
  #
1301
1366
  # * `RSA_2048`
@@ -1320,11 +1385,11 @@ module Aws::KMS
1320
1385
  #
1321
1386
  #
1322
1387
  #
1323
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html
1388
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose
1324
1389
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm
1325
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1326
- # [4]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1327
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html
1390
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-mac-algorithm
1391
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1392
+ # [5]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1328
1393
  #
1329
1394
  # @option params [String] :origin
1330
1395
  # The source of the key material for the KMS key. You cannot change the
@@ -1335,13 +1400,13 @@ module Aws::KMS
1335
1400
  # set the value to `EXTERNAL`. For more information about importing key
1336
1401
  # material into KMS, see [Importing Key Material][1] in the *Key
1337
1402
  # Management Service Developer Guide*. This value is valid only for
1338
- # symmetric KMS keys.
1403
+ # symmetric encryption KMS keys.
1339
1404
  #
1340
1405
  # To create a KMS key in an KMS [custom key store][2] and create its key
1341
1406
  # material in the associated CloudHSM cluster, set this value to
1342
1407
  # `AWS_CLOUDHSM`. You must also use the `CustomKeyStoreId` parameter to
1343
1408
  # identify the custom key store. This value is valid only for symmetric
1344
- # KMS keys.
1409
+ # encryption KMS keys.
1345
1410
  #
1346
1411
  #
1347
1412
  #
@@ -1356,9 +1421,9 @@ module Aws::KMS
1356
1421
  # the custom key store must have at least two active HSMs, each in a
1357
1422
  # different Availability Zone in the Region.
1358
1423
  #
1359
- # This parameter is valid only for symmetric KMS keys and regional KMS
1360
- # keys. You cannot create an asymmetric KMS key or a multi-Region key in
1361
- # a custom key store.
1424
+ # This parameter is valid only for symmetric encryption KMS keys in a
1425
+ # single Region. You cannot create any other type of KMS key in a custom
1426
+ # key store.
1362
1427
  #
1363
1428
  # To find the ID of a custom key store, use the DescribeCustomKeyStores
1364
1429
  # operation.
@@ -1401,8 +1466,8 @@ module Aws::KMS
1401
1466
  # TagResource operation.
1402
1467
  #
1403
1468
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
1404
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
1405
- # Service Developer Guide*.
1469
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
1470
+ # Developer Guide*.
1406
1471
  #
1407
1472
  # </note>
1408
1473
  #
@@ -1442,15 +1507,16 @@ module Aws::KMS
1442
1507
  # encrypt data in one Amazon Web Services Region and decrypt it in a
1443
1508
  # different Amazon Web Services Region without re-encrypting the data or
1444
1509
  # making a cross-Region call. For more information about multi-Region
1445
- # keys, see [Using multi-Region keys][1] in the *Key Management Service
1510
+ # keys, see [Multi-Region keys in KMS][1] in the *Key Management Service
1446
1511
  # Developer Guide*.
1447
1512
  #
1448
1513
  # This value creates a *primary key*, not a replica. To create a
1449
1514
  # *replica key*, use the ReplicateKey operation.
1450
1515
  #
1451
- # You can create a symmetric or asymmetric multi-Region key, and you can
1452
- # create a multi-Region key with imported key material. However, you
1453
- # cannot create a multi-Region key in a custom key store.
1516
+ # You can create a multi-Region version of a symmetric encryption KMS
1517
+ # key, an HMAC KMS key, an asymmetric KMS key, or a KMS key with
1518
+ # imported key material. However, you cannot create a multi-Region key
1519
+ # in a custom key store.
1454
1520
  #
1455
1521
  #
1456
1522
  #
@@ -1663,14 +1729,46 @@ module Aws::KMS
1663
1729
  # }, # Detailed information about the KMS key that this operation creates.
1664
1730
  # }
1665
1731
  #
1732
+ # @example Example: To create an HMAC KMS key
1733
+ #
1734
+ # # This example creates a 384-bit symmetric HMAC KMS key. The GENERATE_VERIFY_MAC key usage value is required even though
1735
+ # # 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.
1736
+ #
1737
+ # resp = client.create_key({
1738
+ # key_spec: "HMAC_384", # Describes the type of key material in the KMS key.
1739
+ # key_usage: "GENERATE_VERIFY_MAC", # The cryptographic operations for which you can use the KMS key.
1740
+ # })
1741
+ #
1742
+ # resp.to_h outputs the following:
1743
+ # {
1744
+ # key_metadata: {
1745
+ # aws_account_id: "111122223333",
1746
+ # arn: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
1747
+ # creation_date: Time.parse("2022-04-05T14:04:55-07:00"),
1748
+ # customer_master_key_spec: "HMAC_384",
1749
+ # description: "",
1750
+ # enabled: true,
1751
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
1752
+ # key_manager: "CUSTOMER",
1753
+ # key_spec: "HMAC_384",
1754
+ # key_state: "Enabled",
1755
+ # key_usage: "GENERATE_VERIFY_MAC",
1756
+ # mac_algorithms: [
1757
+ # "HMAC_SHA_384",
1758
+ # ],
1759
+ # multi_region: false,
1760
+ # origin: "AWS_KMS",
1761
+ # }, # Detailed information about the KMS key that this operation creates.
1762
+ # }
1763
+ #
1666
1764
  # @example Request syntax with placeholder values
1667
1765
  #
1668
1766
  # resp = client.create_key({
1669
1767
  # policy: "PolicyType",
1670
1768
  # description: "DescriptionType",
1671
- # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT
1672
- # 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
1673
- # 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
1769
+ # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
1770
+ # 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
1771
+ # 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
1674
1772
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM
1675
1773
  # custom_key_store_id: "CustomKeyStoreIdType",
1676
1774
  # bypass_policy_lockout_safety_check: false,
@@ -1691,7 +1789,7 @@ module Aws::KMS
1691
1789
  # resp.key_metadata.creation_date #=> Time
1692
1790
  # resp.key_metadata.enabled #=> Boolean
1693
1791
  # resp.key_metadata.description #=> String
1694
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
1792
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
1695
1793
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
1696
1794
  # resp.key_metadata.deletion_date #=> Time
1697
1795
  # resp.key_metadata.valid_to #=> Time
@@ -1700,8 +1798,8 @@ module Aws::KMS
1700
1798
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
1701
1799
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
1702
1800
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
1703
- # 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"
1704
- # 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"
1801
+ # 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"
1802
+ # 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"
1705
1803
  # resp.key_metadata.encryption_algorithms #=> Array
1706
1804
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1707
1805
  # resp.key_metadata.signing_algorithms #=> Array
@@ -1714,6 +1812,8 @@ module Aws::KMS
1714
1812
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
1715
1813
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
1716
1814
  # resp.key_metadata.pending_deletion_window_in_days #=> Integer
1815
+ # resp.key_metadata.mac_algorithms #=> Array
1816
+ # resp.key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
1717
1817
  #
1718
1818
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey AWS API Documentation
1719
1819
  #
@@ -1738,29 +1838,30 @@ module Aws::KMS
1738
1838
  # * GenerateDataKeyPairWithoutPlaintext
1739
1839
  #
1740
1840
  # You can use this operation to decrypt ciphertext that was encrypted
1741
- # under a symmetric or asymmetric KMS key. When the KMS key is
1742
- # asymmetric, you must specify the KMS key and the encryption algorithm
1743
- # that was used to encrypt the ciphertext. For information about
1744
- # symmetric and asymmetric KMS keys, see [Using Symmetric and Asymmetric
1745
- # KMS keys][1] in the *Key Management Service Developer Guide*.
1841
+ # under a symmetric encryption KMS key or an asymmetric encryption KMS
1842
+ # key. When the KMS key is asymmetric, you must specify the KMS key and
1843
+ # the encryption algorithm that was used to encrypt the ciphertext. For
1844
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
1845
+ # the *Key Management Service Developer Guide*.
1746
1846
  #
1747
- # The Decrypt operation also decrypts ciphertext that was encrypted
1847
+ # The `Decrypt` operation also decrypts ciphertext that was encrypted
1748
1848
  # outside of KMS by the public key in an KMS asymmetric KMS key.
1749
1849
  # However, it cannot decrypt ciphertext produced by other libraries,
1750
1850
  # such as the [Amazon Web Services Encryption SDK][2] or [Amazon S3
1751
1851
  # client-side encryption][3]. These libraries return a ciphertext format
1752
1852
  # that is incompatible with KMS.
1753
1853
  #
1754
- # If the ciphertext was encrypted under a symmetric KMS key, the `KeyId`
1755
- # parameter is optional. KMS can get this information from metadata that
1756
- # it adds to the symmetric ciphertext blob. This feature adds durability
1757
- # to your implementation by ensuring that authorized users can decrypt
1758
- # ciphertext decades after it was encrypted, even if they've lost track
1759
- # of the key ID. However, specifying the KMS key is always recommended
1760
- # as a best practice. When you use the `KeyId` parameter to specify a
1761
- # KMS key, KMS only uses the KMS key you specify. If the ciphertext was
1762
- # encrypted under a different KMS key, the `Decrypt` operation fails.
1763
- # This practice ensures that you use the KMS key that you intend.
1854
+ # If the ciphertext was encrypted under a symmetric encryption KMS key,
1855
+ # the `KeyId` parameter is optional. KMS can get this information from
1856
+ # metadata that it adds to the symmetric ciphertext blob. This feature
1857
+ # adds durability to your implementation by ensuring that authorized
1858
+ # users can decrypt ciphertext decades after it was encrypted, even if
1859
+ # they've lost track of the key ID. However, specifying the KMS key is
1860
+ # always recommended as a best practice. When you use the `KeyId`
1861
+ # parameter to specify a KMS key, KMS only uses the KMS key you specify.
1862
+ # If the ciphertext was encrypted under a different KMS key, the
1863
+ # `Decrypt` operation fails. This practice ensures that you use the KMS
1864
+ # key that you intend.
1764
1865
  #
1765
1866
  # Whenever possible, use key policies to give users permission to call
1766
1867
  # the `Decrypt` operation on a particular KMS key, instead of using IAM
@@ -1779,8 +1880,8 @@ module Aws::KMS
1779
1880
  # Service Developer Guide*.
1780
1881
  #
1781
1882
  # The KMS key that you use for this operation must be in a compatible
1782
- # key state. For details, see [Key state: Effect on your KMS key][7] in
1783
- # the *Key Management Service Developer Guide*.
1883
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
1884
+ # Management Service Developer Guide*.
1784
1885
  #
1785
1886
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
1786
1887
  # in a different Amazon Web Services account, specify the key ARN or
@@ -1815,17 +1916,19 @@ module Aws::KMS
1815
1916
  # @option params [Hash<String,String>] :encryption_context
1816
1917
  # Specifies the encryption context to use when decrypting the data. An
1817
1918
  # encryption context is valid only for [cryptographic operations][1]
1818
- # with a symmetric KMS key. The standard asymmetric encryption
1819
- # algorithms that KMS uses do not support an encryption context.
1919
+ # with a symmetric encryption KMS key. The standard asymmetric
1920
+ # encryption algorithms and HMAC algorithms that KMS uses do not support
1921
+ # an encryption context.
1820
1922
  #
1821
1923
  # An *encryption context* is a collection of non-secret key-value pairs
1822
- # that represents additional authenticated data. When you use an
1924
+ # that represent additional authenticated data. When you use an
1823
1925
  # encryption context to encrypt data, you must specify the same (an
1824
1926
  # exact case-sensitive match) encryption context to decrypt the data. An
1825
- # encryption context is optional when encrypting with a symmetric KMS
1826
- # key, but it is highly recommended.
1927
+ # encryption context is supported only on operations with symmetric
1928
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
1929
+ # an encryption context is optional, but it is strongly recommended.
1827
1930
  #
1828
- # For more information, see [Encryption Context][2] in the *Key
1931
+ # For more information, see [Encryption context][2] in the *Key
1829
1932
  # Management Service Developer Guide*.
1830
1933
  #
1831
1934
  #
@@ -1847,14 +1950,18 @@ module Aws::KMS
1847
1950
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
1848
1951
  #
1849
1952
  # @option params [String] :key_id
1850
- # Specifies the KMS key that KMS uses to decrypt the ciphertext. Enter a
1851
- # key ID of the KMS key that was used to encrypt the ciphertext.
1953
+ # Specifies the KMS key that KMS uses to decrypt the ciphertext.
1954
+ #
1955
+ # Enter a key ID of the KMS key that was used to encrypt the ciphertext.
1956
+ # If you identify a different KMS key, the `Decrypt` operation throws an
1957
+ # `IncorrectKeyException`.
1852
1958
  #
1853
1959
  # This parameter is required only when the ciphertext was encrypted
1854
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
1855
- # get the KMS key from metadata that it adds to the symmetric ciphertext
1856
- # blob. However, it is always recommended as a best practice. This
1857
- # practice ensures that you use the KMS key that you intend.
1960
+ # under an asymmetric KMS key. If you used a symmetric encryption KMS
1961
+ # key, KMS can get the KMS key from metadata that it adds to the
1962
+ # symmetric ciphertext blob. However, it is always recommended as a best
1963
+ # practice. This practice ensures that you use the KMS key that you
1964
+ # intend.
1858
1965
  #
1859
1966
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
1860
1967
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -1884,7 +1991,7 @@ module Aws::KMS
1884
1991
  # This parameter is required only when the ciphertext was encrypted
1885
1992
  # under an asymmetric KMS key. The default value, `SYMMETRIC_DEFAULT`,
1886
1993
  # represents the only supported algorithm that is valid for symmetric
1887
- # KMS keys.
1994
+ # encryption KMS keys.
1888
1995
  #
1889
1996
  # @return [Types::DecryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1890
1997
  #
@@ -1938,8 +2045,8 @@ module Aws::KMS
1938
2045
  # Deletes the specified alias.
1939
2046
  #
1940
2047
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
1941
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
1942
- # Management Service Developer Guide*.
2048
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
2049
+ # Service Developer Guide*.
1943
2050
  #
1944
2051
  # </note>
1945
2052
  #
@@ -2114,8 +2221,8 @@ module Aws::KMS
2114
2221
  # reimport the same key material into the KMS key.
2115
2222
  #
2116
2223
  # The KMS key that you use for this operation must be in a compatible
2117
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2118
- # the *Key Management Service Developer Guide*.
2224
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2225
+ # Management Service Developer Guide*.
2119
2226
  #
2120
2227
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2121
2228
  # key in a different Amazon Web Services account.
@@ -2341,14 +2448,13 @@ module Aws::KMS
2341
2448
  # This detailed information includes the key ARN, creation date (and
2342
2449
  # deletion date, if applicable), the key state, and the origin and
2343
2450
  # expiration date (if any) of the key material. It includes fields, like
2344
- # `KeySpec`, that help you distinguish symmetric from asymmetric KMS
2345
- # keys. It also provides information that is particularly important to
2346
- # asymmetric keys, such as the key usage (encryption or signing) and the
2347
- # encryption algorithms or signing algorithms that the KMS key supports.
2348
- # For KMS keys in custom key stores, it includes information about the
2349
- # custom key store, such as the key store ID and the CloudHSM cluster
2350
- # ID. For multi-Region keys, it displays the primary key and all related
2351
- # replica keys.
2451
+ # `KeySpec`, that help you distinguish different types of KMS keys. It
2452
+ # also displays the key usage (encryption, signing, or generating and
2453
+ # verifying MACs) and the algorithms that the KMS key supports. For KMS
2454
+ # keys in custom key stores, it includes information about the custom
2455
+ # key store, such as the key store ID and the CloudHSM cluster ID. For
2456
+ # multi-Region keys, it displays the primary key and all related replica
2457
+ # keys.
2352
2458
  #
2353
2459
  # `DescribeKey` does not return the following information:
2354
2460
  #
@@ -2366,11 +2472,10 @@ module Aws::KMS
2366
2472
  # * Key policies and grants on the KMS key. To get this information, use
2367
2473
  # GetKeyPolicy and ListGrants.
2368
2474
  #
2369
- # If you call the `DescribeKey` operation on a *predefined Amazon Web
2370
- # Services alias*, that is, an Amazon Web Services alias with no key ID,
2371
- # KMS creates an [Amazon Web Services managed key][2]. Then, it
2372
- # associates the alias with the new KMS key, and returns the `KeyId` and
2373
- # `Arn` of the new KMS key in the response.
2475
+ # In general, `DescribeKey` is a non-mutating operation. It returns data
2476
+ # about KMS keys, but doesn't change them. However, Amazon Web Services
2477
+ # services use `DescribeKey` to create [Amazon Web Services managed
2478
+ # keys][2] from a *predefined Amazon Web Services alias* with no key ID.
2374
2479
  #
2375
2480
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2376
2481
  # in a different Amazon Web Services account, specify the key ARN or
@@ -2452,10 +2557,10 @@ module Aws::KMS
2452
2557
  #
2453
2558
  # @example Example: To get details about a KMS key
2454
2559
  #
2455
- # # The following example gets metadata about a symmetric KMS key.
2560
+ # # The following example gets metadata for a symmetric encryption KMS key.
2456
2561
  #
2457
2562
  # resp = client.describe_key({
2458
- # 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.
2563
+ # 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.
2459
2564
  # })
2460
2565
  #
2461
2566
  # resp.to_h outputs the following:
@@ -2480,6 +2585,121 @@ module Aws::KMS
2480
2585
  # }, # An object that contains information about the specified KMS key.
2481
2586
  # }
2482
2587
  #
2588
+ # @example Example: To get details about an RSA asymmetric KMS key
2589
+ #
2590
+ # # The following example gets metadata for an asymmetric RSA KMS key used for signing and verification.
2591
+ #
2592
+ # resp = client.describe_key({
2593
+ # 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.
2594
+ # })
2595
+ #
2596
+ # resp.to_h outputs the following:
2597
+ # {
2598
+ # key_metadata: {
2599
+ # aws_account_id: "111122223333",
2600
+ # arn: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
2601
+ # creation_date: Time.parse(1571767572.317),
2602
+ # customer_master_key_spec: "RSA_2048",
2603
+ # description: "",
2604
+ # enabled: false,
2605
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
2606
+ # key_manager: "CUSTOMER",
2607
+ # key_spec: "RSA_2048",
2608
+ # key_state: "Disabled",
2609
+ # key_usage: "SIGN_VERIFY",
2610
+ # multi_region: false,
2611
+ # origin: "AWS_KMS",
2612
+ # signing_algorithms: [
2613
+ # "RSASSA_PKCS1_V1_5_SHA_256",
2614
+ # "RSASSA_PKCS1_V1_5_SHA_384",
2615
+ # "RSASSA_PKCS1_V1_5_SHA_512",
2616
+ # "RSASSA_PSS_SHA_256",
2617
+ # "RSASSA_PSS_SHA_384",
2618
+ # "RSASSA_PSS_SHA_512",
2619
+ # ],
2620
+ # }, # An object that contains information about the specified KMS key.
2621
+ # }
2622
+ #
2623
+ # @example Example: To get details about a multi-Region key
2624
+ #
2625
+ # # The following example gets metadata for a multi-Region replica key. This multi-Region key is a symmetric encryption key.
2626
+ # # DescribeKey returns information about the primary key and all of its replicas.
2627
+ #
2628
+ # resp = client.describe_key({
2629
+ # 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.
2630
+ # })
2631
+ #
2632
+ # resp.to_h outputs the following:
2633
+ # {
2634
+ # key_metadata: {
2635
+ # aws_account_id: "111122223333",
2636
+ # arn: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2637
+ # creation_date: Time.parse(1586329200.918),
2638
+ # customer_master_key_spec: "SYMMETRIC_DEFAULT",
2639
+ # description: "",
2640
+ # enabled: true,
2641
+ # encryption_algorithms: [
2642
+ # "SYMMETRIC_DEFAULT",
2643
+ # ],
2644
+ # key_id: "mrk-1234abcd12ab34cd56ef1234567890ab",
2645
+ # key_manager: "CUSTOMER",
2646
+ # key_state: "Enabled",
2647
+ # key_usage: "ENCRYPT_DECRYPT",
2648
+ # multi_region: true,
2649
+ # multi_region_configuration: {
2650
+ # multi_region_key_type: "PRIMARY",
2651
+ # primary_key: {
2652
+ # arn: "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2653
+ # region: "us-west-2",
2654
+ # },
2655
+ # replica_keys: [
2656
+ # {
2657
+ # arn: "arn:aws:kms:eu-west-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2658
+ # region: "eu-west-1",
2659
+ # },
2660
+ # {
2661
+ # arn: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2662
+ # region: "ap-northeast-1",
2663
+ # },
2664
+ # {
2665
+ # arn: "arn:aws:kms:sa-east-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2666
+ # region: "sa-east-1",
2667
+ # },
2668
+ # ],
2669
+ # },
2670
+ # origin: "AWS_KMS",
2671
+ # }, # An object that contains information about the specified KMS key.
2672
+ # }
2673
+ #
2674
+ # @example Example: To get details about an HMAC KMS key
2675
+ #
2676
+ # # The following example gets the metadata of an HMAC KMS key.
2677
+ #
2678
+ # resp = client.describe_key({
2679
+ # 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.
2680
+ # })
2681
+ #
2682
+ # resp.to_h outputs the following:
2683
+ # {
2684
+ # key_metadata: {
2685
+ # aws_account_id: "123456789012",
2686
+ # arn: "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
2687
+ # creation_date: Time.parse(1566160362.664),
2688
+ # customer_master_key_spec: "HMAC_256",
2689
+ # description: "Development test key",
2690
+ # enabled: true,
2691
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
2692
+ # key_manager: "CUSTOMER",
2693
+ # key_state: "Enabled",
2694
+ # key_usage: "GENERATE_VERIFY_MAC",
2695
+ # mac_algorithms: [
2696
+ # "HMAC_SHA_256",
2697
+ # ],
2698
+ # multi_region: false,
2699
+ # origin: "AWS_KMS",
2700
+ # }, # An object that contains information about the specified KMS key.
2701
+ # }
2702
+ #
2483
2703
  # @example Request syntax with placeholder values
2484
2704
  #
2485
2705
  # resp = client.describe_key({
@@ -2495,7 +2715,7 @@ module Aws::KMS
2495
2715
  # resp.key_metadata.creation_date #=> Time
2496
2716
  # resp.key_metadata.enabled #=> Boolean
2497
2717
  # resp.key_metadata.description #=> String
2498
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
2718
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
2499
2719
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
2500
2720
  # resp.key_metadata.deletion_date #=> Time
2501
2721
  # resp.key_metadata.valid_to #=> Time
@@ -2504,8 +2724,8 @@ module Aws::KMS
2504
2724
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
2505
2725
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
2506
2726
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
2507
- # 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"
2508
- # 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"
2727
+ # 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"
2728
+ # 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"
2509
2729
  # resp.key_metadata.encryption_algorithms #=> Array
2510
2730
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
2511
2731
  # resp.key_metadata.signing_algorithms #=> Array
@@ -2518,6 +2738,8 @@ module Aws::KMS
2518
2738
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
2519
2739
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
2520
2740
  # resp.key_metadata.pending_deletion_window_in_days #=> Integer
2741
+ # resp.key_metadata.mac_algorithms #=> Array
2742
+ # resp.key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
2521
2743
  #
2522
2744
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey AWS API Documentation
2523
2745
  #
@@ -2532,12 +2754,12 @@ module Aws::KMS
2532
2754
  # prevents use of the KMS key for [cryptographic operations][1].
2533
2755
  #
2534
2756
  # For more information about how key state affects the use of a KMS key,
2535
- # see [Key state: Effect on your KMS key][2] in the <i> <i>Key
2536
- # Management Service Developer Guide</i> </i>.
2757
+ # see [Key states of KMS keys][2] in the <i> <i>Key Management Service
2758
+ # Developer Guide</i> </i>.
2537
2759
  #
2538
2760
  # The KMS key that you use for this operation must be in a compatible
2539
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2540
- # the *Key Management Service Developer Guide*.
2761
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2762
+ # Management Service Developer Guide*.
2541
2763
  #
2542
2764
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2543
2765
  # key in a different Amazon Web Services account.
@@ -2593,22 +2815,37 @@ module Aws::KMS
2593
2815
  req.send_request(options)
2594
2816
  end
2595
2817
 
2596
- # Disables [automatic rotation of the key material][1] for the specified
2597
- # symmetric KMS key.
2818
+ # Disables [automatic rotation of the key material][1] of the specified
2819
+ # symmetric encryption KMS key.
2820
+ #
2821
+ # Automatic key rotation is supported only on symmetric encryption KMS
2822
+ # keys. You cannot enable or disable automatic rotation of [asymmetric
2823
+ # KMS keys][2], [HMAC KMS keys][3], KMS keys with [imported key
2824
+ # material][4], or KMS keys in a [custom key store][5]. The key rotation
2825
+ # status of these KMS keys is always `false`. To enable or disable
2826
+ # automatic rotation of a set of related [multi-Region keys][6], set the
2827
+ # property on the primary key.
2828
+ #
2829
+ # You can enable (EnableKeyRotation) and disable automatic rotation of
2830
+ # the key material in [customer managed KMS keys][7]. Key material
2831
+ # rotation of [Amazon Web Services managed KMS keys][8] is not
2832
+ # configurable. KMS always rotates the key material for every year.
2833
+ # Rotation of [Amazon Web Services owned KMS keys][9] varies.
2834
+ #
2835
+ # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
2836
+ # managed keys from every three years to every year. For details, see
2837
+ # EnableKeyRotation.
2598
2838
  #
2599
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2600
- # keys with [imported key material][3], or KMS keys in a [custom key
2601
- # store][4]. To enable or disable automatic rotation of a set of related
2602
- # [multi-Region keys][5], set the property on the primary key.
2839
+ # </note>
2603
2840
  #
2604
2841
  # The KMS key that you use for this operation must be in a compatible
2605
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2606
- # the *Key Management Service Developer Guide*.
2842
+ # key state. For details, see [Key states of KMS keys][10] in the *Key
2843
+ # Management Service Developer Guide*.
2607
2844
  #
2608
2845
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2609
2846
  # key in a different Amazon Web Services account.
2610
2847
  #
2611
- # **Required permissions**\: [kms:DisableKeyRotation][7] (key policy)
2848
+ # **Required permissions**\: [kms:DisableKeyRotation][11] (key policy)
2612
2849
  #
2613
2850
  # **Related operations:**
2614
2851
  #
@@ -2619,17 +2856,22 @@ module Aws::KMS
2619
2856
  #
2620
2857
  #
2621
2858
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2622
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2623
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2624
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2625
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2626
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2627
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2859
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
2860
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
2861
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2862
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2863
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
2864
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
2865
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
2866
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
2867
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2868
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2628
2869
  #
2629
2870
  # @option params [required, String] :key_id
2630
- # Identifies a symmetric KMS key. You cannot enable or disable automatic
2631
- # rotation of [asymmetric KMS keys][1], KMS keys with [imported key
2632
- # material][2], or KMS keys in a [custom key store][3].
2871
+ # Identifies a symmetric encryption KMS key. You cannot enable or
2872
+ # disable automatic rotation of [asymmetric KMS keys][1], [HMAC KMS
2873
+ # keys][2], KMS keys with [imported key material][3], or KMS keys in a
2874
+ # [custom key store][4].
2633
2875
  #
2634
2876
  # Specify the key ID or key ARN of the KMS key.
2635
2877
  #
@@ -2646,8 +2888,9 @@ module Aws::KMS
2646
2888
  #
2647
2889
  #
2648
2890
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks
2649
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2650
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2891
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
2892
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2893
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2651
2894
  #
2652
2895
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2653
2896
  #
@@ -2765,8 +3008,8 @@ module Aws::KMS
2765
3008
  # KMS key for [cryptographic operations][1].
2766
3009
  #
2767
3010
  # The KMS key that you use for this operation must be in a compatible
2768
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2769
- # the *Key Management Service Developer Guide*.
3011
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
3012
+ # Management Service Developer Guide*.
2770
3013
  #
2771
3014
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2772
3015
  # key in a different Amazon Web Services account.
@@ -2822,22 +3065,49 @@ module Aws::KMS
2822
3065
  req.send_request(options)
2823
3066
  end
2824
3067
 
2825
- # Enables [automatic rotation of the key material][1] for the specified
2826
- # symmetric KMS key.
3068
+ # Enables [automatic rotation of the key material][1] of the specified
3069
+ # symmetric encryption KMS key.
3070
+ #
3071
+ # When you enable automatic rotation of a[customer managed KMS key][2],
3072
+ # KMS rotates the key material of the KMS key one year (approximately
3073
+ # 365 days) from the enable date and every year thereafter. You can
3074
+ # monitor rotation of the key material for your KMS keys in CloudTrail
3075
+ # and Amazon CloudWatch. To disable rotation of the key material in a
3076
+ # customer managed KMS key, use the DisableKeyRotation operation.
3077
+ #
3078
+ # Automatic key rotation is supported only on [symmetric encryption KMS
3079
+ # keys][3]. You cannot enable or disable automatic rotation of
3080
+ # [asymmetric KMS keys][4], [HMAC KMS keys][5], KMS keys with [imported
3081
+ # key material][6], or KMS keys in a [custom key store][7]. The key
3082
+ # rotation status of these KMS keys is always `false`. To enable or
3083
+ # disable automatic rotation of a set of related [multi-Region keys][8],
3084
+ # set the property on the primary key.
3085
+ #
3086
+ # You cannot enable or disable automatic rotation [Amazon Web Services
3087
+ # managed KMS keys][9]. KMS always rotates the key material of Amazon
3088
+ # Web Services managed keys every year. Rotation of [Amazon Web Services
3089
+ # owned KMS keys][10] varies.
3090
+ #
3091
+ # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
3092
+ # managed keys from every three years (approximately 1,095 days) to
3093
+ # every year (approximately 365 days).
3094
+ #
3095
+ # New Amazon Web Services managed keys are automatically rotated one
3096
+ # year after they are created, and approximately every year thereafter.
3097
+ #
3098
+ # Existing Amazon Web Services managed keys are automatically rotated
3099
+ # one year after their most recent rotation, and every year thereafter.
2827
3100
  #
2828
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2829
- # keys with [imported key material][3], or KMS keys in a [custom key
2830
- # store][4]. To enable or disable automatic rotation of a set of related
2831
- # [multi-Region keys][5], set the property on the primary key.
3101
+ # </note>
2832
3102
  #
2833
3103
  # The KMS key that you use for this operation must be in a compatible
2834
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2835
- # the *Key Management Service Developer Guide*.
3104
+ # key state. For details, see [Key states of KMS keys][11] in the *Key
3105
+ # Management Service Developer Guide*.
2836
3106
  #
2837
3107
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2838
3108
  # key in a different Amazon Web Services account.
2839
3109
  #
2840
- # **Required permissions**\: [kms:EnableKeyRotation][7] (key policy)
3110
+ # **Required permissions**\: [kms:EnableKeyRotation][12] (key policy)
2841
3111
  #
2842
3112
  # **Related operations:**
2843
3113
  #
@@ -2848,19 +3118,25 @@ module Aws::KMS
2848
3118
  #
2849
3119
  #
2850
3120
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2851
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2852
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2853
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2854
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2855
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2856
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3121
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
3122
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
3123
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3124
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
3125
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3126
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3127
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
3128
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
3129
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk
3130
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3131
+ # [12]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2857
3132
  #
2858
3133
  # @option params [required, String] :key_id
2859
- # Identifies a symmetric KMS key. You cannot enable automatic rotation
2860
- # of [asymmetric KMS keys][1], KMS keys with [imported key material][2],
2861
- # or KMS keys in a [custom key store][3]. To enable or disable automatic
2862
- # rotation of a set of related [multi-Region keys][4], set the property
2863
- # on the primary key.
3134
+ # Identifies a symmetric encryption KMS key. You cannot enable or
3135
+ # disable automatic rotation of [asymmetric KMS keys][1], [HMAC KMS
3136
+ # keys][2], KMS keys with [imported key material][3], or KMS keys in a
3137
+ # [custom key store][4]. The key rotation status of these KMS keys is
3138
+ # always `false`. To enable or disable automatic rotation of a set of
3139
+ # related [multi-Region keys][5], set the property on the primary key.
2864
3140
  #
2865
3141
  # Specify the key ID or key ARN of the KMS key.
2866
3142
  #
@@ -2876,10 +3152,11 @@ module Aws::KMS
2876
3152
  #
2877
3153
  #
2878
3154
  #
2879
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2880
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2881
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2882
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
3155
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3156
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
3157
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3158
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3159
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
2883
3160
  #
2884
3161
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2885
3162
  #
@@ -2907,36 +3184,22 @@ module Aws::KMS
2907
3184
  req.send_request(options)
2908
3185
  end
2909
3186
 
2910
- # Encrypts plaintext into ciphertext by using a KMS key. The `Encrypt`
2911
- # operation has two primary use cases:
2912
- #
2913
- # * You can encrypt small amounts of arbitrary data, such as a personal
2914
- # identifier or database password, or other sensitive information.
2915
- #
2916
- # * You can use the `Encrypt` operation to move encrypted data from one
2917
- # Amazon Web Services Region to another. For example, in Region A,
2918
- # generate a data key and use the plaintext key to encrypt your data.
2919
- # Then, in Region A, use the `Encrypt` operation to encrypt the
2920
- # plaintext data key under a KMS key in Region B. Now, you can move
2921
- # the encrypted data and the encrypted data key to Region B. When
2922
- # necessary, you can decrypt the encrypted data key and the encrypted
2923
- # data entirely within in Region B.
2924
- #
2925
- # You don't need to use the `Encrypt` operation to encrypt a data key.
2926
- # The GenerateDataKey and GenerateDataKeyPair operations return a
2927
- # plaintext data key and an encrypted copy of that data key.
2928
- #
2929
- # When you encrypt data, you must specify a symmetric or asymmetric KMS
2930
- # key to use in the encryption operation. The KMS key must have a
2931
- # `KeyUsage` value of `ENCRYPT_DECRYPT.` To find the `KeyUsage` of a KMS
2932
- # key, use the DescribeKey operation.
2933
- #
2934
- # If you use a symmetric KMS key, you can use an encryption context to
2935
- # add additional security to your encryption operation. If you specify
2936
- # an `EncryptionContext` when encrypting data, you must specify the same
2937
- # encryption context (a case-sensitive exact match) when decrypting the
2938
- # data. Otherwise, the request to decrypt fails with an
2939
- # `InvalidCiphertextException`. For more information, see [Encryption
3187
+ # Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a
3188
+ # symmetric or asymmetric KMS key with a `KeyUsage` of
3189
+ # `ENCRYPT_DECRYPT`.
3190
+ #
3191
+ # You can use this operation to encrypt small amounts of arbitrary data,
3192
+ # such as a personal identifier or database password, or other sensitive
3193
+ # information. You don't need to use the `Encrypt` operation to encrypt
3194
+ # a data key. The GenerateDataKey and GenerateDataKeyPair operations
3195
+ # return a plaintext data key and an encrypted copy of that data key.
3196
+ #
3197
+ # If you use a symmetric encryption KMS key, you can use an encryption
3198
+ # context to add additional security to your encryption operation. If
3199
+ # you specify an `EncryptionContext` when encrypting data, you must
3200
+ # specify the same encryption context (a case-sensitive exact match)
3201
+ # when decrypting the data. Otherwise, the request to decrypt fails with
3202
+ # an `InvalidCiphertextException`. For more information, see [Encryption
2940
3203
  # Context][1] in the *Key Management Service Developer Guide*.
2941
3204
  #
2942
3205
  # If you specify an asymmetric KMS key, you must also specify the
@@ -2951,15 +3214,15 @@ module Aws::KMS
2951
3214
  # fails.
2952
3215
  #
2953
3216
  # You are not required to supply the key ID and encryption algorithm
2954
- # when you decrypt with symmetric KMS keys because KMS stores this
2955
- # information in the ciphertext blob. KMS cannot store metadata in
3217
+ # when you decrypt with symmetric encryption KMS keys because KMS stores
3218
+ # this information in the ciphertext blob. KMS cannot store metadata in
2956
3219
  # ciphertext generated with asymmetric keys. The standard format for
2957
3220
  # asymmetric key ciphertext does not include configurable fields.
2958
3221
  #
2959
3222
  # The maximum size of the data that you can encrypt varies with the type
2960
3223
  # of KMS key and the encryption algorithm that you choose.
2961
3224
  #
2962
- # * Symmetric KMS keys
3225
+ # * Symmetric encryption KMS keys
2963
3226
  #
2964
3227
  # * `SYMMETRIC_DEFAULT`\: 4096 bytes
2965
3228
  #
@@ -2984,8 +3247,8 @@ module Aws::KMS
2984
3247
  # * `RSAES_OAEP_SHA_256`\: 446 bytes
2985
3248
  #
2986
3249
  # The KMS key that you use for this operation must be in a compatible
2987
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2988
- # the *Key Management Service Developer Guide*.
3250
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
3251
+ # Management Service Developer Guide*.
2989
3252
  #
2990
3253
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2991
3254
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3008,7 +3271,9 @@ module Aws::KMS
3008
3271
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3009
3272
  #
3010
3273
  # @option params [required, String] :key_id
3011
- # Identifies the KMS key to use in the encryption operation.
3274
+ # Identifies the KMS key to use in the encryption operation. The KMS key
3275
+ # must have a `KeyUsage` of `ENCRYPT_DECRYPT`. To find the `KeyUsage` of
3276
+ # a KMS key, use the DescribeKey operation.
3012
3277
  #
3013
3278
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3014
3279
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3035,18 +3300,19 @@ module Aws::KMS
3035
3300
  # @option params [Hash<String,String>] :encryption_context
3036
3301
  # Specifies the encryption context that will be used to encrypt the
3037
3302
  # data. An encryption context is valid only for [cryptographic
3038
- # operations][1] with a symmetric KMS key. The standard asymmetric
3039
- # encryption algorithms that KMS uses do not support an encryption
3040
- # context.
3303
+ # operations][1] with a symmetric encryption KMS key. The standard
3304
+ # asymmetric encryption algorithms and HMAC algorithms that KMS uses do
3305
+ # not support an encryption context.
3041
3306
  #
3042
3307
  # An *encryption context* is a collection of non-secret key-value pairs
3043
- # that represents additional authenticated data. When you use an
3308
+ # that represent additional authenticated data. When you use an
3044
3309
  # encryption context to encrypt data, you must specify the same (an
3045
3310
  # exact case-sensitive match) encryption context to decrypt the data. An
3046
- # encryption context is optional when encrypting with a symmetric KMS
3047
- # key, but it is highly recommended.
3311
+ # encryption context is supported only on operations with symmetric
3312
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3313
+ # an encryption context is optional, but it is strongly recommended.
3048
3314
  #
3049
- # For more information, see [Encryption Context][2] in the *Key
3315
+ # For more information, see [Encryption context][2] in the *Key
3050
3316
  # Management Service Developer Guide*.
3051
3317
  #
3052
3318
  #
@@ -3073,9 +3339,9 @@ module Aws::KMS
3073
3339
  # that you specify.
3074
3340
  #
3075
3341
  # This parameter is required only for asymmetric KMS keys. The default
3076
- # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric KMS
3077
- # keys. If you are using an asymmetric KMS key, we recommend
3078
- # RSAES\_OAEP\_SHA\_256.
3342
+ # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric
3343
+ # encryption KMS keys. If you are using an asymmetric KMS key, we
3344
+ # recommend RSAES\_OAEP\_SHA\_256.
3079
3345
  #
3080
3346
  # @return [Types::EncryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3081
3347
  #
@@ -3126,19 +3392,17 @@ module Aws::KMS
3126
3392
  req.send_request(options)
3127
3393
  end
3128
3394
 
3129
- # Generates a unique symmetric data key for client-side encryption. This
3395
+ # Returns a unique symmetric data key for use outside of KMS. This
3130
3396
  # operation returns a plaintext copy of the data key and a copy that is
3131
- # encrypted under a KMS key that you specify. You can use the plaintext
3132
- # key to encrypt your data outside of KMS and store the encrypted data
3133
- # key with the encrypted data.
3134
- #
3135
- # `GenerateDataKey` returns a unique data key for each request. The
3136
- # bytes in the plaintext key are not related to the caller or the KMS
3137
- # key.
3138
- #
3139
- # To generate a data key, specify the symmetric KMS key that will be
3140
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3141
- # generate data keys. To get the type of your KMS key, use the
3397
+ # encrypted under a symmetric encryption KMS key that you specify. The
3398
+ # bytes in the plaintext key are random; they are not related to the
3399
+ # caller or the KMS key. You can use the plaintext key to encrypt your
3400
+ # data outside of KMS and store the encrypted data key with the
3401
+ # encrypted data.
3402
+ #
3403
+ # To generate a data key, specify the symmetric encryption KMS key that
3404
+ # will be used to encrypt the data key. You cannot use an asymmetric KMS
3405
+ # key to encrypt data keys. To get the type of your KMS key, use the
3142
3406
  # DescribeKey operation. You must also specify the length of the data
3143
3407
  # key. Use either the `KeySpec` or `NumberOfBytes` parameters (but not
3144
3408
  # both). For 128-bit and 256-bit data keys, use the `KeySpec` parameter.
@@ -3149,7 +3413,7 @@ module Aws::KMS
3149
3413
  # GenerateDataKeyPairWithoutPlaintext operation. To get a
3150
3414
  # cryptographically secure random byte string, use GenerateRandom.
3151
3415
  #
3152
- # You can use the optional encryption context to add additional security
3416
+ # You can use an optional encryption context to add additional security
3153
3417
  # to the encryption operation. If you specify an `EncryptionContext`,
3154
3418
  # you must specify the same encryption context (a case-sensitive exact
3155
3419
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3164,8 +3428,8 @@ module Aws::KMS
3164
3428
  # Service Developer Guide*.
3165
3429
  #
3166
3430
  # The KMS key that you use for this operation must be in a compatible
3167
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3168
- # the *Key Management Service Developer Guide*.
3431
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
3432
+ # Management Service Developer Guide*.
3169
3433
  #
3170
3434
  # **How to use your data key**
3171
3435
  #
@@ -3224,7 +3488,10 @@ module Aws::KMS
3224
3488
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3225
3489
  #
3226
3490
  # @option params [required, String] :key_id
3227
- # Identifies the symmetric KMS key that encrypts the data key.
3491
+ # Specifies the symmetric encryption KMS key that encrypts the data key.
3492
+ # You cannot specify an asymmetric KMS key or a KMS key in a custom key
3493
+ # store. To get the type and origin of your KMS key, use the DescribeKey
3494
+ # operation.
3228
3495
  #
3229
3496
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3230
3497
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3250,13 +3517,14 @@ module Aws::KMS
3250
3517
  # data key.
3251
3518
  #
3252
3519
  # An *encryption context* is a collection of non-secret key-value pairs
3253
- # that represents additional authenticated data. When you use an
3520
+ # that represent additional authenticated data. When you use an
3254
3521
  # encryption context to encrypt data, you must specify the same (an
3255
3522
  # exact case-sensitive match) encryption context to decrypt the data. An
3256
- # encryption context is optional when encrypting with a symmetric KMS
3257
- # key, but it is highly recommended.
3523
+ # encryption context is supported only on operations with symmetric
3524
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3525
+ # an encryption context is optional, but it is strongly recommended.
3258
3526
  #
3259
- # For more information, see [Encryption Context][1] in the *Key
3527
+ # For more information, see [Encryption context][1] in the *Key
3260
3528
  # Management Service Developer Guide*.
3261
3529
  #
3262
3530
  #
@@ -3344,11 +3612,13 @@ module Aws::KMS
3344
3612
  req.send_request(options)
3345
3613
  end
3346
3614
 
3347
- # Generates a unique asymmetric data key pair. The `GenerateDataKeyPair`
3615
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3348
3616
  # operation returns a plaintext public key, a plaintext private key, and
3349
- # a copy of the private key that is encrypted under the symmetric KMS
3350
- # key you specify. You can use the data key pair to perform asymmetric
3351
- # cryptography and implement digital signatures outside of KMS.
3617
+ # a copy of the private key that is encrypted under the symmetric
3618
+ # encryption KMS key you specify. You can use the data key pair to
3619
+ # perform asymmetric cryptography and implement digital signatures
3620
+ # outside of KMS. The bytes in the keys are random; they not related to
3621
+ # the caller or to the KMS key that is used to encrypt the private key.
3352
3622
  #
3353
3623
  # You can use the public key that `GenerateDataKeyPair` returns to
3354
3624
  # encrypt data or verify a signature outside of KMS. Then, store the
@@ -3356,10 +3626,10 @@ module Aws::KMS
3356
3626
  # data or sign a message, you can use the Decrypt operation to decrypt
3357
3627
  # the encrypted private key.
3358
3628
  #
3359
- # To generate a data key pair, you must specify a symmetric KMS key to
3360
- # encrypt the private key in a data key pair. You cannot use an
3361
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3362
- # and origin of your KMS key, use the DescribeKey operation.
3629
+ # To generate a data key pair, you must specify a symmetric encryption
3630
+ # KMS key to encrypt the private key in a data key pair. You cannot use
3631
+ # an asymmetric KMS key or a KMS key in a custom key store. To get the
3632
+ # type and origin of your KMS key, use the DescribeKey operation.
3363
3633
  #
3364
3634
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3365
3635
  # (ECC) data key pair. KMS recommends that your use ECC key pairs for
@@ -3377,13 +3647,13 @@ module Aws::KMS
3377
3647
  # to decrypt the encrypted private key in the data key pair.
3378
3648
  #
3379
3649
  # `GenerateDataKeyPair` returns a unique data key pair for each request.
3380
- # The bytes in the keys are not related to the caller or the KMS key
3381
- # that is used to encrypt the private key. The public key is a
3382
- # DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC 5280][1].
3383
- # The private key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in
3384
- # [RFC 5958][2].
3650
+ # The bytes in the keys are random; they are not related to the caller
3651
+ # or the KMS key that is used to encrypt the private key. The public key
3652
+ # is a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3653
+ # 5280][1]. The private key is a DER-encoded PKCS8 PrivateKeyInfo, as
3654
+ # specified in [RFC 5958][2].
3385
3655
  #
3386
- # You can use the optional encryption context to add additional security
3656
+ # You can use an optional encryption context to add additional security
3387
3657
  # to the encryption operation. If you specify an `EncryptionContext`,
3388
3658
  # you must specify the same encryption context (a case-sensitive exact
3389
3659
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3392,8 +3662,8 @@ module Aws::KMS
3392
3662
  # Service Developer Guide*.
3393
3663
  #
3394
3664
  # The KMS key that you use for this operation must be in a compatible
3395
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3396
- # the *Key Management Service Developer Guide*.
3665
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
3666
+ # Management Service Developer Guide*.
3397
3667
  #
3398
3668
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3399
3669
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3426,13 +3696,14 @@ module Aws::KMS
3426
3696
  # private key in the data key pair.
3427
3697
  #
3428
3698
  # An *encryption context* is a collection of non-secret key-value pairs
3429
- # that represents additional authenticated data. When you use an
3699
+ # that represent additional authenticated data. When you use an
3430
3700
  # encryption context to encrypt data, you must specify the same (an
3431
3701
  # exact case-sensitive match) encryption context to decrypt the data. An
3432
- # encryption context is optional when encrypting with a symmetric KMS
3433
- # key, but it is highly recommended.
3702
+ # encryption context is supported only on operations with symmetric
3703
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3704
+ # an encryption context is optional, but it is strongly recommended.
3434
3705
  #
3435
- # For more information, see [Encryption Context][1] in the *Key
3706
+ # For more information, see [Encryption context][1] in the *Key
3436
3707
  # Management Service Developer Guide*.
3437
3708
  #
3438
3709
  #
@@ -3440,10 +3711,10 @@ module Aws::KMS
3440
3711
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3441
3712
  #
3442
3713
  # @option params [required, String] :key_id
3443
- # Specifies the symmetric KMS key that encrypts the private key in the
3444
- # data key pair. You cannot specify an asymmetric KMS key or a KMS key
3445
- # in a custom key store. To get the type and origin of your KMS key, use
3446
- # the DescribeKey operation.
3714
+ # Specifies the symmetric encryption KMS key that encrypts the private
3715
+ # key in the data key pair. You cannot specify an asymmetric KMS key or
3716
+ # a KMS key in a custom key store. To get the type and origin of your
3717
+ # KMS key, use the DescribeKey operation.
3447
3718
  #
3448
3719
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3449
3720
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3497,16 +3768,16 @@ module Aws::KMS
3497
3768
  # @example Example: To generate an RSA key pair for encryption and decryption
3498
3769
  #
3499
3770
  # # This example generates an RSA data key pair for encryption and decryption. The operation returns a plaintext public key
3500
- # # and private key, and a copy of the private key that is encrypted under a symmetric KMS key that you specify.
3771
+ # # and private key, and a copy of the private key that is encrypted under a symmetric encryption KMS key that you specify.
3501
3772
  #
3502
3773
  # resp = client.generate_data_key_pair({
3503
- # 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.
3774
+ # 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.
3504
3775
  # key_pair_spec: "RSA_3072", # The requested key spec of the RSA data key pair.
3505
3776
  # })
3506
3777
  #
3507
3778
  # resp.to_h outputs the following:
3508
3779
  # {
3509
- # 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.
3780
+ # 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.
3510
3781
  # key_pair_spec: "RSA_3072", # The actual key spec of the RSA data key pair.
3511
3782
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the RSA data key pair.
3512
3783
  # private_key_plaintext: "<binary data>", # The plaintext private key of the RSA data key pair.
@@ -3541,11 +3812,12 @@ module Aws::KMS
3541
3812
  req.send_request(options)
3542
3813
  end
3543
3814
 
3544
- # Generates a unique asymmetric data key pair. The
3545
- # `GenerateDataKeyPairWithoutPlaintext` operation returns a plaintext
3546
- # public key and a copy of the private key that is encrypted under the
3547
- # symmetric KMS key you specify. Unlike GenerateDataKeyPair, this
3548
- # operation does not return a plaintext private key.
3815
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3816
+ # operation returns a plaintext public key and a copy of the private key
3817
+ # that is encrypted under the symmetric encryption KMS key you specify.
3818
+ # Unlike GenerateDataKeyPair, this operation does not return a plaintext
3819
+ # private key. The bytes in the keys are random; they are not related to
3820
+ # the caller or to the KMS key that is used to encrypt the private key.
3549
3821
  #
3550
3822
  # You can use the public key that `GenerateDataKeyPairWithoutPlaintext`
3551
3823
  # returns to encrypt data or verify a signature outside of KMS. Then,
@@ -3553,10 +3825,10 @@ module Aws::KMS
3553
3825
  # decrypt data or sign a message, you can use the Decrypt operation to
3554
3826
  # decrypt the encrypted private key.
3555
3827
  #
3556
- # To generate a data key pair, you must specify a symmetric KMS key to
3557
- # encrypt the private key in a data key pair. You cannot use an
3558
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3559
- # and origin of your KMS key, use the DescribeKey operation.
3828
+ # To generate a data key pair, you must specify a symmetric encryption
3829
+ # KMS key to encrypt the private key in a data key pair. You cannot use
3830
+ # an asymmetric KMS key or a KMS key in a custom key store. To get the
3831
+ # type and origin of your KMS key, use the DescribeKey operation.
3560
3832
  #
3561
3833
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3562
3834
  # (ECC) data key pair. KMS recommends that your use ECC key pairs for
@@ -3570,7 +3842,7 @@ module Aws::KMS
3570
3842
  # a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3571
3843
  # 5280][1].
3572
3844
  #
3573
- # You can use the optional encryption context to add additional security
3845
+ # You can use an optional encryption context to add additional security
3574
3846
  # to the encryption operation. If you specify an `EncryptionContext`,
3575
3847
  # you must specify the same encryption context (a case-sensitive exact
3576
3848
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3579,8 +3851,8 @@ module Aws::KMS
3579
3851
  # Service Developer Guide*.
3580
3852
  #
3581
3853
  # The KMS key that you use for this operation must be in a compatible
3582
- # key state. For details, see [Key state: Effect on your KMS key][3] in
3583
- # the *Key Management Service Developer Guide*.
3854
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
3855
+ # Management Service Developer Guide*.
3584
3856
  #
3585
3857
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3586
3858
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3613,13 +3885,14 @@ module Aws::KMS
3613
3885
  # private key in the data key pair.
3614
3886
  #
3615
3887
  # An *encryption context* is a collection of non-secret key-value pairs
3616
- # that represents additional authenticated data. When you use an
3888
+ # that represent additional authenticated data. When you use an
3617
3889
  # encryption context to encrypt data, you must specify the same (an
3618
3890
  # exact case-sensitive match) encryption context to decrypt the data. An
3619
- # encryption context is optional when encrypting with a symmetric KMS
3620
- # key, but it is highly recommended.
3891
+ # encryption context is supported only on operations with symmetric
3892
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3893
+ # an encryption context is optional, but it is strongly recommended.
3621
3894
  #
3622
- # For more information, see [Encryption Context][1] in the *Key
3895
+ # For more information, see [Encryption context][1] in the *Key
3623
3896
  # Management Service Developer Guide*.
3624
3897
  #
3625
3898
  #
@@ -3627,10 +3900,10 @@ module Aws::KMS
3627
3900
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3628
3901
  #
3629
3902
  # @option params [required, String] :key_id
3630
- # Specifies the KMS key that encrypts the private key in the data key
3631
- # pair. You must specify a symmetric KMS key. You cannot use an
3632
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3633
- # and origin of your KMS key, use the DescribeKey operation.
3903
+ # Specifies the symmetric encryption KMS key that encrypts the private
3904
+ # key in the data key pair. You cannot specify an asymmetric KMS key or
3905
+ # a KMS key in a custom key store. To get the type and origin of your
3906
+ # KMS key, use the DescribeKey operation.
3634
3907
  #
3635
3908
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3636
3909
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3683,16 +3956,16 @@ module Aws::KMS
3683
3956
  # @example Example: To generate an asymmetric data key pair without a plaintext key
3684
3957
  #
3685
3958
  # # This example returns an asymmetric elliptic curve (ECC) data key pair. The private key is encrypted under the symmetric
3686
- # # KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
3959
+ # # encryption KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
3687
3960
  #
3688
3961
  # resp = client.generate_data_key_pair_without_plaintext({
3689
- # 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.
3962
+ # 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.
3690
3963
  # key_pair_spec: "ECC_NIST_P521", # The requested key spec of the ECC asymmetric data key pair.
3691
3964
  # })
3692
3965
  #
3693
3966
  # resp.to_h outputs the following:
3694
3967
  # {
3695
- # 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.
3968
+ # 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.
3696
3969
  # key_pair_spec: "ECC_NIST_P521", # The actual key spec of the ECC asymmetric data key pair.
3697
3970
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the asymmetric ECC data key pair.
3698
3971
  # public_key: "<binary data>", # The public key (plaintext).
@@ -3725,13 +3998,15 @@ module Aws::KMS
3725
3998
  req.send_request(options)
3726
3999
  end
3727
4000
 
3728
- # Generates a unique symmetric data key. This operation returns a data
3729
- # key that is encrypted under a KMS key that you specify. To request an
3730
- # asymmetric data key pair, use the GenerateDataKeyPair or
3731
- # GenerateDataKeyPairWithoutPlaintext operations.
4001
+ # Returns a unique symmetric data key for use outside of KMS. This
4002
+ # operation returns a data key that is encrypted under a symmetric
4003
+ # encryption KMS key that you specify. The bytes in the key are random;
4004
+ # they are not related to the caller or to the KMS key.
3732
4005
  #
3733
4006
  # `GenerateDataKeyWithoutPlaintext` is identical to the GenerateDataKey
3734
- # operation except that returns only the encrypted copy of the data key.
4007
+ # operation except that it does not return a plaintext copy of the data
4008
+ # key.
4009
+ #
3735
4010
  # This operation is useful for systems that need to encrypt data at some
3736
4011
  # point, but not immediately. When you need to encrypt the data, you
3737
4012
  # call the Decrypt operation on the encrypted copy of the key.
@@ -3746,19 +4021,18 @@ module Aws::KMS
3746
4021
  # data key. In this system, the component that creates the containers
3747
4022
  # never sees the plaintext data key.
3748
4023
  #
3749
- # `GenerateDataKeyWithoutPlaintext` returns a unique data key for each
3750
- # request. The bytes in the keys are not related to the caller or KMS
3751
- # key that is used to encrypt the private key.
4024
+ # To request an asymmetric data key pair, use the GenerateDataKeyPair or
4025
+ # GenerateDataKeyPairWithoutPlaintext operations.
3752
4026
  #
3753
- # To generate a data key, you must specify the symmetric KMS key that is
3754
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3755
- # generate a data key. To get the type of your KMS key, use the
3756
- # DescribeKey operation.
4027
+ # To generate a data key, you must specify the symmetric encryption KMS
4028
+ # key that is used to encrypt the data key. You cannot use an asymmetric
4029
+ # KMS key or a key in a custom key store to generate a data key. To get
4030
+ # the type of your KMS key, use the DescribeKey operation.
3757
4031
  #
3758
4032
  # If the operation succeeds, you will find the encrypted copy of the
3759
4033
  # data key in the `CiphertextBlob` field.
3760
4034
  #
3761
- # You can use the optional encryption context to add additional security
4035
+ # You can use an optional encryption context to add additional security
3762
4036
  # to the encryption operation. If you specify an `EncryptionContext`,
3763
4037
  # you must specify the same encryption context (a case-sensitive exact
3764
4038
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3767,8 +4041,8 @@ module Aws::KMS
3767
4041
  # Service Developer Guide*.
3768
4042
  #
3769
4043
  # The KMS key that you use for this operation must be in a compatible
3770
- # key state. For details, see [Key state: Effect on your KMS key][2] in
3771
- # the *Key Management Service Developer Guide*.
4044
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
4045
+ # Management Service Developer Guide*.
3772
4046
  #
3773
4047
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3774
4048
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3796,7 +4070,10 @@ module Aws::KMS
3796
4070
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3797
4071
  #
3798
4072
  # @option params [required, String] :key_id
3799
- # The identifier of the symmetric KMS key that encrypts the data key.
4073
+ # Specifies the symmetric encryption KMS key that encrypts the data key.
4074
+ # You cannot specify an asymmetric KMS key or a KMS key in a custom key
4075
+ # store. To get the type and origin of your KMS key, use the DescribeKey
4076
+ # operation.
3800
4077
  #
3801
4078
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3802
4079
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3822,13 +4099,14 @@ module Aws::KMS
3822
4099
  # data key.
3823
4100
  #
3824
4101
  # An *encryption context* is a collection of non-secret key-value pairs
3825
- # that represents additional authenticated data. When you use an
4102
+ # that represent additional authenticated data. When you use an
3826
4103
  # encryption context to encrypt data, you must specify the same (an
3827
4104
  # exact case-sensitive match) encryption context to decrypt the data. An
3828
- # encryption context is optional when encrypting with a symmetric KMS
3829
- # key, but it is highly recommended.
4105
+ # encryption context is supported only on operations with symmetric
4106
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
4107
+ # an encryption context is optional, but it is strongly recommended.
3830
4108
  #
3831
- # For more information, see [Encryption Context][1] in the *Key
4109
+ # For more information, see [Encryption context][1] in the *Key
3832
4110
  # Management Service Developer Guide*.
3833
4111
  #
3834
4112
  #
@@ -3906,6 +4184,135 @@ module Aws::KMS
3906
4184
  req.send_request(options)
3907
4185
  end
3908
4186
 
4187
+ # Generates a hash-based message authentication code (HMAC) for a
4188
+ # message using an HMAC KMS key and a MAC algorithm that the key
4189
+ # supports. The MAC algorithm computes the HMAC for the message and the
4190
+ # key as described in [RFC 2104][1].
4191
+ #
4192
+ # You can use the HMAC that this operation generates with the VerifyMac
4193
+ # operation to demonstrate that the original message has not changed.
4194
+ # Also, because a secret key is used to create the hash, you can verify
4195
+ # that the party that generated the hash has the required secret key.
4196
+ # This operation is part of KMS support for HMAC KMS keys. For details,
4197
+ # see [HMAC keys in KMS][2] in the <i> <i>Key Management Service
4198
+ # Developer Guide</i> </i>.
4199
+ #
4200
+ # <note markdown="1"> Best practices recommend that you limit the time during which any
4201
+ # signing mechanism, including an HMAC, is effective. This deters an
4202
+ # attack where the actor uses a signed message to establish validity
4203
+ # repeatedly or long after the message is superseded. HMAC tags do not
4204
+ # include a timestamp, but you can include a timestamp in the token or
4205
+ # message to help you detect when its time to refresh the HMAC.
4206
+ #
4207
+ # </note>
4208
+ #
4209
+ # The KMS key that you use for this operation must be in a compatible
4210
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
4211
+ # Management Service Developer Guide*.
4212
+ #
4213
+ # **Cross-account use**\: Yes. To perform this operation with a KMS key
4214
+ # in a different Amazon Web Services account, specify the key ARN or
4215
+ # alias ARN in the value of the `KeyId` parameter.
4216
+ #
4217
+ # **Required permissions**\: [kms:GenerateMac][4] (key policy)
4218
+ #
4219
+ # **Related operations**\: VerifyMac
4220
+ #
4221
+ #
4222
+ #
4223
+ # [1]: https://datatracker.ietf.org/doc/html/rfc2104
4224
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
4225
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4226
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4227
+ #
4228
+ # @option params [required, String, StringIO, File] :message
4229
+ # The message to be hashed. Specify a message of up to 4,096 bytes.
4230
+ #
4231
+ # `GenerateMac` and VerifyMac do not provide special handling for
4232
+ # message digests. If you generate an HMAC for a hash digest of a
4233
+ # message, you must verify the HMAC of the same hash digest.
4234
+ #
4235
+ # @option params [required, String] :key_id
4236
+ # The HMAC KMS key to use in the operation. The MAC algorithm computes
4237
+ # the HMAC for the message and the key as described in [RFC 2104][1].
4238
+ #
4239
+ # To identify an HMAC KMS key, use the DescribeKey operation and see the
4240
+ # `KeySpec` field in the response.
4241
+ #
4242
+ #
4243
+ #
4244
+ # [1]: https://datatracker.ietf.org/doc/html/rfc2104
4245
+ #
4246
+ # @option params [required, String] :mac_algorithm
4247
+ # The MAC algorithm used in the operation.
4248
+ #
4249
+ # The algorithm must be compatible with the HMAC KMS key that you
4250
+ # specify. To find the MAC algorithms that your HMAC KMS key supports,
4251
+ # use the DescribeKey operation and see the `MacAlgorithms` field in the
4252
+ # `DescribeKey` response.
4253
+ #
4254
+ # @option params [Array<String>] :grant_tokens
4255
+ # A list of grant tokens.
4256
+ #
4257
+ # Use a grant token when your permission to call this operation comes
4258
+ # from a new grant that has not yet achieved *eventual consistency*. For
4259
+ # more information, see [Grant token][1] and [Using a grant token][2] in
4260
+ # the *Key Management Service Developer Guide*.
4261
+ #
4262
+ #
4263
+ #
4264
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
4265
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
4266
+ #
4267
+ # @return [Types::GenerateMacResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
4268
+ #
4269
+ # * {Types::GenerateMacResponse#mac #mac} => String
4270
+ # * {Types::GenerateMacResponse#mac_algorithm #mac_algorithm} => String
4271
+ # * {Types::GenerateMacResponse#key_id #key_id} => String
4272
+ #
4273
+ #
4274
+ # @example Example: To generate an HMAC for a message
4275
+ #
4276
+ # # This example generates an HMAC for a message, an HMAC KMS key, and a MAC algorithm. The algorithm must be supported by
4277
+ # # the specified HMAC KMS key.
4278
+ #
4279
+ # resp = client.generate_mac({
4280
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The HMAC KMS key input to the HMAC algorithm.
4281
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm requested for the operation.
4282
+ # message: "Hello World", # The message input to the HMAC algorithm.
4283
+ # })
4284
+ #
4285
+ # resp.to_h outputs the following:
4286
+ # {
4287
+ # 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.
4288
+ # mac: "<HMAC_TAG>", # The HMAC tag that results from this operation.
4289
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm used in the operation.
4290
+ # }
4291
+ #
4292
+ # @example Request syntax with placeholder values
4293
+ #
4294
+ # resp = client.generate_mac({
4295
+ # message: "data", # required
4296
+ # key_id: "KeyIdType", # required
4297
+ # mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
4298
+ # grant_tokens: ["GrantTokenType"],
4299
+ # })
4300
+ #
4301
+ # @example Response structure
4302
+ #
4303
+ # resp.mac #=> String
4304
+ # resp.mac_algorithm #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
4305
+ # resp.key_id #=> String
4306
+ #
4307
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateMac AWS API Documentation
4308
+ #
4309
+ # @overload generate_mac(params = {})
4310
+ # @param [Hash] params ({})
4311
+ def generate_mac(params = {}, options = {})
4312
+ req = build_request(:generate_mac, params)
4313
+ req.send_request(options)
4314
+ end
4315
+
3909
4316
  # Returns a random byte string that is cryptographically secure.
3910
4317
  #
3911
4318
  # By default, the random byte string is generated in KMS. To generate
@@ -4055,30 +4462,56 @@ module Aws::KMS
4055
4462
  # Gets a Boolean value that indicates whether [automatic rotation of the
4056
4463
  # key material][1] is enabled for the specified KMS key.
4057
4464
  #
4058
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
4059
- # keys with [imported key material][3], or KMS keys in a [custom key
4060
- # store][4]. To enable or disable automatic rotation of a set of related
4061
- # [multi-Region keys][5], set the property on the primary key. The key
4062
- # rotation status for these KMS keys is always `false`.
4465
+ # When you enable automatic rotation for [customer managed KMS keys][2],
4466
+ # KMS rotates the key material of the KMS key one year (approximately
4467
+ # 365 days) from the enable date and every year thereafter. You can
4468
+ # monitor rotation of the key material for your KMS keys in CloudTrail
4469
+ # and Amazon CloudWatch.
4470
+ #
4471
+ # Automatic key rotation is supported only on [symmetric encryption KMS
4472
+ # keys][3]. You cannot enable or disable automatic rotation of
4473
+ # [asymmetric KMS keys][4], [HMAC KMS keys][5], KMS keys with [imported
4474
+ # key material][6], or KMS keys in a [custom key store][7]. The key
4475
+ # rotation status of these KMS keys is always `false`. To enable or
4476
+ # disable automatic rotation of a set of related [multi-Region keys][8],
4477
+ # set the property on the primary key..
4478
+ #
4479
+ # You can enable (EnableKeyRotation) and disable automatic rotation
4480
+ # (DisableKeyRotation) of the key material in customer managed KMS keys.
4481
+ # Key material rotation of [Amazon Web Services managed KMS keys][9] is
4482
+ # not configurable. KMS always rotates the key material in Amazon Web
4483
+ # Services managed KMS keys every year. The key rotation status for
4484
+ # Amazon Web Services managed KMS keys is always `true`.
4485
+ #
4486
+ # <note markdown="1"> In May 2022, KMS changed the rotation schedule for Amazon Web Services
4487
+ # managed keys from every three years to every year. For details, see
4488
+ # EnableKeyRotation.
4489
+ #
4490
+ # </note>
4063
4491
  #
4064
4492
  # The KMS key that you use for this operation must be in a compatible
4065
- # key state. For details, see [Key state: Effect on your KMS key][6] in
4066
- # the *Key Management Service Developer Guide*.
4493
+ # key state. For details, see [Key states of KMS keys][10] in the *Key
4494
+ # Management Service Developer Guide*.
4067
4495
  #
4068
4496
  # * Disabled: The key rotation status does not change when you disable a
4069
4497
  # KMS key. However, while the KMS key is disabled, KMS does not rotate
4070
- # the key material.
4498
+ # the key material. When you re-enable the KMS key, rotation resumes.
4499
+ # If the key material in the re-enabled KMS key hasn't been rotated
4500
+ # in one year, KMS rotates it immediately, and every year thereafter.
4501
+ # If it's been less than a year since the key material in the
4502
+ # re-enabled KMS key was rotated, the KMS key resumes its prior
4503
+ # rotation schedule.
4071
4504
  #
4072
4505
  # * Pending deletion: While a KMS key is pending deletion, its key
4073
4506
  # rotation status is `false` and KMS does not rotate the key material.
4074
- # If you cancel the deletion, the original key rotation status is
4075
- # restored.
4507
+ # If you cancel the deletion, the original key rotation status returns
4508
+ # to `true`.
4076
4509
  #
4077
4510
  # **Cross-account use**\: Yes. To perform this operation on a KMS key in
4078
4511
  # a different Amazon Web Services account, specify the key ARN in the
4079
4512
  # value of the `KeyId` parameter.
4080
4513
  #
4081
- # **Required permissions**\: [kms:GetKeyRotationStatus][7] (key policy)
4514
+ # **Required permissions**\: [kms:GetKeyRotationStatus][11] (key policy)
4082
4515
  #
4083
4516
  # **Related operations:**
4084
4517
  #
@@ -4089,12 +4522,16 @@ module Aws::KMS
4089
4522
  #
4090
4523
  #
4091
4524
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
4092
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
4093
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4094
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4095
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
4096
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4097
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4525
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
4526
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks
4527
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
4528
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
4529
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4530
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4531
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
4532
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
4533
+ # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4534
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4098
4535
  #
4099
4536
  # @option params [required, String] :key_id
4100
4537
  # Gets the rotation status for the specified KMS key.
@@ -4149,21 +4586,22 @@ module Aws::KMS
4149
4586
  req.send_request(options)
4150
4587
  end
4151
4588
 
4152
- # Returns the items you need to import key material into a symmetric,
4153
- # customer managed KMS key. For more information about importing key
4154
- # material into KMS, see [Importing Key Material][1] in the *Key
4155
- # Management Service Developer Guide*.
4589
+ # Returns the items you need to import key material into a symmetric
4590
+ # encryption KMS key. For more information about importing key material
4591
+ # into KMS, see [Importing key material][1] in the *Key Management
4592
+ # Service Developer Guide*.
4156
4593
  #
4157
4594
  # This operation returns a public key and an import token. Use the
4158
4595
  # public key to encrypt the symmetric key material. Store the import
4159
4596
  # token to send with a subsequent ImportKeyMaterial request.
4160
4597
  #
4161
- # You must specify the key ID of the symmetric KMS key into which you
4162
- # will import key material. This KMS key's `Origin` must be `EXTERNAL`.
4163
- # You must also specify the wrapping algorithm and type of wrapping key
4164
- # (public key) that you will use to encrypt the key material. You cannot
4165
- # perform this operation on an asymmetric KMS key or on any KMS key in a
4166
- # different Amazon Web Services account.
4598
+ # You must specify the key ID of the symmetric encryption KMS key into
4599
+ # which you will import key material. This KMS key's `Origin` must be
4600
+ # `EXTERNAL`. You must also specify the wrapping algorithm and type of
4601
+ # wrapping key (public key) that you will use to encrypt the key
4602
+ # material. You cannot perform this operation on an asymmetric KMS key,
4603
+ # an HMAC KMS key, or on any KMS key in a different Amazon Web Services
4604
+ # account.
4167
4605
  #
4168
4606
  # To import key material, you must use the public key and import token
4169
4607
  # from the same response. These items are valid for 24 hours. The
@@ -4173,8 +4611,8 @@ module Aws::KMS
4173
4611
  # `GetParametersForImport` request.
4174
4612
  #
4175
4613
  # The KMS key that you use for this operation must be in a compatible
4176
- # key state. For details, see [Key state: Effect on your KMS key][2] in
4177
- # the *Key Management Service Developer Guide*.
4614
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
4615
+ # Management Service Developer Guide*.
4178
4616
  #
4179
4617
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4180
4618
  # key in a different Amazon Web Services account.
@@ -4195,8 +4633,8 @@ module Aws::KMS
4195
4633
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4196
4634
  #
4197
4635
  # @option params [required, String] :key_id
4198
- # The identifier of the symmetric KMS key into which you will import key
4199
- # material. The `Origin` of the KMS key must be `EXTERNAL`.
4636
+ # The identifier of the symmetric encryption KMS key into which you will
4637
+ # import key material. The `Origin` of the KMS key must be `EXTERNAL`.
4200
4638
  #
4201
4639
  # Specify the key ID or key ARN of the KMS key.
4202
4640
  #
@@ -4279,9 +4717,8 @@ module Aws::KMS
4279
4717
  # callers with `kms:GetPublicKey` permission can download the public key
4280
4718
  # of an asymmetric KMS key. You can share the public key to allow others
4281
4719
  # to encrypt messages and verify signatures outside of KMS. For
4282
- # information about symmetric and asymmetric KMS keys, see [Using
4283
- # Symmetric and Asymmetric KMS keys][1] in the *Key Management Service
4284
- # Developer Guide*.
4720
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
4721
+ # the *Key Management Service Developer Guide*.
4285
4722
  #
4286
4723
  # You do not need to download the public key. Instead, you can use the
4287
4724
  # public key within KMS by calling the Encrypt, ReEncrypt, or Verify
@@ -4313,8 +4750,8 @@ module Aws::KMS
4313
4750
  # in a verification operation.
4314
4751
  #
4315
4752
  # The KMS key that you use for this operation must be in a compatible
4316
- # key state. For details, see [Key state: Effect on your KMS key][7] in
4317
- # the *Key Management Service Developer Guide*.
4753
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
4754
+ # Management Service Developer Guide*.
4318
4755
  #
4319
4756
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
4320
4757
  # in a different Amazon Web Services account, specify the key ARN or
@@ -4414,9 +4851,9 @@ module Aws::KMS
4414
4851
  #
4415
4852
  # resp.key_id #=> String
4416
4853
  # resp.public_key #=> String
4417
- # 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"
4418
- # 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"
4419
- # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
4854
+ # 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"
4855
+ # 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"
4856
+ # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
4420
4857
  # resp.encryption_algorithms #=> Array
4421
4858
  # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
4422
4859
  # resp.signing_algorithms #=> Array
@@ -4431,16 +4868,17 @@ module Aws::KMS
4431
4868
  req.send_request(options)
4432
4869
  end
4433
4870
 
4434
- # Imports key material into an existing symmetric KMS KMS key that was
4435
- # created without key material. After you successfully import key
4436
- # material into a KMS key, you can [reimport the same key material][1]
4437
- # into that KMS key, but you cannot import different key material.
4438
- #
4439
- # You cannot perform this operation on an asymmetric KMS key or on any
4440
- # KMS key in a different Amazon Web Services account. For more
4441
- # information about creating KMS keys with no key material and then
4442
- # importing key material, see [Importing Key Material][2] in the *Key
4443
- # Management Service Developer Guide*.
4871
+ # Imports key material into an existing symmetric encryption KMS key
4872
+ # that was created without key material. After you successfully import
4873
+ # key material into a KMS key, you can [reimport the same key
4874
+ # material][1] into that KMS key, but you cannot import different key
4875
+ # material.
4876
+ #
4877
+ # You cannot perform this operation on an asymmetric KMS key, an HMAC
4878
+ # KMS key, or on any KMS key in a different Amazon Web Services account.
4879
+ # For more information about creating KMS keys with no key material and
4880
+ # then importing key material, see [Importing Key Material][2] in the
4881
+ # *Key Management Service Developer Guide*.
4444
4882
  #
4445
4883
  # Before using this operation, call GetParametersForImport. Its response
4446
4884
  # includes a public key and an import token. Use the public key to
@@ -4482,8 +4920,8 @@ module Aws::KMS
4482
4920
  # Service Developer Guide*.
4483
4921
  #
4484
4922
  # The KMS key that you use for this operation must be in a compatible
4485
- # key state. For details, see [Key state: Effect on your KMS key][4] in
4486
- # the *Key Management Service Developer Guide*.
4923
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
4924
+ # Management Service Developer Guide*.
4487
4925
  #
4488
4926
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4489
4927
  # key in a different Amazon Web Services account.
@@ -4505,10 +4943,13 @@ module Aws::KMS
4505
4943
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4506
4944
  #
4507
4945
  # @option params [required, String] :key_id
4508
- # The identifier of the symmetric KMS key that receives the imported key
4509
- # material. The KMS key's `Origin` must be `EXTERNAL`. This must be the
4510
- # same KMS key specified in the `KeyID` parameter of the corresponding
4511
- # GetParametersForImport request.
4946
+ # The identifier of the symmetric encryption KMS key that receives the
4947
+ # imported key material. This must be the same KMS key specified in the
4948
+ # `KeyID` parameter of the corresponding GetParametersForImport request.
4949
+ # The `Origin` of the KMS key must be `EXTERNAL`. You cannot perform
4950
+ # this operation on an asymmetric KMS key, an HMAC KMS key, a KMS key in
4951
+ # a custom key store, or on a KMS key in a different Amazon Web Services
4952
+ # account
4512
4953
  #
4513
4954
  # Specify the key ID or key ARN of the KMS key.
4514
4955
  #
@@ -4750,7 +5191,7 @@ module Aws::KMS
4750
5191
  # list by grant ID or grantee principal.
4751
5192
  #
4752
5193
  # For detailed information about grants, including grant terminology,
4753
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
5194
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
4754
5195
  # Guide</i> </i>. For examples of working with grants in several
4755
5196
  # programming languages, see [Programming grants][2].
4756
5197
  #
@@ -4920,7 +5361,7 @@ module Aws::KMS
4920
5361
  # resp.grants[0].retiring_principal #=> String
4921
5362
  # resp.grants[0].issuing_account #=> String
4922
5363
  # resp.grants[0].operations #=> Array
4923
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
5364
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
4924
5365
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
4925
5366
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
4926
5367
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5276,7 +5717,7 @@ module Aws::KMS
5276
5717
  # a grant, use the RetireGrant operation.
5277
5718
  #
5278
5719
  # For detailed information about grants, including grant terminology,
5279
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
5720
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
5280
5721
  # Guide</i> </i>. For examples of working with grants in several
5281
5722
  # programming languages, see [Programming grants][2].
5282
5723
  #
@@ -5388,7 +5829,7 @@ module Aws::KMS
5388
5829
  # resp.grants[0].retiring_principal #=> String
5389
5830
  # resp.grants[0].issuing_account #=> String
5390
5831
  # resp.grants[0].operations #=> Array
5391
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
5832
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
5392
5833
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
5393
5834
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
5394
5835
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5469,15 +5910,25 @@ module Aws::KMS
5469
5910
  # visible][2] in the *Amazon Web Services Identity and Access
5470
5911
  # Management User Guide*.
5471
5912
  #
5472
- # The key policy cannot exceed 32 kilobytes (32768 bytes). For more
5473
- # information, see [Resource Quotas][3] in the *Key Management Service
5474
- # Developer Guide*.
5913
+ # A key policy document must conform to the following rules.
5914
+ #
5915
+ # * Up to 32 kilobytes (32768 bytes)
5916
+ #
5917
+ # * Must be UTF-8 encoded
5918
+ #
5919
+ # * The only Unicode characters that are permitted in a key policy
5920
+ # document are the horizontal tab (U+0009), linefeed (U+000A),
5921
+ # carriage return (U+000D), and characters in the range U+0020 to
5922
+ # U+00FF.
5923
+ #
5924
+ # * The `Sid` element in a key policy statement can include spaces.
5925
+ # (Spaces are prohibited in the `Sid` element of an IAM policy
5926
+ # document.)
5475
5927
  #
5476
5928
  #
5477
5929
  #
5478
5930
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam
5479
5931
  # [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency
5480
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html
5481
5932
  #
5482
5933
  # @option params [Boolean] :bypass_policy_lockout_safety_check
5483
5934
  # A flag to indicate whether to bypass the key policy lockout safety
@@ -5538,7 +5989,7 @@ module Aws::KMS
5538
5989
  # [encryption context][2] of a ciphertext.
5539
5990
  #
5540
5991
  # The `ReEncrypt` operation can decrypt ciphertext that was encrypted by
5541
- # using an KMS KMS key in an KMS operation, such as Encrypt or
5992
+ # using a KMS key in an KMS operation, such as Encrypt or
5542
5993
  # GenerateDataKey. It can also decrypt ciphertext that was encrypted by
5543
5994
  # using the public key of an [asymmetric KMS key][3] outside of KMS.
5544
5995
  # However, it cannot decrypt ciphertext produced by other libraries,
@@ -5556,25 +6007,24 @@ module Aws::KMS
5556
6007
  # algorithm that was used. This information is required to decrypt the
5557
6008
  # data.
5558
6009
  #
5559
- # * If your ciphertext was encrypted under a symmetric KMS key, the
5560
- # `SourceKeyId` parameter is optional. KMS can get this information
5561
- # from metadata that it adds to the symmetric ciphertext blob. This
5562
- # feature adds durability to your implementation by ensuring that
5563
- # authorized users can decrypt ciphertext decades after it was
5564
- # encrypted, even if they've lost track of the key ID. However,
5565
- # specifying the source KMS key is always recommended as a best
5566
- # practice. When you use the `SourceKeyId` parameter to specify a KMS
5567
- # key, KMS uses only the KMS key you specify. If the ciphertext was
5568
- # encrypted under a different KMS key, the `ReEncrypt` operation
6010
+ # * If your ciphertext was encrypted under a symmetric encryption KMS
6011
+ # key, the `SourceKeyId` parameter is optional. KMS can get this
6012
+ # information from metadata that it adds to the symmetric ciphertext
6013
+ # blob. This feature adds durability to your implementation by
6014
+ # ensuring that authorized users can decrypt ciphertext decades after
6015
+ # it was encrypted, even if they've lost track of the key ID.
6016
+ # However, specifying the source KMS key is always recommended as a
6017
+ # best practice. When you use the `SourceKeyId` parameter to specify a
6018
+ # KMS key, KMS uses only the KMS key you specify. If the ciphertext
6019
+ # was encrypted under a different KMS key, the `ReEncrypt` operation
5569
6020
  # fails. This practice ensures that you use the KMS key that you
5570
6021
  # intend.
5571
6022
  #
5572
6023
  # * To reencrypt the data, you must use the `DestinationKeyId` parameter
5573
6024
  # specify the KMS key that re-encrypts the data after it is decrypted.
5574
- # You can select a symmetric or asymmetric KMS key. If the destination
5575
- # KMS key is an asymmetric KMS key, you must also provide the
5576
- # encryption algorithm. The algorithm that you choose must be
5577
- # compatible with the KMS key.
6025
+ # If the destination KMS key is an asymmetric KMS key, you must also
6026
+ # provide the encryption algorithm. The algorithm that you choose must
6027
+ # be compatible with the KMS key.
5578
6028
  #
5579
6029
  # When you use an asymmetric KMS key to encrypt or reencrypt data, be
5580
6030
  # sure to record the KMS key and encryption algorithm that you choose.
@@ -5584,14 +6034,15 @@ module Aws::KMS
5584
6034
  # fails.
5585
6035
  #
5586
6036
  # You are not required to supply the key ID and encryption algorithm
5587
- # when you decrypt with symmetric KMS keys because KMS stores this
5588
- # information in the ciphertext blob. KMS cannot store metadata in
5589
- # ciphertext generated with asymmetric keys. The standard format for
5590
- # asymmetric key ciphertext does not include configurable fields.
6037
+ # when you decrypt with symmetric encryption KMS keys because KMS
6038
+ # stores this information in the ciphertext blob. KMS cannot store
6039
+ # metadata in ciphertext generated with asymmetric keys. The standard
6040
+ # format for asymmetric key ciphertext does not include configurable
6041
+ # fields.
5591
6042
  #
5592
6043
  # The KMS key that you use for this operation must be in a compatible
5593
- # key state. For details, see [Key state: Effect on your KMS key][6] in
5594
- # the *Key Management Service Developer Guide*.
6044
+ # key state. For details, see [Key states of KMS keys][6] in the *Key
6045
+ # Management Service Developer Guide*.
5595
6046
  #
5596
6047
  # **Cross-account use**\: Yes. The source KMS key and destination KMS
5597
6048
  # key can be in different Amazon Web Services accounts. Either or both
@@ -5642,13 +6093,14 @@ module Aws::KMS
5642
6093
  # ciphertext.
5643
6094
  #
5644
6095
  # An *encryption context* is a collection of non-secret key-value pairs
5645
- # that represents additional authenticated data. When you use an
6096
+ # that represent additional authenticated data. When you use an
5646
6097
  # encryption context to encrypt data, you must specify the same (an
5647
6098
  # exact case-sensitive match) encryption context to decrypt the data. An
5648
- # encryption context is optional when encrypting with a symmetric KMS
5649
- # key, but it is highly recommended.
6099
+ # encryption context is supported only on operations with symmetric
6100
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
6101
+ # an encryption context is optional, but it is strongly recommended.
5650
6102
  #
5651
- # For more information, see [Encryption Context][1] in the *Key
6103
+ # For more information, see [Encryption context][1] in the *Key
5652
6104
  # Management Service Developer Guide*.
5653
6105
  #
5654
6106
  #
@@ -5657,14 +6109,18 @@ module Aws::KMS
5657
6109
  #
5658
6110
  # @option params [String] :source_key_id
5659
6111
  # Specifies the KMS key that KMS will use to decrypt the ciphertext
5660
- # before it is re-encrypted. Enter a key ID of the KMS key that was used
5661
- # to encrypt the ciphertext.
6112
+ # before it is re-encrypted.
6113
+ #
6114
+ # Enter a key ID of the KMS key that was used to encrypt the ciphertext.
6115
+ # If you identify a different KMS key, the `ReEncrypt` operation throws
6116
+ # an `IncorrectKeyException`.
5662
6117
  #
5663
6118
  # This parameter is required only when the ciphertext was encrypted
5664
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
5665
- # get the KMS key from metadata that it adds to the symmetric ciphertext
5666
- # blob. However, it is always recommended as a best practice. This
5667
- # practice ensures that you use the KMS key that you intend.
6119
+ # under an asymmetric KMS key. If you used a symmetric encryption KMS
6120
+ # key, KMS can get the KMS key from metadata that it adds to the
6121
+ # symmetric ciphertext blob. However, it is always recommended as a best
6122
+ # practice. This practice ensures that you use the KMS key that you
6123
+ # intend.
5668
6124
  #
5669
6125
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5670
6126
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5687,9 +6143,9 @@ module Aws::KMS
5687
6143
  #
5688
6144
  # @option params [required, String] :destination_key_id
5689
6145
  # A unique identifier for the KMS key that is used to reencrypt the
5690
- # data. Specify a symmetric or asymmetric KMS key with a `KeyUsage`
5691
- # value of `ENCRYPT_DECRYPT`. To find the `KeyUsage` value of a KMS key,
5692
- # use the DescribeKey operation.
6146
+ # data. Specify a symmetric encryption KMS key or an asymmetric KMS key
6147
+ # with a `KeyUsage` value of `ENCRYPT_DECRYPT`. To find the `KeyUsage`
6148
+ # value of a KMS key, use the DescribeKey operation.
5693
6149
  #
5694
6150
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5695
6151
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5715,17 +6171,18 @@ module Aws::KMS
5715
6171
  # data.
5716
6172
  #
5717
6173
  # A destination encryption context is valid only when the destination
5718
- # KMS key is a symmetric KMS key. The standard ciphertext format for
5719
- # asymmetric KMS keys does not include fields for metadata.
6174
+ # KMS key is a symmetric encryption KMS key. The standard ciphertext
6175
+ # format for asymmetric KMS keys does not include fields for metadata.
5720
6176
  #
5721
6177
  # An *encryption context* is a collection of non-secret key-value pairs
5722
- # that represents additional authenticated data. When you use an
6178
+ # that represent additional authenticated data. When you use an
5723
6179
  # encryption context to encrypt data, you must specify the same (an
5724
6180
  # exact case-sensitive match) encryption context to decrypt the data. An
5725
- # encryption context is optional when encrypting with a symmetric KMS
5726
- # key, but it is highly recommended.
6181
+ # encryption context is supported only on operations with symmetric
6182
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
6183
+ # an encryption context is optional, but it is strongly recommended.
5727
6184
  #
5728
- # For more information, see [Encryption Context][1] in the *Key
6185
+ # For more information, see [Encryption context][1] in the *Key
5729
6186
  # Management Service Developer Guide*.
5730
6187
  #
5731
6188
  #
@@ -5735,8 +6192,8 @@ module Aws::KMS
5735
6192
  # @option params [String] :source_encryption_algorithm
5736
6193
  # Specifies the encryption algorithm that KMS will use to decrypt the
5737
6194
  # ciphertext before it is reencrypted. The default value,
5738
- # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric KMS
5739
- # keys.
6195
+ # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric
6196
+ # encryption KMS keys.
5740
6197
  #
5741
6198
  # Specify the same algorithm that was used to encrypt the ciphertext. If
5742
6199
  # you specify a different algorithm, the decrypt attempt fails.
@@ -5748,7 +6205,7 @@ module Aws::KMS
5748
6205
  # Specifies the encryption algorithm that KMS will use to reecrypt the
5749
6206
  # data after it has decrypted it. The default value,
5750
6207
  # `SYMMETRIC_DEFAULT`, represents the encryption algorithm used for
5751
- # symmetric KMS keys.
6208
+ # symmetric encryption KMS keys.
5752
6209
  #
5753
6210
  # This parameter is required only when the destination KMS key is an
5754
6211
  # asymmetric KMS key.
@@ -5839,7 +6296,7 @@ module Aws::KMS
5839
6296
  # encrypt data in one Amazon Web Services Region and decrypt it in a
5840
6297
  # different Amazon Web Services Region without re-encrypting the data or
5841
6298
  # making a cross-Region call. For more information about multi-Region
5842
- # keys, see [Using multi-Region keys][1] in the *Key Management Service
6299
+ # keys, see [Multi-Region keys in KMS][1] in the *Key Management Service
5843
6300
  # Developer Guide*.
5844
6301
  #
5845
6302
  # A *replica key* is a fully-functional KMS key that can be used
@@ -5850,8 +6307,8 @@ module Aws::KMS
5850
6307
  # [automatic key rotation status][6]. KMS automatically synchronizes
5851
6308
  # these shared properties among related multi-Region keys. All other
5852
6309
  # properties of a replica key can differ, including its [key policy][7],
5853
- # [tags][8], [aliases][9], and [key state][10]. KMS pricing and quotas
5854
- # for KMS keys apply to each primary key and replica key.
6310
+ # [tags][8], [aliases][9], and [Key states of KMS keys][10]. KMS pricing
6311
+ # and quotas for KMS keys apply to each primary key and replica key.
5855
6312
  #
5856
6313
  # When this operation completes, the new replica key has a transient key
5857
6314
  # state of `Creating`. This key state changes to `Enabled` (or
@@ -5861,9 +6318,17 @@ module Aws::KMS
5861
6318
  # If you are creating and using the replica key programmatically, retry
5862
6319
  # on `KMSInvalidStateException` or call `DescribeKey` to check its
5863
6320
  # `KeyState` value before using it. For details about the `Creating` key
5864
- # state, see [Key state: Effect on your KMS
5865
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
5866
- # Service Developer Guide*.
6321
+ # state, see [Key states of KMS keys][10] in the *Key Management Service
6322
+ # Developer Guide*.
6323
+ #
6324
+ # You cannot create more than one replica of a primary key in any
6325
+ # Region. If the Region already includes a replica of the key you're
6326
+ # trying to replicate, `ReplicateKey` returns an
6327
+ # `AlreadyExistsException` error. If the key state of the existing
6328
+ # replica is `PendingDeletion`, you can cancel the scheduled key
6329
+ # deletion (CancelKeyDeletion) or wait for the key to be deleted. The
6330
+ # new replica key you create will have the same [shared properties][11]
6331
+ # as the original replica key.
5867
6332
  #
5868
6333
  # The CloudTrail log of a `ReplicateKey` operation records a
5869
6334
  # `ReplicateKey` operation in the primary key's Region and a CreateKey
@@ -5916,6 +6381,7 @@ module Aws::KMS
5916
6381
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html
5917
6382
  # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html
5918
6383
  # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
6384
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-sync-properties
5919
6385
  #
5920
6386
  # @option params [required, String] :key_id
5921
6387
  # Identifies the multi-Region primary key that is being replicated. To
@@ -5943,24 +6409,33 @@ module Aws::KMS
5943
6409
  # [KMS service endpoints][1] in the *Amazon Web Services General
5944
6410
  # Reference*.
5945
6411
  #
6412
+ # <note markdown="1"> HMAC KMS keys are not supported in all Amazon Web Services Regions. If
6413
+ # you try to replicate an HMAC KMS key in an Amazon Web Services Region
6414
+ # in which HMAC keys are not supported, the `ReplicateKey` operation
6415
+ # returns an `UnsupportedOperationException`. For a list of Regions in
6416
+ # which HMAC KMS keys are supported, see [HMAC keys in KMS][2] in the
6417
+ # *Key Management Service Developer Guide*.
6418
+ #
6419
+ # </note>
6420
+ #
5946
6421
  # The replica must be in a different Amazon Web Services Region than its
5947
6422
  # primary key and other replicas of that primary key, but in the same
5948
6423
  # Amazon Web Services partition. KMS must be available in the replica
5949
6424
  # Region. If the Region is not enabled by default, the Amazon Web
5950
- # Services account must be enabled in the Region.
5951
- #
5952
- # For information about Amazon Web Services partitions, see [Amazon
5953
- # Resource Names (ARNs) in the *Amazon Web Services General
5954
- # Reference*.][2] For information about enabling and disabling Regions,
5955
- # see [Enabling a Region][3] and [Disabling a Region][4] in the *Amazon
5956
- # Web Services General Reference*.
6425
+ # Services account must be enabled in the Region. For information about
6426
+ # Amazon Web Services partitions, see [Amazon Resource Names (ARNs)][3]
6427
+ # in the *Amazon Web Services General Reference*. For information about
6428
+ # enabling and disabling Regions, see [Enabling a Region][4] and
6429
+ # [Disabling a Region][5] in the *Amazon Web Services General
6430
+ # Reference*.
5957
6431
  #
5958
6432
  #
5959
6433
  #
5960
6434
  # [1]: https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region
5961
- # [2]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
5962
- # [3]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
5963
- # [4]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable
6435
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
6436
+ # [3]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
6437
+ # [4]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
6438
+ # [5]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable
5964
6439
  #
5965
6440
  # @option params [String] :policy
5966
6441
  # The key policy to attach to the KMS key. This parameter is optional.
@@ -5991,7 +6466,20 @@ module Aws::KMS
5991
6466
  # visible][3] in the <i> <i>Identity and Access Management User
5992
6467
  # Guide</i> </i>.
5993
6468
  #
5994
- # * The key policy size quota is 32 kilobytes (32768 bytes).
6469
+ # A key policy document must conform to the following rules.
6470
+ #
6471
+ # * Up to 32 kilobytes (32768 bytes)
6472
+ #
6473
+ # * Must be UTF-8 encoded
6474
+ #
6475
+ # * The only Unicode characters that are permitted in a key policy
6476
+ # document are the horizontal tab (U+0009), linefeed (U+000A),
6477
+ # carriage return (U+000D), and characters in the range U+0020 to
6478
+ # U+00FF.
6479
+ #
6480
+ # * The `Sid` element in a key policy statement can include spaces.
6481
+ # (Spaces are prohibited in the `Sid` element of an IAM policy
6482
+ # document.)
5995
6483
  #
5996
6484
  #
5997
6485
  #
@@ -6034,8 +6522,8 @@ module Aws::KMS
6034
6522
  # TagResource operation.
6035
6523
  #
6036
6524
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6037
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
6038
- # Service Developer Guide*.
6525
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
6526
+ # Developer Guide*.
6039
6527
  #
6040
6528
  # </note>
6041
6529
  #
@@ -6140,7 +6628,7 @@ module Aws::KMS
6140
6628
  # resp.replica_key_metadata.creation_date #=> Time
6141
6629
  # resp.replica_key_metadata.enabled #=> Boolean
6142
6630
  # resp.replica_key_metadata.description #=> String
6143
- # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
6631
+ # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
6144
6632
  # resp.replica_key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
6145
6633
  # resp.replica_key_metadata.deletion_date #=> Time
6146
6634
  # resp.replica_key_metadata.valid_to #=> Time
@@ -6149,8 +6637,8 @@ module Aws::KMS
6149
6637
  # resp.replica_key_metadata.cloud_hsm_cluster_id #=> String
6150
6638
  # resp.replica_key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
6151
6639
  # resp.replica_key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
6152
- # 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"
6153
- # 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"
6640
+ # 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"
6641
+ # 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"
6154
6642
  # resp.replica_key_metadata.encryption_algorithms #=> Array
6155
6643
  # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
6156
6644
  # resp.replica_key_metadata.signing_algorithms #=> Array
@@ -6163,6 +6651,8 @@ module Aws::KMS
6163
6651
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
6164
6652
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].region #=> String
6165
6653
  # resp.replica_key_metadata.pending_deletion_window_in_days #=> Integer
6654
+ # resp.replica_key_metadata.mac_algorithms #=> Array
6655
+ # resp.replica_key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
6166
6656
  # resp.replica_policy #=> String
6167
6657
  # resp.replica_tags #=> Array
6168
6658
  # resp.replica_tags[0].tag_key #=> String
@@ -6184,14 +6674,13 @@ module Aws::KMS
6184
6674
  #
6185
6675
  # This operation can be called by the *retiring principal* for a grant,
6186
6676
  # by the *grantee principal* if the grant allows the `RetireGrant`
6187
- # operation, and by the Amazon Web Services account (root user) in which
6188
- # the grant is created. It can also be called by principals to whom
6189
- # permission for retiring a grant is delegated. For details, see
6190
- # [Retiring and revoking grants][2] in the *Key Management Service
6191
- # Developer Guide*.
6677
+ # operation, and by the Amazon Web Services account in which the grant
6678
+ # is created. It can also be called by principals to whom permission for
6679
+ # retiring a grant is delegated. For details, see [Retiring and revoking
6680
+ # grants][2] in the *Key Management Service Developer Guide*.
6192
6681
  #
6193
6682
  # For detailed information about grants, including grant terminology,
6194
- # see [Using grants][3] in the <i> <i>Key Management Service Developer
6683
+ # see [Grants in KMS][3] in the <i> <i>Key Management Service Developer
6195
6684
  # Guide</i> </i>. For examples of working with grants in several
6196
6685
  # programming languages, see [Programming grants][4].
6197
6686
  #
@@ -6289,7 +6778,7 @@ module Aws::KMS
6289
6778
  # Service Developer Guide</i> </i>.
6290
6779
  #
6291
6780
  # For detailed information about grants, including grant terminology,
6292
- # see [Using grants][3] in the <i> <i>Key Management Service Developer
6781
+ # see [Grants in KMS][3] in the <i> <i>Key Management Service Developer
6293
6782
  # Guide</i> </i>. For examples of working with grants in several
6294
6783
  # programming languages, see [Programming grants][4].
6295
6784
  #
@@ -6406,8 +6895,8 @@ module Aws::KMS
6406
6895
  # Guide*.
6407
6896
  #
6408
6897
  # The KMS key that you use for this operation must be in a compatible
6409
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6410
- # the *Key Management Service Developer Guide*.
6898
+ # key state. For details, see [Key states of KMS keys][5] in the *Key
6899
+ # Management Service Developer Guide*.
6411
6900
  #
6412
6901
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6413
6902
  # key in a different Amazon Web Services account.
@@ -6447,7 +6936,7 @@ module Aws::KMS
6447
6936
  # The waiting period, specified in number of days. After the waiting
6448
6937
  # period ends, KMS deletes the KMS key.
6449
6938
  #
6450
- # If the KMS key is a multi-Region primary key with replicas, the
6939
+ # If the KMS key is a multi-Region primary key with replica keys, the
6451
6940
  # waiting period begins when the last of its replica keys is deleted.
6452
6941
  # Otherwise, the waiting period begins immediately.
6453
6942
  #
@@ -6501,11 +6990,11 @@ module Aws::KMS
6501
6990
  end
6502
6991
 
6503
6992
  # Creates a [digital signature][1] for a message or message digest by
6504
- # using the private key in an asymmetric KMS key. To verify the
6993
+ # using the private key in an asymmetric signing KMS key. To verify the
6505
6994
  # signature, use the Verify operation, or use the public key in the same
6506
- # asymmetric KMS key outside of KMS. For information about symmetric and
6507
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][2]
6508
- # in the *Key Management Service Developer Guide*.
6995
+ # asymmetric KMS key outside of KMS. For information about asymmetric
6996
+ # KMS keys, see [Asymmetric KMS keys][2] in the *Key Management Service
6997
+ # Developer Guide*.
6509
6998
  #
6510
6999
  # Digital signatures are generated and verified by using asymmetric key
6511
7000
  # pair, such as an RSA or ECC pair that is represented by an asymmetric
@@ -6533,14 +7022,23 @@ module Aws::KMS
6533
7022
  # When signing a message, be sure to record the KMS key and the signing
6534
7023
  # algorithm. This information is required to verify the signature.
6535
7024
  #
7025
+ # <note markdown="1"> Best practices recommend that you limit the time during which any
7026
+ # signature is effective. This deters an attack where the actor uses a
7027
+ # signed message to establish validity repeatedly or long after the
7028
+ # message is superseded. Signatures do not include a timestamp, but you
7029
+ # can include a timestamp in the signed message to help you detect when
7030
+ # its time to refresh the signature.
7031
+ #
7032
+ # </note>
7033
+ #
6536
7034
  # To verify the signature that this operation generates, use the Verify
6537
7035
  # operation. Or use the GetPublicKey operation to download the public
6538
7036
  # key and then use the public key to verify the signature outside of
6539
7037
  # KMS.
6540
7038
  #
6541
7039
  # The KMS key that you use for this operation must be in a compatible
6542
- # key state. For details, see [Key state: Effect on your KMS key][3] in
6543
- # the *Key Management Service Developer Guide*.
7040
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
7041
+ # Management Service Developer Guide*.
6544
7042
  #
6545
7043
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
6546
7044
  # in a different Amazon Web Services account, specify the key ARN or
@@ -6667,8 +7165,8 @@ module Aws::KMS
6667
7165
  # Adds or edits tags on a [customer managed key][1].
6668
7166
  #
6669
7167
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6670
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6671
- # Service Developer Guide*.
7168
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7169
+ # Developer Guide*.
6672
7170
  #
6673
7171
  # </note>
6674
7172
  #
@@ -6690,8 +7188,8 @@ module Aws::KMS
6690
7188
  # General Reference*.
6691
7189
  #
6692
7190
  # The KMS key that you use for this operation must be in a compatible
6693
- # key state. For details, see [Key state: Effect on your KMS key][9] in
6694
- # the *Key Management Service Developer Guide*.
7191
+ # key state. For details, see [Key states of KMS keys][9] in the *Key
7192
+ # Management Service Developer Guide*.
6695
7193
  #
6696
7194
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6697
7195
  # key in a different Amazon Web Services account.
@@ -6788,8 +7286,8 @@ module Aws::KMS
6788
7286
  # specify the tag key and the KMS key.
6789
7287
  #
6790
7288
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6791
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6792
- # Service Developer Guide*.
7289
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7290
+ # Developer Guide*.
6793
7291
  #
6794
7292
  # </note>
6795
7293
  #
@@ -6804,8 +7302,8 @@ module Aws::KMS
6804
7302
  # General Reference*.
6805
7303
  #
6806
7304
  # The KMS key that you use for this operation must be in a compatible
6807
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6808
- # the *Key Management Service Developer Guide*.
7305
+ # key state. For details, see [Key states of KMS keys][5] in the *Key
7306
+ # Management Service Developer Guide*.
6809
7307
  #
6810
7308
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6811
7309
  # key in a different Amazon Web Services account.
@@ -6886,8 +7384,8 @@ module Aws::KMS
6886
7384
  # Amazon Web Services account and Region.
6887
7385
  #
6888
7386
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
6889
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
6890
- # Management Service Developer Guide*.
7387
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
7388
+ # Service Developer Guide*.
6891
7389
  #
6892
7390
  # </note>
6893
7391
  #
@@ -6909,8 +7407,8 @@ module Aws::KMS
6909
7407
  # ListAliases operation.
6910
7408
  #
6911
7409
  # The KMS key that you use for this operation must be in a compatible
6912
- # key state. For details, see [Key state: Effect on your KMS key][2] in
6913
- # the *Key Management Service Developer Guide*.
7410
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
7411
+ # Management Service Developer Guide*.
6914
7412
  #
6915
7413
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6916
7414
  # key in a different Amazon Web Services account.
@@ -7175,8 +7673,8 @@ module Aws::KMS
7175
7673
  # key, use DescribeKey.
7176
7674
  #
7177
7675
  # The KMS key that you use for this operation must be in a compatible
7178
- # key state. For details, see [Key state: Effect on your KMS key][1] in
7179
- # the *Key Management Service Developer Guide*.
7676
+ # key state. For details, see [Key states of KMS keys][1] in the *Key
7677
+ # Management Service Developer Guide*.
7180
7678
  #
7181
7679
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
7182
7680
  # key in a different Amazon Web Services account.
@@ -7258,7 +7756,7 @@ module Aws::KMS
7258
7756
  # encrypt data in one Amazon Web Services Region and decrypt it in a
7259
7757
  # different Amazon Web Services Region without re-encrypting the data or
7260
7758
  # making a cross-Region call. For more information about multi-Region
7261
- # keys, see [Using multi-Region keys][2] in the *Key Management Service
7759
+ # keys, see [Multi-Region keys in KMS][2] in the *Key Management Service
7262
7760
  # Developer Guide*.
7263
7761
  #
7264
7762
  # The *primary key* of a multi-Region key is the source for properties
@@ -7288,9 +7786,8 @@ module Aws::KMS
7288
7786
  # can use the keys in cryptographic operations, but you cannot replicate
7289
7787
  # the new primary key or perform certain management operations, such as
7290
7788
  # enabling or disabling these keys. For details about the `Updating` key
7291
- # state, see [Key state: Effect on your KMS
7292
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
7293
- # Service Developer Guide*.
7789
+ # state, see [Key states of KMS keys][9] in the *Key Management Service
7790
+ # Developer Guide*.
7294
7791
  #
7295
7792
  # This operation does not return any output. To verify that primary key
7296
7793
  # is changed, use the DescribeKey operation.
@@ -7323,6 +7820,7 @@ module Aws::KMS
7323
7820
  # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin
7324
7821
  # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
7325
7822
  # [8]: https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html
7823
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
7326
7824
  #
7327
7825
  # @option params [required, String] :key_id
7328
7826
  # Identifies the current primary key. When the operation completes, this
@@ -7379,9 +7877,9 @@ module Aws::KMS
7379
7877
  #
7380
7878
  # A digital signature is generated by using the private key in an
7381
7879
  # asymmetric KMS key. The signature is verified by using the public key
7382
- # in the same asymmetric KMS key. For information about symmetric and
7383
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][1]
7384
- # in the *Key Management Service Developer Guide*.
7880
+ # in the same asymmetric KMS key. For information about asymmetric KMS
7881
+ # keys, see [Asymmetric KMS keys][1] in the *Key Management Service
7882
+ # Developer Guide*.
7385
7883
  #
7386
7884
  # To verify a digital signature, you can use the `Verify` operation.
7387
7885
  # Specify the same asymmetric KMS key, message, and signing algorithm
@@ -7398,8 +7896,8 @@ module Aws::KMS
7398
7896
  # signatures.
7399
7897
  #
7400
7898
  # The KMS key that you use for this operation must be in a compatible
7401
- # key state. For details, see [Key state: Effect on your KMS key][2] in
7402
- # the *Key Management Service Developer Guide*.
7899
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
7900
+ # Management Service Developer Guide*.
7403
7901
  #
7404
7902
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
7405
7903
  # in a different Amazon Web Services account, specify the key ARN or
@@ -7501,7 +7999,7 @@ module Aws::KMS
7501
7999
  # resp.to_h outputs the following:
7502
8000
  # {
7503
8001
  # 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.
7504
- # signature_valid: true, # Indicates whether the signature was verified (true) or failed verification (false).
8002
+ # signature_valid: true, # A value of 'true' Indicates that the signature was verified. If verification fails, the call to Verify fails.
7505
8003
  # signing_algorithm: "ECDSA_SHA_384", # The signing algorithm that was used to verify the signature.
7506
8004
  # }
7507
8005
  #
@@ -7531,6 +8029,128 @@ module Aws::KMS
7531
8029
  req.send_request(options)
7532
8030
  end
7533
8031
 
8032
+ # Verifies the hash-based message authentication code (HMAC) for a
8033
+ # specified message, HMAC KMS key, and MAC algorithm. To verify the
8034
+ # HMAC, `VerifyMac` computes an HMAC using the message, HMAC KMS key,
8035
+ # and MAC algorithm that you specify, and compares the computed HMAC to
8036
+ # the HMAC that you specify. If the HMACs are identical, the
8037
+ # verification succeeds; otherwise, it fails.
8038
+ #
8039
+ # Verification indicates that the message hasn't changed since the HMAC
8040
+ # was calculated, and the specified key was used to generate and verify
8041
+ # the HMAC.
8042
+ #
8043
+ # This operation is part of KMS support for HMAC KMS keys. For details,
8044
+ # see [HMAC keys in KMS][1] in the *Key Management Service Developer
8045
+ # Guide*.
8046
+ #
8047
+ # The KMS key that you use for this operation must be in a compatible
8048
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
8049
+ # Management Service Developer Guide*.
8050
+ #
8051
+ # **Cross-account use**\: Yes. To perform this operation with a KMS key
8052
+ # in a different Amazon Web Services account, specify the key ARN or
8053
+ # alias ARN in the value of the `KeyId` parameter.
8054
+ #
8055
+ # **Required permissions**\: [kms:VerifyMac][3] (key policy)
8056
+ #
8057
+ # **Related operations**\: GenerateMac
8058
+ #
8059
+ #
8060
+ #
8061
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
8062
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
8063
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
8064
+ #
8065
+ # @option params [required, String, StringIO, File] :message
8066
+ # The message that will be used in the verification. Enter the same
8067
+ # message that was used to generate the HMAC.
8068
+ #
8069
+ # GenerateMac and `VerifyMac` do not provide special handling for
8070
+ # message digests. If you generated an HMAC for a hash digest of a
8071
+ # message, you must verify the HMAC for the same hash digest.
8072
+ #
8073
+ # @option params [required, String] :key_id
8074
+ # The KMS key that will be used in the verification.
8075
+ #
8076
+ # Enter a key ID of the KMS key that was used to generate the HMAC. If
8077
+ # you identify a different KMS key, the `VerifyMac` operation fails.
8078
+ #
8079
+ # @option params [required, String] :mac_algorithm
8080
+ # The MAC algorithm that will be used in the verification. Enter the
8081
+ # same MAC algorithm that was used to compute the HMAC. This algorithm
8082
+ # must be supported by the HMAC KMS key identified by the `KeyId`
8083
+ # parameter.
8084
+ #
8085
+ # @option params [required, String, StringIO, File] :mac
8086
+ # The HMAC to verify. Enter the HMAC that was generated by the
8087
+ # GenerateMac operation when you specified the same message, HMAC KMS
8088
+ # key, and MAC algorithm as the values specified in this request.
8089
+ #
8090
+ # @option params [Array<String>] :grant_tokens
8091
+ # A list of grant tokens.
8092
+ #
8093
+ # Use a grant token when your permission to call this operation comes
8094
+ # from a new grant that has not yet achieved *eventual consistency*. For
8095
+ # more information, see [Grant token][1] and [Using a grant token][2] in
8096
+ # the *Key Management Service Developer Guide*.
8097
+ #
8098
+ #
8099
+ #
8100
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
8101
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
8102
+ #
8103
+ # @return [Types::VerifyMacResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
8104
+ #
8105
+ # * {Types::VerifyMacResponse#key_id #key_id} => String
8106
+ # * {Types::VerifyMacResponse#mac_valid #mac_valid} => Boolean
8107
+ # * {Types::VerifyMacResponse#mac_algorithm #mac_algorithm} => String
8108
+ #
8109
+ #
8110
+ # @example Example: To verify an HMAC
8111
+ #
8112
+ # # This example verifies an HMAC for a particular message, HMAC KMS keys, and MAC algorithm. A value of 'true' in the
8113
+ # # MacValid value in the response indicates that the HMAC is valid.
8114
+ #
8115
+ # resp = client.verify_mac({
8116
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The HMAC KMS key input to the HMAC algorithm.
8117
+ # mac: "<HMAC_TAG>", # The HMAC to be verified.
8118
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm requested for the operation.
8119
+ # message: "Hello World", # The message input to the HMAC algorithm.
8120
+ # })
8121
+ #
8122
+ # resp.to_h outputs the following:
8123
+ # {
8124
+ # 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.
8125
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm used in the operation.
8126
+ # mac_valid: true, # A value of 'true' indicates that verification succeeded. If verification fails, the call to VerifyMac fails.
8127
+ # }
8128
+ #
8129
+ # @example Request syntax with placeholder values
8130
+ #
8131
+ # resp = client.verify_mac({
8132
+ # message: "data", # required
8133
+ # key_id: "KeyIdType", # required
8134
+ # mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
8135
+ # mac: "data", # required
8136
+ # grant_tokens: ["GrantTokenType"],
8137
+ # })
8138
+ #
8139
+ # @example Response structure
8140
+ #
8141
+ # resp.key_id #=> String
8142
+ # resp.mac_valid #=> Boolean
8143
+ # resp.mac_algorithm #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
8144
+ #
8145
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/VerifyMac AWS API Documentation
8146
+ #
8147
+ # @overload verify_mac(params = {})
8148
+ # @param [Hash] params ({})
8149
+ def verify_mac(params = {}, options = {})
8150
+ req = build_request(:verify_mac, params)
8151
+ req.send_request(options)
8152
+ end
8153
+
7534
8154
  # @!endgroup
7535
8155
 
7536
8156
  # @param params ({})
@@ -7544,7 +8164,7 @@ module Aws::KMS
7544
8164
  params: params,
7545
8165
  config: config)
7546
8166
  context[:gem_name] = 'aws-sdk-kms'
7547
- context[:gem_version] = '1.54.0'
8167
+ context[:gem_version] = '1.57.0'
7548
8168
  Seahorse::Client::Request.new(handlers, context)
7549
8169
  end
7550
8170