aws-sdk-kms 1.55.0 → 1.56.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -370,8 +370,8 @@ module Aws::KMS
370
370
  # Developer Guide*.
371
371
  #
372
372
  # The KMS key that you use for this operation must be in a compatible
373
- # key state. For details, see [Key state: Effect on your KMS key][2] in
374
- # the *Key Management Service Developer Guide*.
373
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
374
+ # Management Service Developer Guide*.
375
375
  #
376
376
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
377
377
  # key in a different Amazon Web Services account.
@@ -544,8 +544,8 @@ module Aws::KMS
544
544
  # Creates a friendly name for a KMS key.
545
545
  #
546
546
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
547
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
548
- # Management Service Developer Guide*.
547
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
548
+ # Service Developer Guide*.
549
549
  #
550
550
  # </note>
551
551
  #
@@ -570,8 +570,8 @@ module Aws::KMS
570
570
  # created, use the ListAliases operation.
571
571
  #
572
572
  # The KMS key that you use for this operation must be in a compatible
573
- # key state. For details, see [Key state: Effect on your KMS key][4] in
574
- # the *Key Management Service Developer Guide*.
573
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
574
+ # Management Service Developer Guide*.
575
575
  #
576
576
  # **Cross-account use**\: No. You cannot perform this operation on an
577
577
  # alias in a different Amazon Web Services account.
@@ -812,7 +812,7 @@ module Aws::KMS
812
812
  # and delete it without changing your key policies or IAM policies.
813
813
  #
814
814
  # For detailed information about grants, including grant terminology,
815
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
815
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
816
816
  # Guide</i> </i>. For examples of working with grants in several
817
817
  # programming languages, see [Programming grants][2].
818
818
  #
@@ -835,8 +835,8 @@ module Aws::KMS
835
835
  # the ListGrants or ListRetirableGrants operations.
836
836
  #
837
837
  # The KMS key that you use for this operation must be in a compatible
838
- # key state. For details, see [Key state: Effect on your KMS key][4] in
839
- # the *Key Management Service Developer Guide*.
838
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
839
+ # Management Service Developer Guide*.
840
840
  #
841
841
  # **Cross-account use**\: Yes. To perform this operation on a KMS key in
842
842
  # a different Amazon Web Services account, specify the key ARN in the
@@ -921,12 +921,13 @@ module Aws::KMS
921
921
  # @option params [required, Array<String>] :operations
922
922
  # A list of operations that the grant permits.
923
923
  #
924
- # The operation must be supported on the KMS key. For example, you
925
- # cannot create a grant for a symmetric KMS key that allows the Sign
926
- # operation, or a grant for an asymmetric KMS key that allows the
927
- # GenerateDataKey operation. If you try, KMS returns a `ValidationError`
928
- # exception. For details, see [Grant operations][1] in the *Key
929
- # Management Service Developer Guide*.
924
+ # This list must include only operations that are permitted in a grant.
925
+ # Also, the operation must be supported on the KMS key. For example, you
926
+ # cannot create a grant for a symmetric encryption KMS key that allows
927
+ # the Sign operation, or a grant for an asymmetric KMS key that allows
928
+ # the GenerateDataKey operation. If you try, KMS returns a
929
+ # `ValidationError` exception. For details, see [Grant operations][1] in
930
+ # the *Key Management Service Developer Guide*.
930
931
  #
931
932
  #
932
933
  #
@@ -938,27 +939,38 @@ module Aws::KMS
938
939
  # KMS supports the `EncryptionContextEquals` and
939
940
  # `EncryptionContextSubset` grant constraints. Each constraint value can
940
941
  # include up to 8 encryption context pairs. The encryption context value
941
- # in each constraint cannot exceed 384 characters.
942
- #
943
- # These grant constraints allow the permissions in the grant only when
944
- # the encryption context in the request matches
945
- # (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
946
- # the encryption context specified in this structure. For information
947
- # about grant constraints, see [Using grant constraints][1] in the *Key
942
+ # in each constraint cannot exceed 384 characters. For information about
943
+ # grant constraints, see [Using grant constraints][1] in the *Key
948
944
  # Management Service Developer Guide*. For more information about
949
- # encryption context, see [Encryption Context][2] in the <i> <i>Key
945
+ # encryption context, see [Encryption context][2] in the <i> <i>Key
950
946
  # Management Service Developer Guide</i> </i>.
951
947
  #
952
- # The encryption context grant constraints are supported only on
953
- # operations that include an encryption context. You cannot use an
954
- # encryption context grant constraint for cryptographic operations with
955
- # asymmetric KMS keys or for management operations, such as DescribeKey
956
- # or RetireGrant.
948
+ # The encryption context grant constraints allow the permissions in the
949
+ # grant only when the encryption context in the request matches
950
+ # (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
951
+ # the encryption context specified in this structure.
952
+ #
953
+ # The encryption context grant constraints are supported only on [grant
954
+ # operations][3] that include an `EncryptionContext` parameter, such as
955
+ # cryptographic operations on symmetric encryption KMS keys. Grants with
956
+ # grant constraints can include the DescribeKey and RetireGrant
957
+ # operations, but the constraint doesn't apply to these operations. If
958
+ # a grant with a grant constraint includes the `CreateGrant` operation,
959
+ # the constraint requires that any grants created with the `CreateGrant`
960
+ # permission have an equally strict or stricter encryption context
961
+ # constraint.
962
+ #
963
+ # You cannot use an encryption context grant constraint for
964
+ # cryptographic operations with asymmetric KMS keys or HMAC KMS keys.
965
+ # These keys don't support an encryption context.
966
+ #
967
+ #
957
968
  #
958
969
  #
959
970
  #
960
971
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints
961
972
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
973
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations
962
974
  #
963
975
  # @option params [Array<String>] :grant_tokens
964
976
  # A list of grant tokens.
@@ -1020,7 +1032,7 @@ module Aws::KMS
1020
1032
  # key_id: "KeyIdType", # required
1021
1033
  # grantee_principal: "PrincipalIdType", # required
1022
1034
  # retiring_principal: "PrincipalIdType",
1023
- # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext
1035
+ # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac
1024
1036
  # constraints: {
1025
1037
  # encryption_context_subset: {
1026
1038
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -1050,35 +1062,35 @@ module Aws::KMS
1050
1062
  # Creates a unique customer managed [KMS key][1] in your Amazon Web
1051
1063
  # Services account and Region.
1052
1064
  #
1065
+ # In addition to the required parameters, you can use the optional
1066
+ # parameters to specify a key policy, description, tags, and other
1067
+ # useful elements for any key type.
1068
+ #
1053
1069
  # <note markdown="1"> KMS is replacing the term *customer master key (CMK)* with *KMS key*
1054
1070
  # and *KMS key*. The concept has not changed. To prevent breaking
1055
1071
  # changes, KMS is keeping some variations of this term.
1056
1072
  #
1057
1073
  # </note>
1058
1074
  #
1059
- # You can use the `CreateKey` operation to create symmetric or
1060
- # asymmetric KMS keys.
1075
+ # To create different types of KMS keys, use the following guidance:
1076
+ #
1077
+ # Symmetric encryption KMS key
1061
1078
  #
1062
- # * **Symmetric KMS keys** contain a 256-bit symmetric key that never
1063
- # leaves KMS unencrypted. To use the KMS key, you must call KMS. You
1064
- # can use a symmetric KMS key to encrypt and decrypt small amounts of
1065
- # data, but they are typically used to generate [data keys][2] and
1066
- # [data keys pairs][3]. For details, see GenerateDataKey and
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
1067
1091
  # GenerateDataKeyPair.
1068
1092
  #
1069
- # * **Asymmetric KMS keys** can contain an RSA key pair or an Elliptic
1070
- # Curve (ECC) key pair. The private key in an asymmetric KMS key never
1071
- # leaves KMS unencrypted. However, you can use the GetPublicKey
1072
- # operation to download the public key so it can be used outside of
1073
- # KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt
1074
- # data or sign and verify messages (but not both). KMS keys with ECC
1075
- # key pairs can be used only to sign and verify messages.
1076
- #
1077
- # For information about symmetric and asymmetric KMS keys, see [Using
1078
- # Symmetric and Asymmetric KMS keys][4] in the *Key Management Service
1079
- # Developer Guide*.
1080
1093
  #
1081
- # To create different types of KMS keys, use the following guidance:
1082
1094
  #
1083
1095
  # Asymmetric KMS keys
1084
1096
  #
@@ -1088,14 +1100,37 @@ module Aws::KMS
1088
1100
  # to encrypt and decrypt or sign and verify. You can't change these
1089
1101
  # properties after the KMS key is created.
1090
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 AWS KMS unencrypted. However, you can use the GetPublicKey
1106
+ # operation to download the public key so it can be used outside of
1107
+ # AWS KMS. KMS keys with RSA key pairs can be used to encrypt or
1108
+ # decrypt data or sign and verify messages (but not both). KMS keys
1109
+ # with ECC 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*.
1091
1112
  #
1092
1113
  #
1093
- # Symmetric KMS keys
1094
1114
  #
1095
- # : When creating a symmetric KMS key, you don't need to specify the
1096
- # `KeySpec` or `KeyUsage` parameters. The default value for `KeySpec`,
1097
- # `SYMMETRIC_DEFAULT`, and the default value for `KeyUsage`,
1098
- # `ENCRYPT_DECRYPT`, are the only valid values for symmetric KMS keys.
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*.
1099
1134
  #
1100
1135
  #
1101
1136
  #
@@ -1110,6 +1145,12 @@ module Aws::KMS
1110
1145
  # operation. To change a replica key to a primary key, and its primary
1111
1146
  # key to a replica key, use the UpdatePrimaryRegion operation.
1112
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
+ #
1113
1154
  # This operation supports *multi-Region keys*, an KMS feature that
1114
1155
  # lets you create multiple interoperable KMS keys in different Amazon
1115
1156
  # Web Services Regions. Because these KMS keys have the same key ID,
@@ -1117,57 +1158,57 @@ module Aws::KMS
1117
1158
  # to encrypt data in one Amazon Web Services Region and decrypt it in
1118
1159
  # a different Amazon Web Services Region without re-encrypting the
1119
1160
  # data or making a cross-Region call. For more information about
1120
- # 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
1121
1162
  # Management Service Developer Guide*.
1122
1163
  #
1123
- # You can create symmetric and asymmetric multi-Region keys and
1124
- # multi-Region keys with imported key material. You cannot create
1125
- # multi-Region keys in a custom key store.
1126
1164
  #
1127
1165
  #
1128
- #
1129
- # : To import your own key material, begin by creating a symmetric KMS
1130
- # key with no key material. To do this, use the `Origin` parameter of
1131
- # `CreateKey` with a value of `EXTERNAL`. Next, use
1132
- # GetParametersForImport operation to get a public key and import
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
1133
1170
  # token, and use the public key to encrypt your key material. Then,
1134
1171
  # use ImportKeyMaterial with your import token to import the key
1135
1172
  # material. For step-by-step instructions, see [Importing Key
1136
- # Material][6] in the <i> <i>Key Management Service Developer
1137
- # Guide</i> </i>. You cannot import the key material into an
1138
- # asymmetric KMS key.
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.
1139
1179
  #
1140
1180
  # To create a multi-Region primary key with imported key material, use
1141
1181
  # the `Origin` parameter of `CreateKey` with a value of `EXTERNAL` and
1142
1182
  # the `MultiRegion` parameter with a value of `True`. To create
1143
1183
  # replicas of the multi-Region primary key, use the ReplicateKey
1144
- # operation. For more information about multi-Region keys, see [Using
1145
- # multi-Region keys][5] in the *Key Management Service Developer
1146
- # Guide*.
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*.
1147
1187
  #
1148
1188
  #
1149
1189
  #
1150
1190
  # Custom key store
1151
1191
  #
1152
- # : To create a symmetric KMS key in a [custom key store][7], use the
1153
- # `CustomKeyStoreId` parameter to specify the custom key store. You
1154
- # must also use the `Origin` parameter with a value of `AWS_CLOUDHSM`.
1155
- # The CloudHSM cluster that is associated with the custom key store
1156
- # must have at least two active HSMs in different Availability Zones
1157
- # in the Amazon Web Services Region.
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.
1158
1198
  #
1159
- # You cannot create an asymmetric KMS key in a custom key store. For
1160
- # information about custom key stores in KMS see [Using Custom Key
1161
- # Stores][7] in the <i> <i>Key Management Service Developer Guide</i>
1162
- # </i>.
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>.
1163
1204
  #
1164
1205
  # **Cross-account use**\: No. You cannot use this operation to create a
1165
1206
  # KMS key in a different Amazon Web Services account.
1166
1207
  #
1167
- # **Required permissions**\: [kms:CreateKey][8] (IAM policy). To use the
1168
- # `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
1169
1210
  # information about related permissions, see [Allow a user to create KMS
1170
- # keys][9] in the *Key Management Service Developer Guide*.
1211
+ # keys][8] in the *Key Management Service Developer Guide*.
1171
1212
  #
1172
1213
  # **Related operations:**
1173
1214
  #
@@ -1180,14 +1221,13 @@ module Aws::KMS
1180
1221
  #
1181
1222
  #
1182
1223
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys
1183
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
1184
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs
1185
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1186
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
1187
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
1188
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
1189
- # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
1190
- # [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
1191
1231
  #
1192
1232
  # @option params [String] :policy
1193
1233
  # The key policy to attach to the KMS key.
@@ -1242,14 +1282,17 @@ module Aws::KMS
1242
1282
  # @option params [String] :key_usage
1243
1283
  # Determines the [cryptographic operations][1] for which you can use the
1244
1284
  # KMS key. The default value is `ENCRYPT_DECRYPT`. This parameter is
1245
- # required only for asymmetric KMS keys. You can't change the
1246
- # `KeyUsage` value after the KMS key is created.
1285
+ # optional when you are creating a symmetric encryption KMS key;
1286
+ # otherwise, it is required. You can't change the `KeyUsage` value
1287
+ # after the KMS key is created.
1247
1288
  #
1248
1289
  # Select only one valid value.
1249
1290
  #
1250
- # * For symmetric KMS keys, omit the parameter or specify
1291
+ # * For symmetric encryption KMS keys, omit the parameter or specify
1251
1292
  # `ENCRYPT_DECRYPT`.
1252
1293
  #
1294
+ # * For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
1295
+ #
1253
1296
  # * For asymmetric KMS keys with RSA key material, specify
1254
1297
  # `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1255
1298
  #
@@ -1272,32 +1315,40 @@ module Aws::KMS
1272
1315
  # Specifies the type of KMS key to create. The default value,
1273
1316
  # `SYMMETRIC_DEFAULT`, creates a KMS key with a 256-bit symmetric key
1274
1317
  # for encryption and decryption. For help choosing a key spec for your
1275
- # KMS key, see [How to Choose Your KMS key Configuration][1] in the <i>
1276
- # <i>Key Management Service Developer Guide</i> </i>.
1318
+ # KMS key, see [Choosing a KMS key type][1] in the <i> <i>Key Management
1319
+ # Service Developer Guide</i> </i>.
1277
1320
  #
1278
1321
  # The `KeySpec` determines whether the KMS key contains a symmetric key
1279
- # or an asymmetric key pair. It also determines the encryption
1280
- # algorithms or signing algorithms that the KMS key supports. You can't
1281
- # change the `KeySpec` after the KMS key is created. To further restrict
1282
- # the algorithms that can be used with the KMS key, use a condition key
1283
- # in its key policy or IAM policy. For more information, see
1284
- # [kms:EncryptionAlgorithm][2] or [kms:Signing Algorithm][3] in the <i>
1285
- # <i>Key Management Service Developer Guide</i> </i>.
1286
- #
1287
- # [Amazon Web Services services that are integrated with KMS][4] use
1288
- # symmetric KMS keys to protect your data. These services do not support
1289
- # asymmetric KMS keys. For help determining whether a KMS key is
1290
- # symmetric or asymmetric, see [Identifying Symmetric and Asymmetric KMS
1291
- # keys][5] in the *Key Management Service Developer Guide*.
1322
+ # or an asymmetric key pair. It also determines the algorithms that the
1323
+ # KMS key supports. You can't change the `KeySpec` after the KMS key is
1324
+ # created. To further restrict the algorithms that can be used with the
1325
+ # KMS key, use a condition key in its key policy or IAM policy. For more
1326
+ # information, see [kms:EncryptionAlgorithm][2], [kms:MacAlgorithm][3]
1327
+ # or [kms:Signing Algorithm][4] in the <i> <i>Key Management Service
1328
+ # Developer Guide</i> </i>.
1329
+ #
1330
+ # [Amazon Web Services services that are integrated with KMS][5] use
1331
+ # symmetric encryption KMS keys to protect your data. These services do
1332
+ # not support asymmetric KMS keys or HMAC KMS keys.
1292
1333
  #
1293
1334
  # KMS supports the following key specs for KMS keys:
1294
1335
  #
1295
- # * Symmetric key (default)
1336
+ # * Symmetric encryption key (default)
1296
1337
  #
1297
1338
  # * `SYMMETRIC_DEFAULT` (AES-256-GCM)
1298
1339
  #
1299
1340
  # ^
1300
1341
  #
1342
+ # * HMAC keys (symmetric)
1343
+ #
1344
+ # * `HMAC_224`
1345
+ #
1346
+ # * `HMAC_256`
1347
+ #
1348
+ # * `HMAC_384`
1349
+ #
1350
+ # * `HMAC_512`
1351
+ #
1301
1352
  # * Asymmetric RSA key pairs
1302
1353
  #
1303
1354
  # * `RSA_2048`
@@ -1322,11 +1373,11 @@ module Aws::KMS
1322
1373
  #
1323
1374
  #
1324
1375
  #
1325
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html
1376
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose
1326
1377
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm
1327
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1328
- # [4]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1329
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html
1378
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-mac-algorithm
1379
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1380
+ # [5]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1330
1381
  #
1331
1382
  # @option params [String] :origin
1332
1383
  # The source of the key material for the KMS key. You cannot change the
@@ -1337,13 +1388,13 @@ module Aws::KMS
1337
1388
  # set the value to `EXTERNAL`. For more information about importing key
1338
1389
  # material into KMS, see [Importing Key Material][1] in the *Key
1339
1390
  # Management Service Developer Guide*. This value is valid only for
1340
- # symmetric KMS keys.
1391
+ # symmetric encryption KMS keys.
1341
1392
  #
1342
1393
  # To create a KMS key in an KMS [custom key store][2] and create its key
1343
1394
  # material in the associated CloudHSM cluster, set this value to
1344
1395
  # `AWS_CLOUDHSM`. You must also use the `CustomKeyStoreId` parameter to
1345
1396
  # identify the custom key store. This value is valid only for symmetric
1346
- # KMS keys.
1397
+ # encryption KMS keys.
1347
1398
  #
1348
1399
  #
1349
1400
  #
@@ -1358,9 +1409,9 @@ module Aws::KMS
1358
1409
  # the custom key store must have at least two active HSMs, each in a
1359
1410
  # different Availability Zone in the Region.
1360
1411
  #
1361
- # This parameter is valid only for symmetric KMS keys and regional KMS
1362
- # keys. You cannot create an asymmetric KMS key or a multi-Region key in
1363
- # a custom key store.
1412
+ # This parameter is valid only for symmetric encryption KMS keys in a
1413
+ # single Region. You cannot create any other type of KMS key in a custom
1414
+ # key store.
1364
1415
  #
1365
1416
  # To find the ID of a custom key store, use the DescribeCustomKeyStores
1366
1417
  # operation.
@@ -1403,8 +1454,8 @@ module Aws::KMS
1403
1454
  # TagResource operation.
1404
1455
  #
1405
1456
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
1406
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
1407
- # Service Developer Guide*.
1457
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
1458
+ # Developer Guide*.
1408
1459
  #
1409
1460
  # </note>
1410
1461
  #
@@ -1444,7 +1495,7 @@ module Aws::KMS
1444
1495
  # encrypt data in one Amazon Web Services Region and decrypt it in a
1445
1496
  # different Amazon Web Services Region without re-encrypting the data or
1446
1497
  # making a cross-Region call. For more information about multi-Region
1447
- # keys, see [Using multi-Region keys][1] in the *Key Management Service
1498
+ # keys, see [Multi-Region keys in KMS][1] in the *Key Management Service
1448
1499
  # Developer Guide*.
1449
1500
  #
1450
1501
  # This value creates a *primary key*, not a replica. To create a
@@ -1665,14 +1716,46 @@ module Aws::KMS
1665
1716
  # }, # Detailed information about the KMS key that this operation creates.
1666
1717
  # }
1667
1718
  #
1719
+ # @example Example: To create an HMAC KMS key
1720
+ #
1721
+ # # This example creates a 384-bit symmetric HMAC KMS key. The GENERATE_VERIFY_MAC key usage value is required even though
1722
+ # # 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.
1723
+ #
1724
+ # resp = client.create_key({
1725
+ # key_spec: "HMAC_384", # Describes the type of key material in the KMS key.
1726
+ # key_usage: "GENERATE_VERIFY_MAC", # The cryptographic operations for which you can use the KMS key.
1727
+ # })
1728
+ #
1729
+ # resp.to_h outputs the following:
1730
+ # {
1731
+ # key_metadata: {
1732
+ # aws_account_id: "111122223333",
1733
+ # arn: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
1734
+ # creation_date: Time.parse("2022-04-05T14:04:55-07:00"),
1735
+ # customer_master_key_spec: "HMAC_384",
1736
+ # description: "",
1737
+ # enabled: true,
1738
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
1739
+ # key_manager: "CUSTOMER",
1740
+ # key_spec: "HMAC_384",
1741
+ # key_state: "Enabled",
1742
+ # key_usage: "GENERATE_VERIFY_MAC",
1743
+ # mac_algorithms: [
1744
+ # "HMAC_SHA_384",
1745
+ # ],
1746
+ # multi_region: false,
1747
+ # origin: "AWS_KMS",
1748
+ # }, # Detailed information about the KMS key that this operation creates.
1749
+ # }
1750
+ #
1668
1751
  # @example Request syntax with placeholder values
1669
1752
  #
1670
1753
  # resp = client.create_key({
1671
1754
  # policy: "PolicyType",
1672
1755
  # description: "DescriptionType",
1673
- # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT
1674
- # customer_master_key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT
1675
- # key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT
1756
+ # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
1757
+ # 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
1758
+ # 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
1676
1759
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM
1677
1760
  # custom_key_store_id: "CustomKeyStoreIdType",
1678
1761
  # bypass_policy_lockout_safety_check: false,
@@ -1693,7 +1776,7 @@ module Aws::KMS
1693
1776
  # resp.key_metadata.creation_date #=> Time
1694
1777
  # resp.key_metadata.enabled #=> Boolean
1695
1778
  # resp.key_metadata.description #=> String
1696
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
1779
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
1697
1780
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
1698
1781
  # resp.key_metadata.deletion_date #=> Time
1699
1782
  # resp.key_metadata.valid_to #=> Time
@@ -1702,8 +1785,8 @@ module Aws::KMS
1702
1785
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
1703
1786
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
1704
1787
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
1705
- # resp.key_metadata.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
1706
- # resp.key_metadata.key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
1788
+ # 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"
1789
+ # 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"
1707
1790
  # resp.key_metadata.encryption_algorithms #=> Array
1708
1791
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1709
1792
  # resp.key_metadata.signing_algorithms #=> Array
@@ -1716,6 +1799,8 @@ module Aws::KMS
1716
1799
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
1717
1800
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
1718
1801
  # resp.key_metadata.pending_deletion_window_in_days #=> Integer
1802
+ # resp.key_metadata.mac_algorithms #=> Array
1803
+ # resp.key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
1719
1804
  #
1720
1805
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey AWS API Documentation
1721
1806
  #
@@ -1740,29 +1825,30 @@ module Aws::KMS
1740
1825
  # * GenerateDataKeyPairWithoutPlaintext
1741
1826
  #
1742
1827
  # You can use this operation to decrypt ciphertext that was encrypted
1743
- # under a symmetric or asymmetric KMS key. When the KMS key is
1744
- # asymmetric, you must specify the KMS key and the encryption algorithm
1745
- # that was used to encrypt the ciphertext. For information about
1746
- # symmetric and asymmetric KMS keys, see [Using Symmetric and Asymmetric
1747
- # KMS keys][1] in the *Key Management Service Developer Guide*.
1828
+ # under a symmetric encryption KMS key or an asymmetric encryption KMS
1829
+ # key. When the KMS key is asymmetric, you must specify the KMS key and
1830
+ # the encryption algorithm that was used to encrypt the ciphertext. For
1831
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
1832
+ # the *Key Management Service Developer Guide*.
1748
1833
  #
1749
- # The Decrypt operation also decrypts ciphertext that was encrypted
1834
+ # The `Decrypt` operation also decrypts ciphertext that was encrypted
1750
1835
  # outside of KMS by the public key in an KMS asymmetric KMS key.
1751
- # However, it cannot decrypt ciphertext produced by other libraries,
1752
- # such as the [Amazon Web Services Encryption SDK][2] or [Amazon S3
1753
- # client-side encryption][3]. These libraries return a ciphertext format
1754
- # that is incompatible with KMS.
1755
- #
1756
- # If the ciphertext was encrypted under a symmetric KMS key, the `KeyId`
1757
- # parameter is optional. KMS can get this information from metadata that
1758
- # it adds to the symmetric ciphertext blob. This feature adds durability
1759
- # to your implementation by ensuring that authorized users can decrypt
1760
- # ciphertext decades after it was encrypted, even if they've lost track
1761
- # of the key ID. However, specifying the KMS key is always recommended
1762
- # as a best practice. When you use the `KeyId` parameter to specify a
1763
- # KMS key, KMS only uses the KMS key you specify. If the ciphertext was
1764
- # encrypted under a different KMS key, the `Decrypt` operation fails.
1765
- # This practice ensures that you use the KMS key that you intend.
1836
+ # However, it cannot decrypt symmetric ciphertext produced by other
1837
+ # libraries, such as the [Amazon Web Services Encryption SDK][2] or
1838
+ # [Amazon S3 client-side encryption][3]. These libraries return a
1839
+ # ciphertext format that is incompatible with KMS.
1840
+ #
1841
+ # If the ciphertext was encrypted under a symmetric encryption KMS key,
1842
+ # the `KeyId` parameter is optional. KMS can get this information from
1843
+ # metadata that it adds to the symmetric ciphertext blob. This feature
1844
+ # adds durability to your implementation by ensuring that authorized
1845
+ # users can decrypt ciphertext decades after it was encrypted, even if
1846
+ # they've lost track of the key ID. However, specifying the KMS key is
1847
+ # always recommended as a best practice. When you use the `KeyId`
1848
+ # parameter to specify a KMS key, KMS only uses the KMS key you specify.
1849
+ # If the ciphertext was encrypted under a different KMS key, the
1850
+ # `Decrypt` operation fails. This practice ensures that you use the KMS
1851
+ # key that you intend.
1766
1852
  #
1767
1853
  # Whenever possible, use key policies to give users permission to call
1768
1854
  # the `Decrypt` operation on a particular KMS key, instead of using IAM
@@ -1781,8 +1867,8 @@ module Aws::KMS
1781
1867
  # Service Developer Guide*.
1782
1868
  #
1783
1869
  # The KMS key that you use for this operation must be in a compatible
1784
- # key state. For details, see [Key state: Effect on your KMS key][7] in
1785
- # the *Key Management Service Developer Guide*.
1870
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
1871
+ # Management Service Developer Guide*.
1786
1872
  #
1787
1873
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
1788
1874
  # in a different Amazon Web Services account, specify the key ARN or
@@ -1817,17 +1903,19 @@ module Aws::KMS
1817
1903
  # @option params [Hash<String,String>] :encryption_context
1818
1904
  # Specifies the encryption context to use when decrypting the data. An
1819
1905
  # encryption context is valid only for [cryptographic operations][1]
1820
- # with a symmetric KMS key. The standard asymmetric encryption
1821
- # algorithms that KMS uses do not support an encryption context.
1906
+ # with a symmetric encryption KMS key. The standard asymmetric
1907
+ # encryption algorithms and HMAC algorithms that KMS uses do not support
1908
+ # an encryption context.
1822
1909
  #
1823
1910
  # An *encryption context* is a collection of non-secret key-value pairs
1824
- # that represents additional authenticated data. When you use an
1911
+ # that represent additional authenticated data. When you use an
1825
1912
  # encryption context to encrypt data, you must specify the same (an
1826
1913
  # exact case-sensitive match) encryption context to decrypt the data. An
1827
- # encryption context is optional when encrypting with a symmetric KMS
1828
- # key, but it is highly recommended.
1914
+ # encryption context is supported only on operations with symmetric
1915
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
1916
+ # an encryption context is optional, but it is strongly recommended.
1829
1917
  #
1830
- # For more information, see [Encryption Context][2] in the *Key
1918
+ # For more information, see [Encryption context][2] in the *Key
1831
1919
  # Management Service Developer Guide*.
1832
1920
  #
1833
1921
  #
@@ -1849,14 +1937,18 @@ module Aws::KMS
1849
1937
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
1850
1938
  #
1851
1939
  # @option params [String] :key_id
1852
- # Specifies the KMS key that KMS uses to decrypt the ciphertext. Enter a
1853
- # key ID of the KMS key that was used to encrypt the ciphertext.
1940
+ # Specifies the KMS key that KMS uses to decrypt the ciphertext.
1941
+ #
1942
+ # Enter a key ID of the KMS key that was used to encrypt the ciphertext.
1943
+ # If you identify a different KMS key, the `Decrypt` operation throws an
1944
+ # `IncorrectKeyException`.
1854
1945
  #
1855
1946
  # This parameter is required only when the ciphertext was encrypted
1856
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
1857
- # get the KMS key from metadata that it adds to the symmetric ciphertext
1858
- # blob. However, it is always recommended as a best practice. This
1859
- # practice ensures that you use the KMS key that you intend.
1947
+ # under an asymmetric KMS key. If you used a symmetric encryption KMS
1948
+ # key, KMS can get the KMS key from metadata that it adds to the
1949
+ # symmetric ciphertext blob. However, it is always recommended as a best
1950
+ # practice. This practice ensures that you use the KMS key that you
1951
+ # intend.
1860
1952
  #
1861
1953
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
1862
1954
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -1886,7 +1978,7 @@ module Aws::KMS
1886
1978
  # This parameter is required only when the ciphertext was encrypted
1887
1979
  # under an asymmetric KMS key. The default value, `SYMMETRIC_DEFAULT`,
1888
1980
  # represents the only supported algorithm that is valid for symmetric
1889
- # KMS keys.
1981
+ # encryption KMS keys.
1890
1982
  #
1891
1983
  # @return [Types::DecryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1892
1984
  #
@@ -1940,8 +2032,8 @@ module Aws::KMS
1940
2032
  # Deletes the specified alias.
1941
2033
  #
1942
2034
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
1943
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
1944
- # Management Service Developer Guide*.
2035
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
2036
+ # Service Developer Guide*.
1945
2037
  #
1946
2038
  # </note>
1947
2039
  #
@@ -2116,8 +2208,8 @@ module Aws::KMS
2116
2208
  # reimport the same key material into the KMS key.
2117
2209
  #
2118
2210
  # The KMS key that you use for this operation must be in a compatible
2119
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2120
- # the *Key Management Service Developer Guide*.
2211
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2212
+ # Management Service Developer Guide*.
2121
2213
  #
2122
2214
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2123
2215
  # key in a different Amazon Web Services account.
@@ -2343,14 +2435,13 @@ module Aws::KMS
2343
2435
  # This detailed information includes the key ARN, creation date (and
2344
2436
  # deletion date, if applicable), the key state, and the origin and
2345
2437
  # expiration date (if any) of the key material. It includes fields, like
2346
- # `KeySpec`, that help you distinguish symmetric from asymmetric KMS
2347
- # keys. It also provides information that is particularly important to
2348
- # asymmetric keys, such as the key usage (encryption or signing) and the
2349
- # encryption algorithms or signing algorithms that the KMS key supports.
2350
- # For KMS keys in custom key stores, it includes information about the
2351
- # custom key store, such as the key store ID and the CloudHSM cluster
2352
- # ID. For multi-Region keys, it displays the primary key and all related
2353
- # replica keys.
2438
+ # `KeySpec`, that help you distinguish different types of KMS keys. It
2439
+ # also displays the key usage (encryption, signing, or generating and
2440
+ # verifying MACs) and the algorithms that the KMS key supports. For KMS
2441
+ # keys in custom key stores, it includes information about the custom
2442
+ # key store, such as the key store ID and the CloudHSM cluster ID. For
2443
+ # multi-Region keys, it displays the primary key and all related replica
2444
+ # keys.
2354
2445
  #
2355
2446
  # `DescribeKey` does not return the following information:
2356
2447
  #
@@ -2368,11 +2459,10 @@ module Aws::KMS
2368
2459
  # * Key policies and grants on the KMS key. To get this information, use
2369
2460
  # GetKeyPolicy and ListGrants.
2370
2461
  #
2371
- # If you call the `DescribeKey` operation on a *predefined Amazon Web
2372
- # Services alias*, that is, an Amazon Web Services alias with no key ID,
2373
- # KMS creates an [Amazon Web Services managed key][2]. Then, it
2374
- # associates the alias with the new KMS key, and returns the `KeyId` and
2375
- # `Arn` of the new KMS key in the response.
2462
+ # In general, `DescribeKey` is a non-mutating operation. It returns data
2463
+ # about KMS keys, but doesn't change them. However, Amazon Web Services
2464
+ # services use `DescribeKey` to create [Amazon Web Services managed
2465
+ # keys][2] from a *predefined Amazon Web Services alias* with no key ID.
2376
2466
  #
2377
2467
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2378
2468
  # in a different Amazon Web Services account, specify the key ARN or
@@ -2454,10 +2544,10 @@ module Aws::KMS
2454
2544
  #
2455
2545
  # @example Example: To get details about a KMS key
2456
2546
  #
2457
- # # The following example gets metadata about a symmetric KMS key.
2547
+ # # The following example gets metadata for a symmetric encryption KMS key.
2458
2548
  #
2459
2549
  # resp = client.describe_key({
2460
- # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The identifier of the KMS key that you want information about. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key.
2550
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # An identifier for the KMS key. You can use the key ID, key ARN, alias name, alias ARN of the KMS key.
2461
2551
  # })
2462
2552
  #
2463
2553
  # resp.to_h outputs the following:
@@ -2482,6 +2572,121 @@ module Aws::KMS
2482
2572
  # }, # An object that contains information about the specified KMS key.
2483
2573
  # }
2484
2574
  #
2575
+ # @example Example: To get details about an RSA asymmetric KMS key
2576
+ #
2577
+ # # The following example gets metadata for an asymmetric RSA KMS key used for signing and verification.
2578
+ #
2579
+ # resp = client.describe_key({
2580
+ # 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.
2581
+ # })
2582
+ #
2583
+ # resp.to_h outputs the following:
2584
+ # {
2585
+ # key_metadata: {
2586
+ # aws_account_id: "111122223333",
2587
+ # arn: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
2588
+ # creation_date: Time.parse(1571767572.317),
2589
+ # customer_master_key_spec: "RSA_2048",
2590
+ # description: "",
2591
+ # enabled: false,
2592
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
2593
+ # key_manager: "CUSTOMER",
2594
+ # key_spec: "RSA_2048",
2595
+ # key_state: "Disabled",
2596
+ # key_usage: "SIGN_VERIFY",
2597
+ # multi_region: false,
2598
+ # origin: "AWS_KMS",
2599
+ # signing_algorithms: [
2600
+ # "RSASSA_PKCS1_V1_5_SHA_256",
2601
+ # "RSASSA_PKCS1_V1_5_SHA_384",
2602
+ # "RSASSA_PKCS1_V1_5_SHA_512",
2603
+ # "RSASSA_PSS_SHA_256",
2604
+ # "RSASSA_PSS_SHA_384",
2605
+ # "RSASSA_PSS_SHA_512",
2606
+ # ],
2607
+ # }, # An object that contains information about the specified KMS key.
2608
+ # }
2609
+ #
2610
+ # @example Example: To get details about a multi-Region key
2611
+ #
2612
+ # # The following example gets metadata for a multi-Region replica key. This multi-Region key is a symmetric encryption key.
2613
+ # # DescribeKey returns information about the primary key and all of its replicas.
2614
+ #
2615
+ # resp = client.describe_key({
2616
+ # 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.
2617
+ # })
2618
+ #
2619
+ # resp.to_h outputs the following:
2620
+ # {
2621
+ # key_metadata: {
2622
+ # aws_account_id: "111122223333",
2623
+ # arn: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2624
+ # creation_date: Time.parse(1586329200.918),
2625
+ # customer_master_key_spec: "SYMMETRIC_DEFAULT",
2626
+ # description: "",
2627
+ # enabled: true,
2628
+ # encryption_algorithms: [
2629
+ # "SYMMETRIC_DEFAULT",
2630
+ # ],
2631
+ # key_id: "mrk-1234abcd12ab34cd56ef1234567890ab",
2632
+ # key_manager: "CUSTOMER",
2633
+ # key_state: "Enabled",
2634
+ # key_usage: "ENCRYPT_DECRYPT",
2635
+ # multi_region: true,
2636
+ # multi_region_configuration: {
2637
+ # multi_region_key_type: "PRIMARY",
2638
+ # primary_key: {
2639
+ # arn: "arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2640
+ # region: "us-west-2",
2641
+ # },
2642
+ # replica_keys: [
2643
+ # {
2644
+ # arn: "arn:aws:kms:eu-west-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2645
+ # region: "eu-west-1",
2646
+ # },
2647
+ # {
2648
+ # arn: "arn:aws:kms:ap-northeast-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2649
+ # region: "ap-northeast-1",
2650
+ # },
2651
+ # {
2652
+ # arn: "arn:aws:kms:sa-east-1:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab",
2653
+ # region: "sa-east-1",
2654
+ # },
2655
+ # ],
2656
+ # },
2657
+ # origin: "AWS_KMS",
2658
+ # }, # An object that contains information about the specified KMS key.
2659
+ # }
2660
+ #
2661
+ # @example Example: To get details about an HMAC KMS key
2662
+ #
2663
+ # # The following example gets the metadata of an HMAC KMS key.
2664
+ #
2665
+ # resp = client.describe_key({
2666
+ # 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.
2667
+ # })
2668
+ #
2669
+ # resp.to_h outputs the following:
2670
+ # {
2671
+ # key_metadata: {
2672
+ # aws_account_id: "123456789012",
2673
+ # arn: "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab",
2674
+ # creation_date: Time.parse(1566160362.664),
2675
+ # customer_master_key_spec: "HMAC_256",
2676
+ # description: "Development test key",
2677
+ # enabled: true,
2678
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab",
2679
+ # key_manager: "CUSTOMER",
2680
+ # key_state: "Enabled",
2681
+ # key_usage: "GENERATE_VERIFY_MAC",
2682
+ # mac_algorithms: [
2683
+ # "HMAC_SHA_256",
2684
+ # ],
2685
+ # multi_region: false,
2686
+ # origin: "AWS_KMS",
2687
+ # }, # An object that contains information about the specified KMS key.
2688
+ # }
2689
+ #
2485
2690
  # @example Request syntax with placeholder values
2486
2691
  #
2487
2692
  # resp = client.describe_key({
@@ -2497,7 +2702,7 @@ module Aws::KMS
2497
2702
  # resp.key_metadata.creation_date #=> Time
2498
2703
  # resp.key_metadata.enabled #=> Boolean
2499
2704
  # resp.key_metadata.description #=> String
2500
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
2705
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
2501
2706
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
2502
2707
  # resp.key_metadata.deletion_date #=> Time
2503
2708
  # resp.key_metadata.valid_to #=> Time
@@ -2506,8 +2711,8 @@ module Aws::KMS
2506
2711
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
2507
2712
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
2508
2713
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
2509
- # resp.key_metadata.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
2510
- # resp.key_metadata.key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
2714
+ # 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"
2715
+ # 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"
2511
2716
  # resp.key_metadata.encryption_algorithms #=> Array
2512
2717
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
2513
2718
  # resp.key_metadata.signing_algorithms #=> Array
@@ -2520,6 +2725,8 @@ module Aws::KMS
2520
2725
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
2521
2726
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
2522
2727
  # resp.key_metadata.pending_deletion_window_in_days #=> Integer
2728
+ # resp.key_metadata.mac_algorithms #=> Array
2729
+ # resp.key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
2523
2730
  #
2524
2731
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey AWS API Documentation
2525
2732
  #
@@ -2534,12 +2741,12 @@ module Aws::KMS
2534
2741
  # prevents use of the KMS key for [cryptographic operations][1].
2535
2742
  #
2536
2743
  # For more information about how key state affects the use of a KMS key,
2537
- # see [Key state: Effect on your KMS key][2] in the <i> <i>Key
2538
- # Management Service Developer Guide</i> </i>.
2744
+ # see [Key states of KMS keys][2] in the <i> <i>Key Management Service
2745
+ # Developer Guide</i> </i>.
2539
2746
  #
2540
2747
  # The KMS key that you use for this operation must be in a compatible
2541
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2542
- # the *Key Management Service Developer Guide*.
2748
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2749
+ # Management Service Developer Guide*.
2543
2750
  #
2544
2751
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2545
2752
  # key in a different Amazon Web Services account.
@@ -2596,21 +2803,22 @@ module Aws::KMS
2596
2803
  end
2597
2804
 
2598
2805
  # Disables [automatic rotation of the key material][1] for the specified
2599
- # symmetric KMS key.
2806
+ # symmetric encryption KMS key.
2600
2807
  #
2601
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2602
- # keys with [imported key material][3], or KMS keys in a [custom key
2603
- # store][4]. To enable or disable automatic rotation of a set of related
2604
- # [multi-Region keys][5], set the property on the primary key.
2808
+ # You cannot enable automatic rotation of [asymmetric KMS keys][2],
2809
+ # [HMAC KMS keys][3], KMS keys with [imported key material][4], or KMS
2810
+ # keys in a [custom key store][5]. To enable or disable automatic
2811
+ # rotation of a set of related [multi-Region keys][6], set the property
2812
+ # on the primary key.
2605
2813
  #
2606
2814
  # The KMS key that you use for this operation must be in a compatible
2607
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2608
- # the *Key Management Service Developer Guide*.
2815
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
2816
+ # Management Service Developer Guide*.
2609
2817
  #
2610
2818
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2611
2819
  # key in a different Amazon Web Services account.
2612
2820
  #
2613
- # **Required permissions**\: [kms:DisableKeyRotation][7] (key policy)
2821
+ # **Required permissions**\: [kms:DisableKeyRotation][8] (key policy)
2614
2822
  #
2615
2823
  # **Related operations:**
2616
2824
  #
@@ -2621,17 +2829,19 @@ module Aws::KMS
2621
2829
  #
2622
2830
  #
2623
2831
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2624
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2625
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2626
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2627
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2628
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2629
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2832
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
2833
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
2834
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2835
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2836
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
2837
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2838
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2630
2839
  #
2631
2840
  # @option params [required, String] :key_id
2632
- # Identifies a symmetric KMS key. You cannot enable or disable automatic
2633
- # rotation of [asymmetric KMS keys][1], KMS keys with [imported key
2634
- # material][2], or KMS keys in a [custom key store][3].
2841
+ # Identifies a symmetric encryption KMS key. You cannot enable or
2842
+ # disable automatic rotation of [asymmetric KMS keys][1], [HMAC KMS
2843
+ # keys][2], KMS keys with [imported key material][3], or KMS keys in a
2844
+ # [custom key store][4].
2635
2845
  #
2636
2846
  # Specify the key ID or key ARN of the KMS key.
2637
2847
  #
@@ -2648,8 +2858,9 @@ module Aws::KMS
2648
2858
  #
2649
2859
  #
2650
2860
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks
2651
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2652
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2861
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
2862
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2863
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2653
2864
  #
2654
2865
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2655
2866
  #
@@ -2767,8 +2978,8 @@ module Aws::KMS
2767
2978
  # KMS key for [cryptographic operations][1].
2768
2979
  #
2769
2980
  # The KMS key that you use for this operation must be in a compatible
2770
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2771
- # the *Key Management Service Developer Guide*.
2981
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
2982
+ # Management Service Developer Guide*.
2772
2983
  #
2773
2984
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2774
2985
  # key in a different Amazon Web Services account.
@@ -2825,21 +3036,22 @@ module Aws::KMS
2825
3036
  end
2826
3037
 
2827
3038
  # Enables [automatic rotation of the key material][1] for the specified
2828
- # symmetric KMS key.
3039
+ # symmetric encryption KMS key.
2829
3040
  #
2830
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2831
- # keys with [imported key material][3], or KMS keys in a [custom key
2832
- # store][4]. To enable or disable automatic rotation of a set of related
2833
- # [multi-Region keys][5], set the property on the primary key.
3041
+ # You cannot enable automatic rotation of [asymmetric KMS keys][2],
3042
+ # [HMAC KMS keys][3], KMS keys with [imported key material][4], or KMS
3043
+ # keys in a [custom key store][5]. To enable or disable automatic
3044
+ # rotation of a set of related [multi-Region keys][6], set the property
3045
+ # on the primary key.
2834
3046
  #
2835
3047
  # The KMS key that you use for this operation must be in a compatible
2836
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2837
- # the *Key Management Service Developer Guide*.
3048
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
3049
+ # Management Service Developer Guide*.
2838
3050
  #
2839
3051
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2840
3052
  # key in a different Amazon Web Services account.
2841
3053
  #
2842
- # **Required permissions**\: [kms:EnableKeyRotation][7] (key policy)
3054
+ # **Required permissions**\: [kms:EnableKeyRotation][8] (key policy)
2843
3055
  #
2844
3056
  # **Related operations:**
2845
3057
  #
@@ -2850,19 +3062,20 @@ module Aws::KMS
2850
3062
  #
2851
3063
  #
2852
3064
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2853
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2854
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2855
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2856
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2857
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2858
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3065
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3066
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
3067
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3068
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3069
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
3070
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3071
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
2859
3072
  #
2860
3073
  # @option params [required, String] :key_id
2861
- # Identifies a symmetric KMS key. You cannot enable automatic rotation
2862
- # of [asymmetric KMS keys][1], KMS keys with [imported key material][2],
2863
- # or KMS keys in a [custom key store][3]. To enable or disable automatic
2864
- # rotation of a set of related [multi-Region keys][4], set the property
2865
- # on the primary key.
3074
+ # Identifies a symmetric encryption KMS key. You cannot enable automatic
3075
+ # rotation of [asymmetric KMS keys][1], [HMAC KMS keys][2], KMS keys
3076
+ # with [imported key material][3], or KMS keys in a [custom key
3077
+ # store][4]. To enable or disable automatic rotation of a set of related
3078
+ # [multi-Region keys][5], set the property on the primary key.
2866
3079
  #
2867
3080
  # Specify the key ID or key ARN of the KMS key.
2868
3081
  #
@@ -2878,10 +3091,11 @@ module Aws::KMS
2878
3091
  #
2879
3092
  #
2880
3093
  #
2881
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2882
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2883
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2884
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
3094
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
3095
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
3096
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
3097
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
3098
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
2885
3099
  #
2886
3100
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2887
3101
  #
@@ -2909,36 +3123,22 @@ module Aws::KMS
2909
3123
  req.send_request(options)
2910
3124
  end
2911
3125
 
2912
- # Encrypts plaintext into ciphertext by using a KMS key. The `Encrypt`
2913
- # operation has two primary use cases:
2914
- #
2915
- # * You can encrypt small amounts of arbitrary data, such as a personal
2916
- # identifier or database password, or other sensitive information.
2917
- #
2918
- # * You can use the `Encrypt` operation to move encrypted data from one
2919
- # Amazon Web Services Region to another. For example, in Region A,
2920
- # generate a data key and use the plaintext key to encrypt your data.
2921
- # Then, in Region A, use the `Encrypt` operation to encrypt the
2922
- # plaintext data key under a KMS key in Region B. Now, you can move
2923
- # the encrypted data and the encrypted data key to Region B. When
2924
- # necessary, you can decrypt the encrypted data key and the encrypted
2925
- # data entirely within in Region B.
2926
- #
2927
- # You don't need to use the `Encrypt` operation to encrypt a data key.
2928
- # The GenerateDataKey and GenerateDataKeyPair operations return a
2929
- # plaintext data key and an encrypted copy of that data key.
2930
- #
2931
- # When you encrypt data, you must specify a symmetric or asymmetric KMS
2932
- # key to use in the encryption operation. The KMS key must have a
2933
- # `KeyUsage` value of `ENCRYPT_DECRYPT.` To find the `KeyUsage` of a KMS
2934
- # key, use the DescribeKey operation.
2935
- #
2936
- # If you use a symmetric KMS key, you can use an encryption context to
2937
- # add additional security to your encryption operation. If you specify
2938
- # an `EncryptionContext` when encrypting data, you must specify the same
2939
- # encryption context (a case-sensitive exact match) when decrypting the
2940
- # data. Otherwise, the request to decrypt fails with an
2941
- # `InvalidCiphertextException`. For more information, see [Encryption
3126
+ # Encrypts plaintext of up to 4,096 bytes using a KMS key. You can use a
3127
+ # symmetric or asymmetric KMS key with a `KeyUsage` of
3128
+ # `ENCRYPT_DECRYPT`.
3129
+ #
3130
+ # You can use this operation to encrypt small amounts of arbitrary data,
3131
+ # such as a personal identifier or database password, or other sensitive
3132
+ # information. You don't need to use the `Encrypt` operation to encrypt
3133
+ # a data key. The GenerateDataKey and GenerateDataKeyPair operations
3134
+ # return a plaintext data key and an encrypted copy of that data key.
3135
+ #
3136
+ # If you use a symmetric encryption KMS key, you can use an encryption
3137
+ # context to add additional security to your encryption operation. If
3138
+ # you specify an `EncryptionContext` when encrypting data, you must
3139
+ # specify the same encryption context (a case-sensitive exact match)
3140
+ # when decrypting the data. Otherwise, the request to decrypt fails with
3141
+ # an `InvalidCiphertextException`. For more information, see [Encryption
2942
3142
  # Context][1] in the *Key Management Service Developer Guide*.
2943
3143
  #
2944
3144
  # If you specify an asymmetric KMS key, you must also specify the
@@ -2953,15 +3153,15 @@ module Aws::KMS
2953
3153
  # fails.
2954
3154
  #
2955
3155
  # You are not required to supply the key ID and encryption algorithm
2956
- # when you decrypt with symmetric KMS keys because KMS stores this
2957
- # information in the ciphertext blob. KMS cannot store metadata in
3156
+ # when you decrypt with symmetric encryption KMS keys because KMS stores
3157
+ # this information in the ciphertext blob. KMS cannot store metadata in
2958
3158
  # ciphertext generated with asymmetric keys. The standard format for
2959
3159
  # asymmetric key ciphertext does not include configurable fields.
2960
3160
  #
2961
3161
  # The maximum size of the data that you can encrypt varies with the type
2962
3162
  # of KMS key and the encryption algorithm that you choose.
2963
3163
  #
2964
- # * Symmetric KMS keys
3164
+ # * Symmetric encryption KMS keys
2965
3165
  #
2966
3166
  # * `SYMMETRIC_DEFAULT`\: 4096 bytes
2967
3167
  #
@@ -2986,8 +3186,8 @@ module Aws::KMS
2986
3186
  # * `RSAES_OAEP_SHA_256`\: 446 bytes
2987
3187
  #
2988
3188
  # The KMS key that you use for this operation must be in a compatible
2989
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2990
- # the *Key Management Service Developer Guide*.
3189
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
3190
+ # Management Service Developer Guide*.
2991
3191
  #
2992
3192
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2993
3193
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3010,7 +3210,9 @@ module Aws::KMS
3010
3210
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3011
3211
  #
3012
3212
  # @option params [required, String] :key_id
3013
- # Identifies the KMS key to use in the encryption operation.
3213
+ # Identifies the KMS key to use in the encryption operation. The KMS key
3214
+ # must have a `KeyUsage` of `ENCRYPT_DECRYPT`. To find the `KeyUsage` of
3215
+ # a KMS key, use the DescribeKey operation.
3014
3216
  #
3015
3217
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3016
3218
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3037,18 +3239,19 @@ module Aws::KMS
3037
3239
  # @option params [Hash<String,String>] :encryption_context
3038
3240
  # Specifies the encryption context that will be used to encrypt the
3039
3241
  # data. An encryption context is valid only for [cryptographic
3040
- # operations][1] with a symmetric KMS key. The standard asymmetric
3041
- # encryption algorithms that KMS uses do not support an encryption
3042
- # context.
3242
+ # operations][1] with a symmetric encryption KMS key. The standard
3243
+ # asymmetric encryption algorithms and HMAC algorithms that KMS uses do
3244
+ # not support an encryption context.
3043
3245
  #
3044
3246
  # An *encryption context* is a collection of non-secret key-value pairs
3045
- # that represents additional authenticated data. When you use an
3247
+ # that represent additional authenticated data. When you use an
3046
3248
  # encryption context to encrypt data, you must specify the same (an
3047
3249
  # exact case-sensitive match) encryption context to decrypt the data. An
3048
- # encryption context is optional when encrypting with a symmetric KMS
3049
- # key, but it is highly recommended.
3250
+ # encryption context is supported only on operations with symmetric
3251
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3252
+ # an encryption context is optional, but it is strongly recommended.
3050
3253
  #
3051
- # For more information, see [Encryption Context][2] in the *Key
3254
+ # For more information, see [Encryption context][2] in the *Key
3052
3255
  # Management Service Developer Guide*.
3053
3256
  #
3054
3257
  #
@@ -3075,9 +3278,9 @@ module Aws::KMS
3075
3278
  # that you specify.
3076
3279
  #
3077
3280
  # This parameter is required only for asymmetric KMS keys. The default
3078
- # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric KMS
3079
- # keys. If you are using an asymmetric KMS key, we recommend
3080
- # RSAES\_OAEP\_SHA\_256.
3281
+ # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric
3282
+ # encryption KMS keys. If you are using an asymmetric KMS key, we
3283
+ # recommend RSAES\_OAEP\_SHA\_256.
3081
3284
  #
3082
3285
  # @return [Types::EncryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3083
3286
  #
@@ -3128,19 +3331,17 @@ module Aws::KMS
3128
3331
  req.send_request(options)
3129
3332
  end
3130
3333
 
3131
- # Generates a unique symmetric data key for client-side encryption. This
3334
+ # Returns a unique symmetric data key for use outside of KMS. This
3132
3335
  # operation returns a plaintext copy of the data key and a copy that is
3133
- # encrypted under a KMS key that you specify. You can use the plaintext
3134
- # key to encrypt your data outside of KMS and store the encrypted data
3135
- # key with the encrypted data.
3136
- #
3137
- # `GenerateDataKey` returns a unique data key for each request. The
3138
- # bytes in the plaintext key are not related to the caller or the KMS
3139
- # key.
3140
- #
3141
- # To generate a data key, specify the symmetric KMS key that will be
3142
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3143
- # generate data keys. To get the type of your KMS key, use the
3336
+ # encrypted under a symmetric encryption KMS key that you specify. The
3337
+ # bytes in the plaintext key are random; they are not related to the
3338
+ # caller or the KMS key. You can use the plaintext key to encrypt your
3339
+ # data outside of KMS and store the encrypted data key with the
3340
+ # encrypted data.
3341
+ #
3342
+ # To generate a data key, specify the symmetric encryption KMS key that
3343
+ # will be used to encrypt the data key. You cannot use an asymmetric KMS
3344
+ # key to encrypt data keys. To get the type of your KMS key, use the
3144
3345
  # DescribeKey operation. You must also specify the length of the data
3145
3346
  # key. Use either the `KeySpec` or `NumberOfBytes` parameters (but not
3146
3347
  # both). For 128-bit and 256-bit data keys, use the `KeySpec` parameter.
@@ -3151,7 +3352,7 @@ module Aws::KMS
3151
3352
  # GenerateDataKeyPairWithoutPlaintext operation. To get a
3152
3353
  # cryptographically secure random byte string, use GenerateRandom.
3153
3354
  #
3154
- # You can use the optional encryption context to add additional security
3355
+ # You can use an optional encryption context to add additional security
3155
3356
  # to the encryption operation. If you specify an `EncryptionContext`,
3156
3357
  # you must specify the same encryption context (a case-sensitive exact
3157
3358
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3166,8 +3367,8 @@ module Aws::KMS
3166
3367
  # Service Developer Guide*.
3167
3368
  #
3168
3369
  # The KMS key that you use for this operation must be in a compatible
3169
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3170
- # the *Key Management Service Developer Guide*.
3370
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
3371
+ # Management Service Developer Guide*.
3171
3372
  #
3172
3373
  # **How to use your data key**
3173
3374
  #
@@ -3226,7 +3427,10 @@ module Aws::KMS
3226
3427
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3227
3428
  #
3228
3429
  # @option params [required, String] :key_id
3229
- # Identifies the symmetric KMS key that encrypts the data key.
3430
+ # Specifies the symmetric encryption KMS key that encrypts the data key.
3431
+ # You cannot specify an asymmetric KMS key or a KMS key in a custom key
3432
+ # store. To get the type and origin of your KMS key, use the DescribeKey
3433
+ # operation.
3230
3434
  #
3231
3435
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3232
3436
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3252,13 +3456,14 @@ module Aws::KMS
3252
3456
  # data key.
3253
3457
  #
3254
3458
  # An *encryption context* is a collection of non-secret key-value pairs
3255
- # that represents additional authenticated data. When you use an
3459
+ # that represent additional authenticated data. When you use an
3256
3460
  # encryption context to encrypt data, you must specify the same (an
3257
3461
  # exact case-sensitive match) encryption context to decrypt the data. An
3258
- # encryption context is optional when encrypting with a symmetric KMS
3259
- # key, but it is highly recommended.
3462
+ # encryption context is supported only on operations with symmetric
3463
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3464
+ # an encryption context is optional, but it is strongly recommended.
3260
3465
  #
3261
- # For more information, see [Encryption Context][1] in the *Key
3466
+ # For more information, see [Encryption context][1] in the *Key
3262
3467
  # Management Service Developer Guide*.
3263
3468
  #
3264
3469
  #
@@ -3346,11 +3551,13 @@ module Aws::KMS
3346
3551
  req.send_request(options)
3347
3552
  end
3348
3553
 
3349
- # Generates a unique asymmetric data key pair. The `GenerateDataKeyPair`
3554
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3350
3555
  # operation returns a plaintext public key, a plaintext private key, and
3351
- # a copy of the private key that is encrypted under the symmetric KMS
3352
- # key you specify. You can use the data key pair to perform asymmetric
3353
- # cryptography and implement digital signatures outside of KMS.
3556
+ # a copy of the private key that is encrypted under the symmetric
3557
+ # encryption KMS key you specify. You can use the data key pair to
3558
+ # perform asymmetric cryptography and implement digital signatures
3559
+ # outside of KMS. The bytes in the keys are random; they not related to
3560
+ # the caller or to the KMS key that is used to encrypt the private key.
3354
3561
  #
3355
3562
  # You can use the public key that `GenerateDataKeyPair` returns to
3356
3563
  # encrypt data or verify a signature outside of KMS. Then, store the
@@ -3358,10 +3565,10 @@ module Aws::KMS
3358
3565
  # data or sign a message, you can use the Decrypt operation to decrypt
3359
3566
  # the encrypted private key.
3360
3567
  #
3361
- # To generate a data key pair, you must specify a symmetric KMS key to
3362
- # encrypt the private key in a data key pair. You cannot use an
3363
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3364
- # and origin of your KMS key, use the DescribeKey operation.
3568
+ # To generate a data key pair, you must specify a symmetric encryption
3569
+ # KMS key to encrypt the private key in a data key pair. You cannot use
3570
+ # an asymmetric KMS key or a KMS key in a custom key store. To get the
3571
+ # type and origin of your KMS key, use the DescribeKey operation.
3365
3572
  #
3366
3573
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3367
3574
  # (ECC) data key pair. KMS recommends that your use ECC key pairs for
@@ -3379,13 +3586,13 @@ module Aws::KMS
3379
3586
  # to decrypt the encrypted private key in the data key pair.
3380
3587
  #
3381
3588
  # `GenerateDataKeyPair` returns a unique data key pair for each request.
3382
- # The bytes in the keys are not related to the caller or the KMS key
3383
- # that is used to encrypt the private key. The public key is a
3384
- # DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC 5280][1].
3385
- # The private key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in
3386
- # [RFC 5958][2].
3589
+ # The bytes in the keys are random; they are not related to the caller
3590
+ # or the KMS key that is used to encrypt the private key. The public key
3591
+ # is a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3592
+ # 5280][1]. The private key is a DER-encoded PKCS8 PrivateKeyInfo, as
3593
+ # specified in [RFC 5958][2].
3387
3594
  #
3388
- # You can use the optional encryption context to add additional security
3595
+ # You can use an optional encryption context to add additional security
3389
3596
  # to the encryption operation. If you specify an `EncryptionContext`,
3390
3597
  # you must specify the same encryption context (a case-sensitive exact
3391
3598
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3394,8 +3601,8 @@ module Aws::KMS
3394
3601
  # Service Developer Guide*.
3395
3602
  #
3396
3603
  # The KMS key that you use for this operation must be in a compatible
3397
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3398
- # the *Key Management Service Developer Guide*.
3604
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
3605
+ # Management Service Developer Guide*.
3399
3606
  #
3400
3607
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3401
3608
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3428,13 +3635,14 @@ module Aws::KMS
3428
3635
  # private key in the data key pair.
3429
3636
  #
3430
3637
  # An *encryption context* is a collection of non-secret key-value pairs
3431
- # that represents additional authenticated data. When you use an
3638
+ # that represent additional authenticated data. When you use an
3432
3639
  # encryption context to encrypt data, you must specify the same (an
3433
3640
  # exact case-sensitive match) encryption context to decrypt the data. An
3434
- # encryption context is optional when encrypting with a symmetric KMS
3435
- # key, but it is highly recommended.
3641
+ # encryption context is supported only on operations with symmetric
3642
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3643
+ # an encryption context is optional, but it is strongly recommended.
3436
3644
  #
3437
- # For more information, see [Encryption Context][1] in the *Key
3645
+ # For more information, see [Encryption context][1] in the *Key
3438
3646
  # Management Service Developer Guide*.
3439
3647
  #
3440
3648
  #
@@ -3442,10 +3650,10 @@ module Aws::KMS
3442
3650
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3443
3651
  #
3444
3652
  # @option params [required, String] :key_id
3445
- # Specifies the symmetric KMS key that encrypts the private key in the
3446
- # data key pair. You cannot specify an asymmetric KMS key or a KMS key
3447
- # in a custom key store. To get the type and origin of your KMS key, use
3448
- # the DescribeKey operation.
3653
+ # Specifies the symmetric encryption KMS key that encrypts the private
3654
+ # key in the data key pair. You cannot specify an asymmetric KMS key or
3655
+ # a KMS key in a custom key store. To get the type and origin of your
3656
+ # KMS key, use the DescribeKey operation.
3449
3657
  #
3450
3658
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3451
3659
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3499,16 +3707,16 @@ module Aws::KMS
3499
3707
  # @example Example: To generate an RSA key pair for encryption and decryption
3500
3708
  #
3501
3709
  # # This example generates an RSA data key pair for encryption and decryption. The operation returns a plaintext public key
3502
- # # and private key, and a copy of the private key that is encrypted under a symmetric KMS key that you specify.
3710
+ # # and private key, and a copy of the private key that is encrypted under a symmetric encryption KMS key that you specify.
3503
3711
  #
3504
3712
  # resp = client.generate_data_key_pair({
3505
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ID of the symmetric KMS key that encrypts the private RSA key in the data key pair.
3713
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ID of the symmetric encryption KMS key that encrypts the private RSA key in the data key pair.
3506
3714
  # key_pair_spec: "RSA_3072", # The requested key spec of the RSA data key pair.
3507
3715
  # })
3508
3716
  #
3509
3717
  # resp.to_h outputs the following:
3510
3718
  # {
3511
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric KMS key that was used to encrypt the private key.
3719
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric encryption KMS key that was used to encrypt the private key.
3512
3720
  # key_pair_spec: "RSA_3072", # The actual key spec of the RSA data key pair.
3513
3721
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the RSA data key pair.
3514
3722
  # private_key_plaintext: "<binary data>", # The plaintext private key of the RSA data key pair.
@@ -3543,11 +3751,12 @@ module Aws::KMS
3543
3751
  req.send_request(options)
3544
3752
  end
3545
3753
 
3546
- # Generates a unique asymmetric data key pair. The
3547
- # `GenerateDataKeyPairWithoutPlaintext` operation returns a plaintext
3548
- # public key and a copy of the private key that is encrypted under the
3549
- # symmetric KMS key you specify. Unlike GenerateDataKeyPair, this
3550
- # operation does not return a plaintext private key.
3754
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3755
+ # operation returns a plaintext public key and a copy of the private key
3756
+ # that is encrypted under the symmetric encryption KMS key you specify.
3757
+ # Unlike GenerateDataKeyPair, this operation does not return a plaintext
3758
+ # private key. The bytes in the keys are random; they are not related to
3759
+ # the caller or to the KMS key that is used to encrypt the private key.
3551
3760
  #
3552
3761
  # You can use the public key that `GenerateDataKeyPairWithoutPlaintext`
3553
3762
  # returns to encrypt data or verify a signature outside of KMS. Then,
@@ -3555,10 +3764,10 @@ module Aws::KMS
3555
3764
  # decrypt data or sign a message, you can use the Decrypt operation to
3556
3765
  # decrypt the encrypted private key.
3557
3766
  #
3558
- # To generate a data key pair, you must specify a symmetric KMS key to
3559
- # encrypt the private key in a data key pair. You cannot use an
3560
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3561
- # and origin of your KMS key, use the DescribeKey operation.
3767
+ # To generate a data key pair, you must specify a symmetric encryption
3768
+ # KMS key to encrypt the private key in a data key pair. You cannot use
3769
+ # an asymmetric KMS key or a KMS key in a custom key store. To get the
3770
+ # type and origin of your KMS key, use the DescribeKey operation.
3562
3771
  #
3563
3772
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3564
3773
  # (ECC) data key pair. KMS recommends that your use ECC key pairs for
@@ -3572,7 +3781,7 @@ module Aws::KMS
3572
3781
  # a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3573
3782
  # 5280][1].
3574
3783
  #
3575
- # You can use the optional encryption context to add additional security
3784
+ # You can use an optional encryption context to add additional security
3576
3785
  # to the encryption operation. If you specify an `EncryptionContext`,
3577
3786
  # you must specify the same encryption context (a case-sensitive exact
3578
3787
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3581,8 +3790,8 @@ module Aws::KMS
3581
3790
  # Service Developer Guide*.
3582
3791
  #
3583
3792
  # The KMS key that you use for this operation must be in a compatible
3584
- # key state. For details, see [Key state: Effect on your KMS key][3] in
3585
- # the *Key Management Service Developer Guide*.
3793
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
3794
+ # Management Service Developer Guide*.
3586
3795
  #
3587
3796
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3588
3797
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3615,13 +3824,14 @@ module Aws::KMS
3615
3824
  # private key in the data key pair.
3616
3825
  #
3617
3826
  # An *encryption context* is a collection of non-secret key-value pairs
3618
- # that represents additional authenticated data. When you use an
3827
+ # that represent additional authenticated data. When you use an
3619
3828
  # encryption context to encrypt data, you must specify the same (an
3620
3829
  # exact case-sensitive match) encryption context to decrypt the data. An
3621
- # encryption context is optional when encrypting with a symmetric KMS
3622
- # key, but it is highly recommended.
3830
+ # encryption context is supported only on operations with symmetric
3831
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
3832
+ # an encryption context is optional, but it is strongly recommended.
3623
3833
  #
3624
- # For more information, see [Encryption Context][1] in the *Key
3834
+ # For more information, see [Encryption context][1] in the *Key
3625
3835
  # Management Service Developer Guide*.
3626
3836
  #
3627
3837
  #
@@ -3629,10 +3839,10 @@ module Aws::KMS
3629
3839
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3630
3840
  #
3631
3841
  # @option params [required, String] :key_id
3632
- # Specifies the KMS key that encrypts the private key in the data key
3633
- # pair. You must specify a symmetric KMS key. You cannot use an
3634
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3635
- # and origin of your KMS key, use the DescribeKey operation.
3842
+ # Specifies the symmetric encryption KMS key that encrypts the private
3843
+ # key in the data key pair. You cannot specify an asymmetric KMS key or
3844
+ # a KMS key in a custom key store. To get the type and origin of your
3845
+ # KMS key, use the DescribeKey operation.
3636
3846
  #
3637
3847
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3638
3848
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3685,16 +3895,16 @@ module Aws::KMS
3685
3895
  # @example Example: To generate an asymmetric data key pair without a plaintext key
3686
3896
  #
3687
3897
  # # This example returns an asymmetric elliptic curve (ECC) data key pair. The private key is encrypted under the symmetric
3688
- # # KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
3898
+ # # encryption KMS key that you specify. This operation doesn't return a plaintext (unencrypted) private key.
3689
3899
  #
3690
3900
  # resp = client.generate_data_key_pair_without_plaintext({
3691
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The symmetric KMS key that encrypts the private key of the ECC data key pair.
3901
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The symmetric encryption KMS key that encrypts the private key of the ECC data key pair.
3692
3902
  # key_pair_spec: "ECC_NIST_P521", # The requested key spec of the ECC asymmetric data key pair.
3693
3903
  # })
3694
3904
  #
3695
3905
  # resp.to_h outputs the following:
3696
3906
  # {
3697
- # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric KMS key that encrypted the private key in the ECC asymmetric data key pair.
3907
+ # key_id: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the symmetric encryption KMS key that encrypted the private key in the ECC asymmetric data key pair.
3698
3908
  # key_pair_spec: "ECC_NIST_P521", # The actual key spec of the ECC asymmetric data key pair.
3699
3909
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the asymmetric ECC data key pair.
3700
3910
  # public_key: "<binary data>", # The public key (plaintext).
@@ -3727,40 +3937,40 @@ module Aws::KMS
3727
3937
  req.send_request(options)
3728
3938
  end
3729
3939
 
3730
- # Generates a unique symmetric data key. This operation returns a data
3731
- # key that is encrypted under a KMS key that you specify. To request an
3732
- # asymmetric data key pair, use the GenerateDataKeyPair or
3733
- # GenerateDataKeyPairWithoutPlaintext operations.
3940
+ # Returns a unique symmetric data key for use outside of KMS. This
3941
+ # operation returns a data key that is encrypted under a symmetric
3942
+ # encryption KMS key that you specify. The bytes in the key are random;
3943
+ # they are not related to the caller or to the KMS key.
3734
3944
  #
3735
3945
  # `GenerateDataKeyWithoutPlaintext` is identical to the GenerateDataKey
3736
- # operation except that returns only the encrypted copy of the data key.
3946
+ # operation except that it does not return a plaintext copy of the data
3947
+ # key.
3948
+ #
3737
3949
  # This operation is useful for systems that need to encrypt data at some
3738
3950
  # point, but not immediately. When you need to encrypt the data, you
3739
- # call the Decrypt operation on the encrypted copy of the key.
3740
- #
3741
- # It's also useful in distributed systems with different levels of
3742
- # trust. For example, you might store encrypted data in containers. One
3743
- # component of your system creates new containers and stores an
3744
- # encrypted data key with each container. Then, a different component
3745
- # puts the data into the containers. That component first decrypts the
3746
- # data key, uses the plaintext data key to encrypt data, puts the
3747
- # encrypted data into the container, and then destroys the plaintext
3748
- # data key. In this system, the component that creates the containers
3749
- # never sees the plaintext data key.
3750
- #
3751
- # `GenerateDataKeyWithoutPlaintext` returns a unique data key for each
3752
- # request. The bytes in the keys are not related to the caller or KMS
3753
- # key that is used to encrypt the private key.
3754
- #
3755
- # To generate a data key, you must specify the symmetric KMS key that is
3756
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3757
- # generate a data key. To get the type of your KMS key, use the
3758
- # DescribeKey operation.
3951
+ # call the Decrypt operation on the encrypted copy of the key. It's
3952
+ # also useful in distributed systems with different levels of trust. For
3953
+ # example, you might store encrypted data in containers. One component
3954
+ # of your system creates new containers and stores an encrypted data key
3955
+ # with each container. Then, a different component puts the data into
3956
+ # the containers. That component first decrypts the data key, uses the
3957
+ # plaintext data key to encrypt data, puts the encrypted data into the
3958
+ # container, and then destroys the plaintext data key. In this system,
3959
+ # the component that creates the containers never sees the plaintext
3960
+ # data key.
3961
+ #
3962
+ # To request an asymmetric data key pair, use the GenerateDataKeyPair or
3963
+ # GenerateDataKeyPairWithoutPlaintext operations.
3964
+ #
3965
+ # To generate a data key, you must specify the symmetric encryption KMS
3966
+ # key that is used to encrypt the data key. You cannot use an asymmetric
3967
+ # KMS key or a key in a custom key store to generate a data key. To get
3968
+ # the type of your KMS key, use the DescribeKey operation.
3759
3969
  #
3760
3970
  # If the operation succeeds, you will find the encrypted copy of the
3761
3971
  # data key in the `CiphertextBlob` field.
3762
3972
  #
3763
- # You can use the optional encryption context to add additional security
3973
+ # You can use an optional encryption context to add additional security
3764
3974
  # to the encryption operation. If you specify an `EncryptionContext`,
3765
3975
  # you must specify the same encryption context (a case-sensitive exact
3766
3976
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3769,8 +3979,8 @@ module Aws::KMS
3769
3979
  # Service Developer Guide*.
3770
3980
  #
3771
3981
  # The KMS key that you use for this operation must be in a compatible
3772
- # key state. For details, see [Key state: Effect on your KMS key][2] in
3773
- # the *Key Management Service Developer Guide*.
3982
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
3983
+ # Management Service Developer Guide*.
3774
3984
  #
3775
3985
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3776
3986
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3798,7 +4008,10 @@ module Aws::KMS
3798
4008
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3799
4009
  #
3800
4010
  # @option params [required, String] :key_id
3801
- # The identifier of the symmetric KMS key that encrypts the data key.
4011
+ # Specifies the symmetric encryption KMS key that encrypts the data key.
4012
+ # You cannot specify an asymmetric KMS key or a KMS key in a custom key
4013
+ # store. To get the type and origin of your KMS key, use the DescribeKey
4014
+ # operation.
3802
4015
  #
3803
4016
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3804
4017
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3824,13 +4037,14 @@ module Aws::KMS
3824
4037
  # data key.
3825
4038
  #
3826
4039
  # An *encryption context* is a collection of non-secret key-value pairs
3827
- # that represents additional authenticated data. When you use an
4040
+ # that represent additional authenticated data. When you use an
3828
4041
  # encryption context to encrypt data, you must specify the same (an
3829
4042
  # exact case-sensitive match) encryption context to decrypt the data. An
3830
- # encryption context is optional when encrypting with a symmetric KMS
3831
- # key, but it is highly recommended.
4043
+ # encryption context is supported only on operations with symmetric
4044
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
4045
+ # an encryption context is optional, but it is strongly recommended.
3832
4046
  #
3833
- # For more information, see [Encryption Context][1] in the *Key
4047
+ # For more information, see [Encryption context][1] in the *Key
3834
4048
  # Management Service Developer Guide*.
3835
4049
  #
3836
4050
  #
@@ -3908,6 +4122,126 @@ module Aws::KMS
3908
4122
  req.send_request(options)
3909
4123
  end
3910
4124
 
4125
+ # Generates a hash-based message authentication code (HMAC) for a
4126
+ # message using an HMAC KMS key and a MAC algorithm that the key
4127
+ # supports. The MAC algorithm computes the HMAC for the message and the
4128
+ # key as described in [RFC 2104][1].
4129
+ #
4130
+ # You can use the HMAC that this operation generates with the VerifyMac
4131
+ # operation to demonstrate that the original message has not changed.
4132
+ # Also, because a secret key is used to create the hash, you can verify
4133
+ # that the party that generated the hash has the required secret key.
4134
+ # This operation is part of KMS support for HMAC KMS keys. For details,
4135
+ # see [HMAC keys in KMS][2] in the <i> <i>Key Management Service
4136
+ # Developer Guide</i> </i>.
4137
+ #
4138
+ # The KMS key that you use for this operation must be in a compatible
4139
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
4140
+ # Management Service Developer Guide*.
4141
+ #
4142
+ # **Cross-account use**\: Yes. To perform this operation with a KMS key
4143
+ # in a different Amazon Web Services account, specify the key ARN or
4144
+ # alias ARN in the value of the `KeyId` parameter.
4145
+ #
4146
+ # **Required permissions**\: [kms:GenerateMac][4] (key policy)
4147
+ #
4148
+ # **Related operations**\: VerifyMac
4149
+ #
4150
+ #
4151
+ #
4152
+ # [1]: https://datatracker.ietf.org/doc/html/rfc2104
4153
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
4154
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4155
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4156
+ #
4157
+ # @option params [required, String, StringIO, File] :message
4158
+ # The message to be hashed. Specify a message of up to 4,096 bytes.
4159
+ #
4160
+ # `GenerateMac` and VerifyMac do not provide special handling for
4161
+ # message digests. If you generate an HMAC for a hash digest of a
4162
+ # message, you must verify the HMAC of the same hash digest.
4163
+ #
4164
+ # @option params [required, String] :key_id
4165
+ # The HMAC KMS key to use in the operation. The MAC algorithm computes
4166
+ # the HMAC for the message and the key as described in [RFC 2104][1].
4167
+ #
4168
+ # To identify an HMAC KMS key, use the DescribeKey operation and see the
4169
+ # `KeySpec` field in the response.
4170
+ #
4171
+ #
4172
+ #
4173
+ # [1]: https://datatracker.ietf.org/doc/html/rfc2104
4174
+ #
4175
+ # @option params [required, String] :mac_algorithm
4176
+ # The MAC algorithm used in the operation.
4177
+ #
4178
+ # The algorithm must be compatible with the HMAC KMS key that you
4179
+ # specify. To find the MAC algorithms that your HMAC KMS key supports,
4180
+ # use the DescribeKey operation and see the `MacAlgorithms` field in the
4181
+ # `DescribeKey` response.
4182
+ #
4183
+ # @option params [Array<String>] :grant_tokens
4184
+ # A list of grant tokens.
4185
+ #
4186
+ # Use a grant token when your permission to call this operation comes
4187
+ # from a new grant that has not yet achieved *eventual consistency*. For
4188
+ # more information, see [Grant token][1] and [Using a grant token][2] in
4189
+ # the *Key Management Service Developer Guide*.
4190
+ #
4191
+ #
4192
+ #
4193
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
4194
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
4195
+ #
4196
+ # @return [Types::GenerateMacResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
4197
+ #
4198
+ # * {Types::GenerateMacResponse#mac #mac} => String
4199
+ # * {Types::GenerateMacResponse#mac_algorithm #mac_algorithm} => String
4200
+ # * {Types::GenerateMacResponse#key_id #key_id} => String
4201
+ #
4202
+ #
4203
+ # @example Example: To generate an HMAC for a message
4204
+ #
4205
+ # # This example generates an HMAC for a message, an HMAC KMS key, and a MAC algorithm. The algorithm must be supported by
4206
+ # # the specified HMAC KMS key.
4207
+ #
4208
+ # resp = client.generate_mac({
4209
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The HMAC KMS key input to the HMAC algorithm.
4210
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm requested for the operation.
4211
+ # message: "Hello World", # The message input to the HMAC algorithm.
4212
+ # })
4213
+ #
4214
+ # resp.to_h outputs the following:
4215
+ # {
4216
+ # 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.
4217
+ # mac: "<HMAC_TAG>", # The HMAC tag that results from this operation.
4218
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm used in the operation.
4219
+ # }
4220
+ #
4221
+ # @example Request syntax with placeholder values
4222
+ #
4223
+ # resp = client.generate_mac({
4224
+ # message: "data", # required
4225
+ # key_id: "KeyIdType", # required
4226
+ # mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
4227
+ # grant_tokens: ["GrantTokenType"],
4228
+ # })
4229
+ #
4230
+ # @example Response structure
4231
+ #
4232
+ # resp.mac #=> String
4233
+ # resp.mac_algorithm #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
4234
+ # resp.key_id #=> String
4235
+ #
4236
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateMac AWS API Documentation
4237
+ #
4238
+ # @overload generate_mac(params = {})
4239
+ # @param [Hash] params ({})
4240
+ def generate_mac(params = {}, options = {})
4241
+ req = build_request(:generate_mac, params)
4242
+ req.send_request(options)
4243
+ end
4244
+
3911
4245
  # Returns a random byte string that is cryptographically secure.
3912
4246
  #
3913
4247
  # By default, the random byte string is generated in KMS. To generate
@@ -4057,15 +4391,16 @@ module Aws::KMS
4057
4391
  # Gets a Boolean value that indicates whether [automatic rotation of the
4058
4392
  # key material][1] is enabled for the specified KMS key.
4059
4393
  #
4060
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
4061
- # keys with [imported key material][3], or KMS keys in a [custom key
4062
- # store][4]. To enable or disable automatic rotation of a set of related
4063
- # [multi-Region keys][5], set the property on the primary key. The key
4064
- # rotation status for these KMS keys is always `false`.
4394
+ # You cannot enable automatic rotation of [asymmetric KMS keys][2],
4395
+ # [HMAC KMS keys][3], KMS keys with [imported key material][4], or KMS
4396
+ # keys in a [custom key store][5]. To enable or disable automatic
4397
+ # rotation of a set of related [multi-Region keys][6], set the property
4398
+ # on the primary key. The key rotation status for these KMS keys is
4399
+ # always `false`.
4065
4400
  #
4066
4401
  # The KMS key that you use for this operation must be in a compatible
4067
- # key state. For details, see [Key state: Effect on your KMS key][6] in
4068
- # the *Key Management Service Developer Guide*.
4402
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
4403
+ # Management Service Developer Guide*.
4069
4404
  #
4070
4405
  # * Disabled: The key rotation status does not change when you disable a
4071
4406
  # KMS key. However, while the KMS key is disabled, KMS does not rotate
@@ -4080,7 +4415,7 @@ module Aws::KMS
4080
4415
  # a different Amazon Web Services account, specify the key ARN in the
4081
4416
  # value of the `KeyId` parameter.
4082
4417
  #
4083
- # **Required permissions**\: [kms:GetKeyRotationStatus][7] (key policy)
4418
+ # **Required permissions**\: [kms:GetKeyRotationStatus][8] (key policy)
4084
4419
  #
4085
4420
  # **Related operations:**
4086
4421
  #
@@ -4091,12 +4426,13 @@ module Aws::KMS
4091
4426
  #
4092
4427
  #
4093
4428
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
4094
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
4095
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4096
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4097
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
4098
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4099
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4429
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
4430
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
4431
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4432
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4433
+ # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate
4434
+ # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4435
+ # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4100
4436
  #
4101
4437
  # @option params [required, String] :key_id
4102
4438
  # Gets the rotation status for the specified KMS key.
@@ -4151,21 +4487,22 @@ module Aws::KMS
4151
4487
  req.send_request(options)
4152
4488
  end
4153
4489
 
4154
- # Returns the items you need to import key material into a symmetric,
4155
- # customer managed KMS key. For more information about importing key
4156
- # material into KMS, see [Importing Key Material][1] in the *Key
4157
- # Management Service Developer Guide*.
4490
+ # Returns the items you need to import key material into a symmetric
4491
+ # encryption KMS key. For more information about importing key material
4492
+ # into KMS, see [Importing key material][1] in the *Key Management
4493
+ # Service Developer Guide*.
4158
4494
  #
4159
4495
  # This operation returns a public key and an import token. Use the
4160
4496
  # public key to encrypt the symmetric key material. Store the import
4161
4497
  # token to send with a subsequent ImportKeyMaterial request.
4162
4498
  #
4163
- # You must specify the key ID of the symmetric KMS key into which you
4164
- # will import key material. This KMS key's `Origin` must be `EXTERNAL`.
4165
- # You must also specify the wrapping algorithm and type of wrapping key
4166
- # (public key) that you will use to encrypt the key material. You cannot
4167
- # perform this operation on an asymmetric KMS key or on any KMS key in a
4168
- # different Amazon Web Services account.
4499
+ # You must specify the key ID of the symmetric encryption KMS key into
4500
+ # which you will import key material. This KMS key's `Origin` must be
4501
+ # `EXTERNAL`. You must also specify the wrapping algorithm and type of
4502
+ # wrapping key (public key) that you will use to encrypt the key
4503
+ # material. You cannot perform this operation on an asymmetric KMS key,
4504
+ # an HMAC KMS key, or on any KMS key in a different Amazon Web Services
4505
+ # account.
4169
4506
  #
4170
4507
  # To import key material, you must use the public key and import token
4171
4508
  # from the same response. These items are valid for 24 hours. The
@@ -4175,8 +4512,8 @@ module Aws::KMS
4175
4512
  # `GetParametersForImport` request.
4176
4513
  #
4177
4514
  # The KMS key that you use for this operation must be in a compatible
4178
- # key state. For details, see [Key state: Effect on your KMS key][2] in
4179
- # the *Key Management Service Developer Guide*.
4515
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
4516
+ # Management Service Developer Guide*.
4180
4517
  #
4181
4518
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4182
4519
  # key in a different Amazon Web Services account.
@@ -4197,8 +4534,8 @@ module Aws::KMS
4197
4534
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4198
4535
  #
4199
4536
  # @option params [required, String] :key_id
4200
- # The identifier of the symmetric KMS key into which you will import key
4201
- # material. The `Origin` of the KMS key must be `EXTERNAL`.
4537
+ # The identifier of the symmetric encryption KMS key into which you will
4538
+ # import key material. The `Origin` of the KMS key must be `EXTERNAL`.
4202
4539
  #
4203
4540
  # Specify the key ID or key ARN of the KMS key.
4204
4541
  #
@@ -4281,9 +4618,8 @@ module Aws::KMS
4281
4618
  # callers with `kms:GetPublicKey` permission can download the public key
4282
4619
  # of an asymmetric KMS key. You can share the public key to allow others
4283
4620
  # to encrypt messages and verify signatures outside of KMS. For
4284
- # information about symmetric and asymmetric KMS keys, see [Using
4285
- # Symmetric and Asymmetric KMS keys][1] in the *Key Management Service
4286
- # Developer Guide*.
4621
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
4622
+ # the *Key Management Service Developer Guide*.
4287
4623
  #
4288
4624
  # You do not need to download the public key. Instead, you can use the
4289
4625
  # public key within KMS by calling the Encrypt, ReEncrypt, or Verify
@@ -4315,8 +4651,8 @@ module Aws::KMS
4315
4651
  # in a verification operation.
4316
4652
  #
4317
4653
  # The KMS key that you use for this operation must be in a compatible
4318
- # key state. For details, see [Key state: Effect on your KMS key][7] in
4319
- # the *Key Management Service Developer Guide*.
4654
+ # key state. For details, see [Key states of KMS keys][7] in the *Key
4655
+ # Management Service Developer Guide*.
4320
4656
  #
4321
4657
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
4322
4658
  # in a different Amazon Web Services account, specify the key ARN or
@@ -4416,9 +4752,9 @@ module Aws::KMS
4416
4752
  #
4417
4753
  # resp.key_id #=> String
4418
4754
  # resp.public_key #=> String
4419
- # resp.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
4420
- # resp.key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
4421
- # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
4755
+ # 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"
4756
+ # 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"
4757
+ # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
4422
4758
  # resp.encryption_algorithms #=> Array
4423
4759
  # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
4424
4760
  # resp.signing_algorithms #=> Array
@@ -4433,16 +4769,17 @@ module Aws::KMS
4433
4769
  req.send_request(options)
4434
4770
  end
4435
4771
 
4436
- # Imports key material into an existing symmetric KMS KMS key that was
4437
- # created without key material. After you successfully import key
4438
- # material into a KMS key, you can [reimport the same key material][1]
4439
- # into that KMS key, but you cannot import different key material.
4440
- #
4441
- # You cannot perform this operation on an asymmetric KMS key or on any
4442
- # KMS key in a different Amazon Web Services account. For more
4443
- # information about creating KMS keys with no key material and then
4444
- # importing key material, see [Importing Key Material][2] in the *Key
4445
- # Management Service Developer Guide*.
4772
+ # Imports key material into an existing symmetric encryption KMS key
4773
+ # that was created without key material. After you successfully import
4774
+ # key material into a KMS key, you can [reimport the same key
4775
+ # material][1] into that KMS key, but you cannot import different key
4776
+ # material.
4777
+ #
4778
+ # You cannot perform this operation on an asymmetric KMS key, an HMAC
4779
+ # KMS key, or on any KMS key in a different Amazon Web Services account.
4780
+ # For more information about creating KMS keys with no key material and
4781
+ # then importing key material, see [Importing Key Material][2] in the
4782
+ # *Key Management Service Developer Guide*.
4446
4783
  #
4447
4784
  # Before using this operation, call GetParametersForImport. Its response
4448
4785
  # includes a public key and an import token. Use the public key to
@@ -4484,8 +4821,8 @@ module Aws::KMS
4484
4821
  # Service Developer Guide*.
4485
4822
  #
4486
4823
  # The KMS key that you use for this operation must be in a compatible
4487
- # key state. For details, see [Key state: Effect on your KMS key][4] in
4488
- # the *Key Management Service Developer Guide*.
4824
+ # key state. For details, see [Key states of KMS keys][4] in the *Key
4825
+ # Management Service Developer Guide*.
4489
4826
  #
4490
4827
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4491
4828
  # key in a different Amazon Web Services account.
@@ -4507,10 +4844,13 @@ module Aws::KMS
4507
4844
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4508
4845
  #
4509
4846
  # @option params [required, String] :key_id
4510
- # The identifier of the symmetric KMS key that receives the imported key
4511
- # material. The KMS key's `Origin` must be `EXTERNAL`. This must be the
4512
- # same KMS key specified in the `KeyID` parameter of the corresponding
4513
- # GetParametersForImport request.
4847
+ # The identifier of the symmetric encryption KMS key that receives the
4848
+ # imported key material. This must be the same KMS key specified in the
4849
+ # `KeyID` parameter of the corresponding GetParametersForImport request.
4850
+ # The `Origin` of the KMS key must be `EXTERNAL`. You cannot perform
4851
+ # this operation on an asymmetric KMS key, an HMAC KMS key, a KMS key in
4852
+ # a custom key store, or on a KMS key in a different Amazon Web Services
4853
+ # account
4514
4854
  #
4515
4855
  # Specify the key ID or key ARN of the KMS key.
4516
4856
  #
@@ -4752,7 +5092,7 @@ module Aws::KMS
4752
5092
  # list by grant ID or grantee principal.
4753
5093
  #
4754
5094
  # For detailed information about grants, including grant terminology,
4755
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
5095
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
4756
5096
  # Guide</i> </i>. For examples of working with grants in several
4757
5097
  # programming languages, see [Programming grants][2].
4758
5098
  #
@@ -4922,7 +5262,7 @@ module Aws::KMS
4922
5262
  # resp.grants[0].retiring_principal #=> String
4923
5263
  # resp.grants[0].issuing_account #=> String
4924
5264
  # resp.grants[0].operations #=> Array
4925
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
5265
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
4926
5266
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
4927
5267
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
4928
5268
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5278,7 +5618,7 @@ module Aws::KMS
5278
5618
  # a grant, use the RetireGrant operation.
5279
5619
  #
5280
5620
  # For detailed information about grants, including grant terminology,
5281
- # see [Using grants][1] in the <i> <i>Key Management Service Developer
5621
+ # see [Grants in KMS][1] in the <i> <i>Key Management Service Developer
5282
5622
  # Guide</i> </i>. For examples of working with grants in several
5283
5623
  # programming languages, see [Programming grants][2].
5284
5624
  #
@@ -5390,7 +5730,7 @@ module Aws::KMS
5390
5730
  # resp.grants[0].retiring_principal #=> String
5391
5731
  # resp.grants[0].issuing_account #=> String
5392
5732
  # resp.grants[0].operations #=> Array
5393
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext"
5733
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
5394
5734
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
5395
5735
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
5396
5736
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5540,7 +5880,7 @@ module Aws::KMS
5540
5880
  # [encryption context][2] of a ciphertext.
5541
5881
  #
5542
5882
  # The `ReEncrypt` operation can decrypt ciphertext that was encrypted by
5543
- # using an KMS KMS key in an KMS operation, such as Encrypt or
5883
+ # using a KMS key in an KMS operation, such as Encrypt or
5544
5884
  # GenerateDataKey. It can also decrypt ciphertext that was encrypted by
5545
5885
  # using the public key of an [asymmetric KMS key][3] outside of KMS.
5546
5886
  # However, it cannot decrypt ciphertext produced by other libraries,
@@ -5558,25 +5898,24 @@ module Aws::KMS
5558
5898
  # algorithm that was used. This information is required to decrypt the
5559
5899
  # data.
5560
5900
  #
5561
- # * If your ciphertext was encrypted under a symmetric KMS key, the
5562
- # `SourceKeyId` parameter is optional. KMS can get this information
5563
- # from metadata that it adds to the symmetric ciphertext blob. This
5564
- # feature adds durability to your implementation by ensuring that
5565
- # authorized users can decrypt ciphertext decades after it was
5566
- # encrypted, even if they've lost track of the key ID. However,
5567
- # specifying the source KMS key is always recommended as a best
5568
- # practice. When you use the `SourceKeyId` parameter to specify a KMS
5569
- # key, KMS uses only the KMS key you specify. If the ciphertext was
5570
- # encrypted under a different KMS key, the `ReEncrypt` operation
5901
+ # * If your ciphertext was encrypted under a symmetric encryption KMS
5902
+ # key, the `SourceKeyId` parameter is optional. KMS can get this
5903
+ # information from metadata that it adds to the symmetric ciphertext
5904
+ # blob. This feature adds durability to your implementation by
5905
+ # ensuring that authorized users can decrypt ciphertext decades after
5906
+ # it was encrypted, even if they've lost track of the key ID.
5907
+ # However, specifying the source KMS key is always recommended as a
5908
+ # best practice. When you use the `SourceKeyId` parameter to specify a
5909
+ # KMS key, KMS uses only the KMS key you specify. If the ciphertext
5910
+ # was encrypted under a different KMS key, the `ReEncrypt` operation
5571
5911
  # fails. This practice ensures that you use the KMS key that you
5572
5912
  # intend.
5573
5913
  #
5574
5914
  # * To reencrypt the data, you must use the `DestinationKeyId` parameter
5575
5915
  # specify the KMS key that re-encrypts the data after it is decrypted.
5576
- # You can select a symmetric or asymmetric KMS key. If the destination
5577
- # KMS key is an asymmetric KMS key, you must also provide the
5578
- # encryption algorithm. The algorithm that you choose must be
5579
- # compatible with the KMS key.
5916
+ # If the destination KMS key is an asymmetric KMS key, you must also
5917
+ # provide the encryption algorithm. The algorithm that you choose must
5918
+ # be compatible with the KMS key.
5580
5919
  #
5581
5920
  # When you use an asymmetric KMS key to encrypt or reencrypt data, be
5582
5921
  # sure to record the KMS key and encryption algorithm that you choose.
@@ -5586,14 +5925,15 @@ module Aws::KMS
5586
5925
  # fails.
5587
5926
  #
5588
5927
  # You are not required to supply the key ID and encryption algorithm
5589
- # when you decrypt with symmetric KMS keys because KMS stores this
5590
- # information in the ciphertext blob. KMS cannot store metadata in
5591
- # ciphertext generated with asymmetric keys. The standard format for
5592
- # asymmetric key ciphertext does not include configurable fields.
5928
+ # when you decrypt with symmetric encryption KMS keys because KMS
5929
+ # stores this information in the ciphertext blob. KMS cannot store
5930
+ # metadata in ciphertext generated with asymmetric keys. The standard
5931
+ # format for asymmetric key ciphertext does not include configurable
5932
+ # fields.
5593
5933
  #
5594
5934
  # The KMS key that you use for this operation must be in a compatible
5595
- # key state. For details, see [Key state: Effect on your KMS key][6] in
5596
- # the *Key Management Service Developer Guide*.
5935
+ # key state. For details, see [Key states of KMS keys][6] in the *Key
5936
+ # Management Service Developer Guide*.
5597
5937
  #
5598
5938
  # **Cross-account use**\: Yes. The source KMS key and destination KMS
5599
5939
  # key can be in different Amazon Web Services accounts. Either or both
@@ -5644,13 +5984,14 @@ module Aws::KMS
5644
5984
  # ciphertext.
5645
5985
  #
5646
5986
  # An *encryption context* is a collection of non-secret key-value pairs
5647
- # that represents additional authenticated data. When you use an
5987
+ # that represent additional authenticated data. When you use an
5648
5988
  # encryption context to encrypt data, you must specify the same (an
5649
5989
  # exact case-sensitive match) encryption context to decrypt the data. An
5650
- # encryption context is optional when encrypting with a symmetric KMS
5651
- # key, but it is highly recommended.
5990
+ # encryption context is supported only on operations with symmetric
5991
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
5992
+ # an encryption context is optional, but it is strongly recommended.
5652
5993
  #
5653
- # For more information, see [Encryption Context][1] in the *Key
5994
+ # For more information, see [Encryption context][1] in the *Key
5654
5995
  # Management Service Developer Guide*.
5655
5996
  #
5656
5997
  #
@@ -5659,14 +6000,18 @@ module Aws::KMS
5659
6000
  #
5660
6001
  # @option params [String] :source_key_id
5661
6002
  # Specifies the KMS key that KMS will use to decrypt the ciphertext
5662
- # before it is re-encrypted. Enter a key ID of the KMS key that was used
5663
- # to encrypt the ciphertext.
6003
+ # before it is re-encrypted.
6004
+ #
6005
+ # Enter a key ID of the KMS key that was used to encrypt the ciphertext.
6006
+ # If you identify a different KMS key, the `ReEncrypt` operation throws
6007
+ # an `IncorrectKeyException`.
5664
6008
  #
5665
6009
  # This parameter is required only when the ciphertext was encrypted
5666
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
5667
- # get the KMS key from metadata that it adds to the symmetric ciphertext
5668
- # blob. However, it is always recommended as a best practice. This
5669
- # practice ensures that you use the KMS key that you intend.
6010
+ # under an asymmetric KMS key. If you used a symmetric encryption KMS
6011
+ # key, KMS can get the KMS key from metadata that it adds to the
6012
+ # symmetric ciphertext blob. However, it is always recommended as a best
6013
+ # practice. This practice ensures that you use the KMS key that you
6014
+ # intend.
5670
6015
  #
5671
6016
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5672
6017
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5689,9 +6034,9 @@ module Aws::KMS
5689
6034
  #
5690
6035
  # @option params [required, String] :destination_key_id
5691
6036
  # A unique identifier for the KMS key that is used to reencrypt the
5692
- # data. Specify a symmetric or asymmetric KMS key with a `KeyUsage`
5693
- # value of `ENCRYPT_DECRYPT`. To find the `KeyUsage` value of a KMS key,
5694
- # use the DescribeKey operation.
6037
+ # data. Specify a symmetric encryption KMS key or an asymmetric KMS key
6038
+ # with a `KeyUsage` value of `ENCRYPT_DECRYPT`. To find the `KeyUsage`
6039
+ # value of a KMS key, use the DescribeKey operation.
5695
6040
  #
5696
6041
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5697
6042
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5717,17 +6062,18 @@ module Aws::KMS
5717
6062
  # data.
5718
6063
  #
5719
6064
  # A destination encryption context is valid only when the destination
5720
- # KMS key is a symmetric KMS key. The standard ciphertext format for
5721
- # asymmetric KMS keys does not include fields for metadata.
6065
+ # KMS key is a symmetric encryption KMS key. The standard ciphertext
6066
+ # format for asymmetric KMS keys does not include fields for metadata.
5722
6067
  #
5723
6068
  # An *encryption context* is a collection of non-secret key-value pairs
5724
- # that represents additional authenticated data. When you use an
6069
+ # that represent additional authenticated data. When you use an
5725
6070
  # encryption context to encrypt data, you must specify the same (an
5726
6071
  # exact case-sensitive match) encryption context to decrypt the data. An
5727
- # encryption context is optional when encrypting with a symmetric KMS
5728
- # key, but it is highly recommended.
6072
+ # encryption context is supported only on operations with symmetric
6073
+ # encryption KMS keys. On operations with symmetric encryption KMS keys,
6074
+ # an encryption context is optional, but it is strongly recommended.
5729
6075
  #
5730
- # For more information, see [Encryption Context][1] in the *Key
6076
+ # For more information, see [Encryption context][1] in the *Key
5731
6077
  # Management Service Developer Guide*.
5732
6078
  #
5733
6079
  #
@@ -5737,8 +6083,8 @@ module Aws::KMS
5737
6083
  # @option params [String] :source_encryption_algorithm
5738
6084
  # Specifies the encryption algorithm that KMS will use to decrypt the
5739
6085
  # ciphertext before it is reencrypted. The default value,
5740
- # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric KMS
5741
- # keys.
6086
+ # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric
6087
+ # encryption KMS keys.
5742
6088
  #
5743
6089
  # Specify the same algorithm that was used to encrypt the ciphertext. If
5744
6090
  # you specify a different algorithm, the decrypt attempt fails.
@@ -5750,7 +6096,7 @@ module Aws::KMS
5750
6096
  # Specifies the encryption algorithm that KMS will use to reecrypt the
5751
6097
  # data after it has decrypted it. The default value,
5752
6098
  # `SYMMETRIC_DEFAULT`, represents the encryption algorithm used for
5753
- # symmetric KMS keys.
6099
+ # symmetric encryption KMS keys.
5754
6100
  #
5755
6101
  # This parameter is required only when the destination KMS key is an
5756
6102
  # asymmetric KMS key.
@@ -5841,7 +6187,7 @@ module Aws::KMS
5841
6187
  # encrypt data in one Amazon Web Services Region and decrypt it in a
5842
6188
  # different Amazon Web Services Region without re-encrypting the data or
5843
6189
  # making a cross-Region call. For more information about multi-Region
5844
- # keys, see [Using multi-Region keys][1] in the *Key Management Service
6190
+ # keys, see [Multi-Region keys in KMS][1] in the *Key Management Service
5845
6191
  # Developer Guide*.
5846
6192
  #
5847
6193
  # A *replica key* is a fully-functional KMS key that can be used
@@ -5852,8 +6198,8 @@ module Aws::KMS
5852
6198
  # [automatic key rotation status][6]. KMS automatically synchronizes
5853
6199
  # these shared properties among related multi-Region keys. All other
5854
6200
  # properties of a replica key can differ, including its [key policy][7],
5855
- # [tags][8], [aliases][9], and [key state][10]. KMS pricing and quotas
5856
- # for KMS keys apply to each primary key and replica key.
6201
+ # [tags][8], [aliases][9], and [Key states of KMS keys][10]. KMS pricing
6202
+ # and quotas for KMS keys apply to each primary key and replica key.
5857
6203
  #
5858
6204
  # When this operation completes, the new replica key has a transient key
5859
6205
  # state of `Creating`. This key state changes to `Enabled` (or
@@ -5863,9 +6209,17 @@ module Aws::KMS
5863
6209
  # If you are creating and using the replica key programmatically, retry
5864
6210
  # on `KMSInvalidStateException` or call `DescribeKey` to check its
5865
6211
  # `KeyState` value before using it. For details about the `Creating` key
5866
- # state, see [Key state: Effect on your KMS
5867
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
5868
- # Service Developer Guide*.
6212
+ # state, see [Key states of KMS keys][10] in the *Key Management Service
6213
+ # Developer Guide*.
6214
+ #
6215
+ # You cannot create more than one replica of a primary key in any
6216
+ # Region. If the Region already includes a replica of the key you're
6217
+ # trying to replicate, `ReplicateKey` returns an
6218
+ # `AlreadyExistsException` error. If the key state of the existing
6219
+ # replica is `PendingDeletion`, you can cancel the scheduled key
6220
+ # deletion (CancelKeyDeletion) or wait for the key to be deleted. The
6221
+ # new replica key you create will have the same [shared properties][11]
6222
+ # as the original replica key.
5869
6223
  #
5870
6224
  # The CloudTrail log of a `ReplicateKey` operation records a
5871
6225
  # `ReplicateKey` operation in the primary key's Region and a CreateKey
@@ -5918,6 +6272,7 @@ module Aws::KMS
5918
6272
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html
5919
6273
  # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html
5920
6274
  # [10]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
6275
+ # [11]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-sync-properties
5921
6276
  #
5922
6277
  # @option params [required, String] :key_id
5923
6278
  # Identifies the multi-Region primary key that is being replicated. To
@@ -5945,24 +6300,33 @@ module Aws::KMS
5945
6300
  # [KMS service endpoints][1] in the *Amazon Web Services General
5946
6301
  # Reference*.
5947
6302
  #
6303
+ # <note markdown="1"> HMAC KMS keys are not supported in all Amazon Web Services Regions. If
6304
+ # you try to replicate an HMAC KMS key in an Amazon Web Services Region
6305
+ # in which HMAC keys are not supported, the `ReplicateKey` operation
6306
+ # returns an `UnsupportedOperationException`. For a list of Regions in
6307
+ # which HMAC KMS keys are supported, see [HMAC keys in KMS][2] in the
6308
+ # *Key Management Service Developer Guide*.
6309
+ #
6310
+ # </note>
6311
+ #
5948
6312
  # The replica must be in a different Amazon Web Services Region than its
5949
6313
  # primary key and other replicas of that primary key, but in the same
5950
6314
  # Amazon Web Services partition. KMS must be available in the replica
5951
6315
  # Region. If the Region is not enabled by default, the Amazon Web
5952
- # Services account must be enabled in the Region.
5953
- #
5954
- # For information about Amazon Web Services partitions, see [Amazon
5955
- # Resource Names (ARNs) in the *Amazon Web Services General
5956
- # Reference*.][2] For information about enabling and disabling Regions,
5957
- # see [Enabling a Region][3] and [Disabling a Region][4] in the *Amazon
5958
- # Web Services General Reference*.
6316
+ # Services account must be enabled in the Region. For information about
6317
+ # Amazon Web Services partitions, see [Amazon Resource Names (ARNs)][3]
6318
+ # in the *Amazon Web Services General Reference*. For information about
6319
+ # enabling and disabling Regions, see [Enabling a Region][4] and
6320
+ # [Disabling a Region][5] in the *Amazon Web Services General
6321
+ # Reference*.
5959
6322
  #
5960
6323
  #
5961
6324
  #
5962
6325
  # [1]: https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region
5963
- # [2]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
5964
- # [3]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
5965
- # [4]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable
6326
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
6327
+ # [3]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
6328
+ # [4]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
6329
+ # [5]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-disable
5966
6330
  #
5967
6331
  # @option params [String] :policy
5968
6332
  # The key policy to attach to the KMS key. This parameter is optional.
@@ -6036,8 +6400,8 @@ module Aws::KMS
6036
6400
  # TagResource operation.
6037
6401
  #
6038
6402
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6039
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
6040
- # Service Developer Guide*.
6403
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
6404
+ # Developer Guide*.
6041
6405
  #
6042
6406
  # </note>
6043
6407
  #
@@ -6142,7 +6506,7 @@ module Aws::KMS
6142
6506
  # resp.replica_key_metadata.creation_date #=> Time
6143
6507
  # resp.replica_key_metadata.enabled #=> Boolean
6144
6508
  # resp.replica_key_metadata.description #=> String
6145
- # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT"
6509
+ # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
6146
6510
  # resp.replica_key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
6147
6511
  # resp.replica_key_metadata.deletion_date #=> Time
6148
6512
  # resp.replica_key_metadata.valid_to #=> Time
@@ -6151,8 +6515,8 @@ module Aws::KMS
6151
6515
  # resp.replica_key_metadata.cloud_hsm_cluster_id #=> String
6152
6516
  # resp.replica_key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
6153
6517
  # resp.replica_key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
6154
- # resp.replica_key_metadata.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
6155
- # resp.replica_key_metadata.key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT"
6518
+ # 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"
6519
+ # 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"
6156
6520
  # resp.replica_key_metadata.encryption_algorithms #=> Array
6157
6521
  # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
6158
6522
  # resp.replica_key_metadata.signing_algorithms #=> Array
@@ -6165,6 +6529,8 @@ module Aws::KMS
6165
6529
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
6166
6530
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].region #=> String
6167
6531
  # resp.replica_key_metadata.pending_deletion_window_in_days #=> Integer
6532
+ # resp.replica_key_metadata.mac_algorithms #=> Array
6533
+ # resp.replica_key_metadata.mac_algorithms[0] #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
6168
6534
  # resp.replica_policy #=> String
6169
6535
  # resp.replica_tags #=> Array
6170
6536
  # resp.replica_tags[0].tag_key #=> String
@@ -6186,14 +6552,13 @@ module Aws::KMS
6186
6552
  #
6187
6553
  # This operation can be called by the *retiring principal* for a grant,
6188
6554
  # by the *grantee principal* if the grant allows the `RetireGrant`
6189
- # operation, and by the Amazon Web Services account (root user) in which
6190
- # the grant is created. It can also be called by principals to whom
6191
- # permission for retiring a grant is delegated. For details, see
6192
- # [Retiring and revoking grants][2] in the *Key Management Service
6193
- # Developer Guide*.
6555
+ # operation, and by the Amazon Web Services account in which the grant
6556
+ # is created. It can also be called by principals to whom permission for
6557
+ # retiring a grant is delegated. For details, see [Retiring and revoking
6558
+ # grants][2] in the *Key Management Service Developer Guide*.
6194
6559
  #
6195
6560
  # For detailed information about grants, including grant terminology,
6196
- # see [Using grants][3] in the <i> <i>Key Management Service Developer
6561
+ # see [Grants in KMS][3] in the <i> <i>Key Management Service Developer
6197
6562
  # Guide</i> </i>. For examples of working with grants in several
6198
6563
  # programming languages, see [Programming grants][4].
6199
6564
  #
@@ -6291,7 +6656,7 @@ module Aws::KMS
6291
6656
  # Service Developer Guide</i> </i>.
6292
6657
  #
6293
6658
  # For detailed information about grants, including grant terminology,
6294
- # see [Using grants][3] in the <i> <i>Key Management Service Developer
6659
+ # see [Grants in KMS][3] in the <i> <i>Key Management Service Developer
6295
6660
  # Guide</i> </i>. For examples of working with grants in several
6296
6661
  # programming languages, see [Programming grants][4].
6297
6662
  #
@@ -6408,8 +6773,8 @@ module Aws::KMS
6408
6773
  # Guide*.
6409
6774
  #
6410
6775
  # The KMS key that you use for this operation must be in a compatible
6411
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6412
- # the *Key Management Service Developer Guide*.
6776
+ # key state. For details, see [Key states of KMS keys][5] in the *Key
6777
+ # Management Service Developer Guide*.
6413
6778
  #
6414
6779
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6415
6780
  # key in a different Amazon Web Services account.
@@ -6503,11 +6868,11 @@ module Aws::KMS
6503
6868
  end
6504
6869
 
6505
6870
  # Creates a [digital signature][1] for a message or message digest by
6506
- # using the private key in an asymmetric KMS key. To verify the
6871
+ # using the private key in an asymmetric signing KMS key. To verify the
6507
6872
  # signature, use the Verify operation, or use the public key in the same
6508
- # asymmetric KMS key outside of KMS. For information about symmetric and
6509
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][2]
6510
- # in the *Key Management Service Developer Guide*.
6873
+ # asymmetric KMS key outside of KMS. For information about asymmetric
6874
+ # KMS keys, see [Asymmetric KMS keys][2] in the *Key Management Service
6875
+ # Developer Guide*.
6511
6876
  #
6512
6877
  # Digital signatures are generated and verified by using asymmetric key
6513
6878
  # pair, such as an RSA or ECC pair that is represented by an asymmetric
@@ -6541,8 +6906,8 @@ module Aws::KMS
6541
6906
  # KMS.
6542
6907
  #
6543
6908
  # The KMS key that you use for this operation must be in a compatible
6544
- # key state. For details, see [Key state: Effect on your KMS key][3] in
6545
- # the *Key Management Service Developer Guide*.
6909
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
6910
+ # Management Service Developer Guide*.
6546
6911
  #
6547
6912
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
6548
6913
  # in a different Amazon Web Services account, specify the key ARN or
@@ -6669,8 +7034,8 @@ module Aws::KMS
6669
7034
  # Adds or edits tags on a [customer managed key][1].
6670
7035
  #
6671
7036
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6672
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6673
- # Service Developer Guide*.
7037
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7038
+ # Developer Guide*.
6674
7039
  #
6675
7040
  # </note>
6676
7041
  #
@@ -6692,8 +7057,8 @@ module Aws::KMS
6692
7057
  # General Reference*.
6693
7058
  #
6694
7059
  # The KMS key that you use for this operation must be in a compatible
6695
- # key state. For details, see [Key state: Effect on your KMS key][9] in
6696
- # the *Key Management Service Developer Guide*.
7060
+ # key state. For details, see [Key states of KMS keys][9] in the *Key
7061
+ # Management Service Developer Guide*.
6697
7062
  #
6698
7063
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6699
7064
  # key in a different Amazon Web Services account.
@@ -6790,8 +7155,8 @@ module Aws::KMS
6790
7155
  # specify the tag key and the KMS key.
6791
7156
  #
6792
7157
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6793
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6794
- # Service Developer Guide*.
7158
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7159
+ # Developer Guide*.
6795
7160
  #
6796
7161
  # </note>
6797
7162
  #
@@ -6806,8 +7171,8 @@ module Aws::KMS
6806
7171
  # General Reference*.
6807
7172
  #
6808
7173
  # The KMS key that you use for this operation must be in a compatible
6809
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6810
- # the *Key Management Service Developer Guide*.
7174
+ # key state. For details, see [Key states of KMS keys][5] in the *Key
7175
+ # Management Service Developer Guide*.
6811
7176
  #
6812
7177
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6813
7178
  # key in a different Amazon Web Services account.
@@ -6888,8 +7253,8 @@ module Aws::KMS
6888
7253
  # Amazon Web Services account and Region.
6889
7254
  #
6890
7255
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
6891
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
6892
- # Management Service Developer Guide*.
7256
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
7257
+ # Service Developer Guide*.
6893
7258
  #
6894
7259
  # </note>
6895
7260
  #
@@ -6911,8 +7276,8 @@ module Aws::KMS
6911
7276
  # ListAliases operation.
6912
7277
  #
6913
7278
  # The KMS key that you use for this operation must be in a compatible
6914
- # key state. For details, see [Key state: Effect on your KMS key][2] in
6915
- # the *Key Management Service Developer Guide*.
7279
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
7280
+ # Management Service Developer Guide*.
6916
7281
  #
6917
7282
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6918
7283
  # key in a different Amazon Web Services account.
@@ -7177,8 +7542,8 @@ module Aws::KMS
7177
7542
  # key, use DescribeKey.
7178
7543
  #
7179
7544
  # The KMS key that you use for this operation must be in a compatible
7180
- # key state. For details, see [Key state: Effect on your KMS key][1] in
7181
- # the *Key Management Service Developer Guide*.
7545
+ # key state. For details, see [Key states of KMS keys][1] in the *Key
7546
+ # Management Service Developer Guide*.
7182
7547
  #
7183
7548
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
7184
7549
  # key in a different Amazon Web Services account.
@@ -7260,7 +7625,7 @@ module Aws::KMS
7260
7625
  # encrypt data in one Amazon Web Services Region and decrypt it in a
7261
7626
  # different Amazon Web Services Region without re-encrypting the data or
7262
7627
  # making a cross-Region call. For more information about multi-Region
7263
- # keys, see [Using multi-Region keys][2] in the *Key Management Service
7628
+ # keys, see [Multi-Region keys in KMS][2] in the *Key Management Service
7264
7629
  # Developer Guide*.
7265
7630
  #
7266
7631
  # The *primary key* of a multi-Region key is the source for properties
@@ -7290,9 +7655,8 @@ module Aws::KMS
7290
7655
  # can use the keys in cryptographic operations, but you cannot replicate
7291
7656
  # the new primary key or perform certain management operations, such as
7292
7657
  # enabling or disabling these keys. For details about the `Updating` key
7293
- # state, see [Key state: Effect on your KMS
7294
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
7295
- # Service Developer Guide*.
7658
+ # state, see [Key states of KMS keys][9] in the *Key Management Service
7659
+ # Developer Guide*.
7296
7660
  #
7297
7661
  # This operation does not return any output. To verify that primary key
7298
7662
  # is changed, use the DescribeKey operation.
@@ -7325,6 +7689,7 @@ module Aws::KMS
7325
7689
  # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin
7326
7690
  # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
7327
7691
  # [8]: https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html
7692
+ # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
7328
7693
  #
7329
7694
  # @option params [required, String] :key_id
7330
7695
  # Identifies the current primary key. When the operation completes, this
@@ -7381,9 +7746,9 @@ module Aws::KMS
7381
7746
  #
7382
7747
  # A digital signature is generated by using the private key in an
7383
7748
  # asymmetric KMS key. The signature is verified by using the public key
7384
- # in the same asymmetric KMS key. For information about symmetric and
7385
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][1]
7386
- # in the *Key Management Service Developer Guide*.
7749
+ # in the same asymmetric KMS key. For information about asymmetric KMS
7750
+ # keys, see [Asymmetric KMS keys][1] in the *Key Management Service
7751
+ # Developer Guide*.
7387
7752
  #
7388
7753
  # To verify a digital signature, you can use the `Verify` operation.
7389
7754
  # Specify the same asymmetric KMS key, message, and signing algorithm
@@ -7400,8 +7765,8 @@ module Aws::KMS
7400
7765
  # signatures.
7401
7766
  #
7402
7767
  # The KMS key that you use for this operation must be in a compatible
7403
- # key state. For details, see [Key state: Effect on your KMS key][2] in
7404
- # the *Key Management Service Developer Guide*.
7768
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
7769
+ # Management Service Developer Guide*.
7405
7770
  #
7406
7771
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
7407
7772
  # in a different Amazon Web Services account, specify the key ARN or
@@ -7503,7 +7868,7 @@ module Aws::KMS
7503
7868
  # resp.to_h outputs the following:
7504
7869
  # {
7505
7870
  # key_id: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", # The key ARN of the asymmetric KMS key that was used to verify the digital signature.
7506
- # signature_valid: true, # Indicates whether the signature was verified (true) or failed verification (false).
7871
+ # signature_valid: true, # A value of 'true' Indicates that the signature was verified. If verification fails, the call to Verify fails.
7507
7872
  # signing_algorithm: "ECDSA_SHA_384", # The signing algorithm that was used to verify the signature.
7508
7873
  # }
7509
7874
  #
@@ -7533,6 +7898,128 @@ module Aws::KMS
7533
7898
  req.send_request(options)
7534
7899
  end
7535
7900
 
7901
+ # Verifies the hash-based message authentication code (HMAC) for a
7902
+ # specified message, HMAC KMS key, and MAC algorithm. To verify the
7903
+ # HMAC, `VerifyMac` computes an HMAC using the message, HMAC KMS key,
7904
+ # and MAC algorithm that you specify, and compares the computed HMAC to
7905
+ # the HMAC that you specify. If the HMACs are identical, the
7906
+ # verification succeeds; otherwise, it fails.
7907
+ #
7908
+ # Verification indicates that the message hasn't changed since the HMAC
7909
+ # was calculated, and the specified key was used to generate and verify
7910
+ # the HMAC.
7911
+ #
7912
+ # This operation is part of KMS support for HMAC KMS keys. For details,
7913
+ # see [HMAC keys in KMS][1] in the *Key Management Service Developer
7914
+ # Guide*.
7915
+ #
7916
+ # The KMS key that you use for this operation must be in a compatible
7917
+ # key state. For details, see [Key states of KMS keys][2] in the *Key
7918
+ # Management Service Developer Guide*.
7919
+ #
7920
+ # **Cross-account use**\: Yes. To perform this operation with a KMS key
7921
+ # in a different Amazon Web Services account, specify the key ARN or
7922
+ # alias ARN in the value of the `KeyId` parameter.
7923
+ #
7924
+ # **Required permissions**\: [kms:VerifyMac][3] (key policy)
7925
+ #
7926
+ # **Related operations**\: GenerateMac
7927
+ #
7928
+ #
7929
+ #
7930
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html
7931
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
7932
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
7933
+ #
7934
+ # @option params [required, String, StringIO, File] :message
7935
+ # The message that will be used in the verification. Enter the same
7936
+ # message that was used to generate the HMAC.
7937
+ #
7938
+ # GenerateMac and `VerifyMac` do not provide special handling for
7939
+ # message digests. If you generated an HMAC for a hash digest of a
7940
+ # message, you must verify the HMAC for the same hash digest.
7941
+ #
7942
+ # @option params [required, String] :key_id
7943
+ # The KMS key that will be used in the verification.
7944
+ #
7945
+ # Enter a key ID of the KMS key that was used to generate the HMAC. If
7946
+ # you identify a different KMS key, the `VerifyMac` operation fails.
7947
+ #
7948
+ # @option params [required, String] :mac_algorithm
7949
+ # The MAC algorithm that will be used in the verification. Enter the
7950
+ # same MAC algorithm that was used to compute the HMAC. This algorithm
7951
+ # must be supported by the HMAC KMS key identified by the `KeyId`
7952
+ # parameter.
7953
+ #
7954
+ # @option params [required, String, StringIO, File] :mac
7955
+ # The HMAC to verify. Enter the HMAC that was generated by the
7956
+ # GenerateMac operation when you specified the same message, HMAC KMS
7957
+ # key, and MAC algorithm as the values specified in this request.
7958
+ #
7959
+ # @option params [Array<String>] :grant_tokens
7960
+ # A list of grant tokens.
7961
+ #
7962
+ # Use a grant token when your permission to call this operation comes
7963
+ # from a new grant that has not yet achieved *eventual consistency*. For
7964
+ # more information, see [Grant token][1] and [Using a grant token][2] in
7965
+ # the *Key Management Service Developer Guide*.
7966
+ #
7967
+ #
7968
+ #
7969
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
7970
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
7971
+ #
7972
+ # @return [Types::VerifyMacResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
7973
+ #
7974
+ # * {Types::VerifyMacResponse#key_id #key_id} => String
7975
+ # * {Types::VerifyMacResponse#mac_valid #mac_valid} => Boolean
7976
+ # * {Types::VerifyMacResponse#mac_algorithm #mac_algorithm} => String
7977
+ #
7978
+ #
7979
+ # @example Example: To verify an HMAC
7980
+ #
7981
+ # # This example verifies an HMAC for a particular message, HMAC KMS keys, and MAC algorithm. A value of 'true' in the
7982
+ # # MacValid value in the response indicates that the HMAC is valid.
7983
+ #
7984
+ # resp = client.verify_mac({
7985
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The HMAC KMS key input to the HMAC algorithm.
7986
+ # mac: "<HMAC_TAG>", # The HMAC to be verified.
7987
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm requested for the operation.
7988
+ # message: "Hello World", # The message input to the HMAC algorithm.
7989
+ # })
7990
+ #
7991
+ # resp.to_h outputs the following:
7992
+ # {
7993
+ # 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.
7994
+ # mac_algorithm: "HMAC_SHA_384", # The HMAC algorithm used in the operation.
7995
+ # mac_valid: true, # A value of 'true' indicates that verification succeeded. If verification fails, the call to VerifyMac fails.
7996
+ # }
7997
+ #
7998
+ # @example Request syntax with placeholder values
7999
+ #
8000
+ # resp = client.verify_mac({
8001
+ # message: "data", # required
8002
+ # key_id: "KeyIdType", # required
8003
+ # mac_algorithm: "HMAC_SHA_224", # required, accepts HMAC_SHA_224, HMAC_SHA_256, HMAC_SHA_384, HMAC_SHA_512
8004
+ # mac: "data", # required
8005
+ # grant_tokens: ["GrantTokenType"],
8006
+ # })
8007
+ #
8008
+ # @example Response structure
8009
+ #
8010
+ # resp.key_id #=> String
8011
+ # resp.mac_valid #=> Boolean
8012
+ # resp.mac_algorithm #=> String, one of "HMAC_SHA_224", "HMAC_SHA_256", "HMAC_SHA_384", "HMAC_SHA_512"
8013
+ #
8014
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/VerifyMac AWS API Documentation
8015
+ #
8016
+ # @overload verify_mac(params = {})
8017
+ # @param [Hash] params ({})
8018
+ def verify_mac(params = {}, options = {})
8019
+ req = build_request(:verify_mac, params)
8020
+ req.send_request(options)
8021
+ end
8022
+
7536
8023
  # @!endgroup
7537
8024
 
7538
8025
  # @param params ({})
@@ -7546,7 +8033,7 @@ module Aws::KMS
7546
8033
  params: params,
7547
8034
  config: config)
7548
8035
  context[:gem_name] = 'aws-sdk-kms'
7549
- context[:gem_version] = '1.55.0'
8036
+ context[:gem_version] = '1.56.0'
7550
8037
  Seahorse::Client::Request.new(handlers, context)
7551
8038
  end
7552
8039