aws-sdk-kms 1.53.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,9 @@ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
27
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
28
  require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
29
  require 'aws-sdk-core/plugins/http_checksum.rb'
30
+ require 'aws-sdk-core/plugins/checksum_algorithm.rb'
30
31
  require 'aws-sdk-core/plugins/defaults_mode.rb'
32
+ require 'aws-sdk-core/plugins/recursion_detection.rb'
31
33
  require 'aws-sdk-core/plugins/signature_v4.rb'
32
34
  require 'aws-sdk-core/plugins/protocols/json_rpc.rb'
33
35
 
@@ -74,7 +76,9 @@ module Aws::KMS
74
76
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
75
77
  add_plugin(Aws::Plugins::TransferEncoding)
76
78
  add_plugin(Aws::Plugins::HttpChecksum)
79
+ add_plugin(Aws::Plugins::ChecksumAlgorithm)
77
80
  add_plugin(Aws::Plugins::DefaultsMode)
81
+ add_plugin(Aws::Plugins::RecursionDetection)
78
82
  add_plugin(Aws::Plugins::SignatureV4)
79
83
  add_plugin(Aws::Plugins::Protocols::JsonRpc)
80
84
 
@@ -366,8 +370,8 @@ module Aws::KMS
366
370
  # Developer Guide*.
367
371
  #
368
372
  # The KMS key that you use for this operation must be in a compatible
369
- # key state. For details, see [Key state: Effect on your KMS key][2] in
370
- # 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*.
371
375
  #
372
376
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
373
377
  # key in a different Amazon Web Services account.
@@ -540,8 +544,8 @@ module Aws::KMS
540
544
  # Creates a friendly name for a KMS key.
541
545
  #
542
546
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
543
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
544
- # Management Service Developer Guide*.
547
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
548
+ # Service Developer Guide*.
545
549
  #
546
550
  # </note>
547
551
  #
@@ -566,8 +570,8 @@ module Aws::KMS
566
570
  # created, use the ListAliases operation.
567
571
  #
568
572
  # The KMS key that you use for this operation must be in a compatible
569
- # key state. For details, see [Key state: Effect on your KMS key][4] in
570
- # 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*.
571
575
  #
572
576
  # **Cross-account use**\: No. You cannot perform this operation on an
573
577
  # alias in a different Amazon Web Services account.
@@ -808,7 +812,7 @@ module Aws::KMS
808
812
  # and delete it without changing your key policies or IAM policies.
809
813
  #
810
814
  # For detailed information about grants, including grant terminology,
811
- # 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
812
816
  # Guide</i> </i>. For examples of working with grants in several
813
817
  # programming languages, see [Programming grants][2].
814
818
  #
@@ -831,8 +835,8 @@ module Aws::KMS
831
835
  # the ListGrants or ListRetirableGrants operations.
832
836
  #
833
837
  # The KMS key that you use for this operation must be in a compatible
834
- # key state. For details, see [Key state: Effect on your KMS key][4] in
835
- # 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*.
836
840
  #
837
841
  # **Cross-account use**\: Yes. To perform this operation on a KMS key in
838
842
  # a different Amazon Web Services account, specify the key ARN in the
@@ -917,12 +921,13 @@ module Aws::KMS
917
921
  # @option params [required, Array<String>] :operations
918
922
  # A list of operations that the grant permits.
919
923
  #
920
- # The operation must be supported on the KMS key. For example, you
921
- # cannot create a grant for a symmetric KMS key that allows the Sign
922
- # operation, or a grant for an asymmetric KMS key that allows the
923
- # GenerateDataKey operation. If you try, KMS returns a `ValidationError`
924
- # exception. For details, see [Grant operations][1] in the *Key
925
- # 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*.
926
931
  #
927
932
  #
928
933
  #
@@ -934,27 +939,38 @@ module Aws::KMS
934
939
  # KMS supports the `EncryptionContextEquals` and
935
940
  # `EncryptionContextSubset` grant constraints. Each constraint value can
936
941
  # include up to 8 encryption context pairs. The encryption context value
937
- # in each constraint cannot exceed 384 characters.
938
- #
939
- # These grant constraints allow the permissions in the grant only when
940
- # the encryption context in the request matches
941
- # (`EncryptionContextEquals`) or includes (`EncryptionContextSubset`)
942
- # the encryption context specified in this structure. For information
943
- # 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
944
944
  # Management Service Developer Guide*. For more information about
945
- # encryption context, see [Encryption Context][2] in the <i> <i>Key
945
+ # encryption context, see [Encryption context][2] in the <i> <i>Key
946
946
  # Management Service Developer Guide</i> </i>.
947
947
  #
948
- # The encryption context grant constraints are supported only on
949
- # operations that include an encryption context. You cannot use an
950
- # encryption context grant constraint for cryptographic operations with
951
- # asymmetric KMS keys or for management operations, such as DescribeKey
952
- # 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
+ #
953
968
  #
954
969
  #
955
970
  #
956
971
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/create-grant-overview.html#grant-constraints
957
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
958
974
  #
959
975
  # @option params [Array<String>] :grant_tokens
960
976
  # A list of grant tokens.
@@ -1016,7 +1032,7 @@ module Aws::KMS
1016
1032
  # key_id: "KeyIdType", # required
1017
1033
  # grantee_principal: "PrincipalIdType", # required
1018
1034
  # retiring_principal: "PrincipalIdType",
1019
- # 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
1020
1036
  # constraints: {
1021
1037
  # encryption_context_subset: {
1022
1038
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -1046,35 +1062,35 @@ module Aws::KMS
1046
1062
  # Creates a unique customer managed [KMS key][1] in your Amazon Web
1047
1063
  # Services account and Region.
1048
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
+ #
1049
1069
  # <note markdown="1"> KMS is replacing the term *customer master key (CMK)* with *KMS key*
1050
1070
  # and *KMS key*. The concept has not changed. To prevent breaking
1051
1071
  # changes, KMS is keeping some variations of this term.
1052
1072
  #
1053
1073
  # </note>
1054
1074
  #
1055
- # You can use the `CreateKey` operation to create symmetric or
1056
- # asymmetric KMS keys.
1075
+ # To create different types of KMS keys, use the following guidance:
1076
+ #
1077
+ # Symmetric encryption KMS key
1057
1078
  #
1058
- # * **Symmetric KMS keys** contain a 256-bit symmetric key that never
1059
- # leaves KMS unencrypted. To use the KMS key, you must call KMS. You
1060
- # can use a symmetric KMS key to encrypt and decrypt small amounts of
1061
- # data, but they are typically used to generate [data keys][2] and
1062
- # [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
1063
1091
  # GenerateDataKeyPair.
1064
1092
  #
1065
- # * **Asymmetric KMS keys** can contain an RSA key pair or an Elliptic
1066
- # Curve (ECC) key pair. The private key in an asymmetric KMS key never
1067
- # leaves KMS unencrypted. However, you can use the GetPublicKey
1068
- # operation to download the public key so it can be used outside of
1069
- # KMS. KMS keys with RSA key pairs can be used to encrypt or decrypt
1070
- # data or sign and verify messages (but not both). KMS keys with ECC
1071
- # key pairs can be used only to sign and verify messages.
1072
- #
1073
- # For information about symmetric and asymmetric KMS keys, see [Using
1074
- # Symmetric and Asymmetric KMS keys][4] in the *Key Management Service
1075
- # Developer Guide*.
1076
1093
  #
1077
- # To create different types of KMS keys, use the following guidance:
1078
1094
  #
1079
1095
  # Asymmetric KMS keys
1080
1096
  #
@@ -1084,14 +1100,37 @@ module Aws::KMS
1084
1100
  # to encrypt and decrypt or sign and verify. You can't change these
1085
1101
  # properties after the KMS key is created.
1086
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*.
1087
1112
  #
1088
1113
  #
1089
- # Symmetric KMS keys
1090
1114
  #
1091
- # : When creating a symmetric KMS key, you don't need to specify the
1092
- # `KeySpec` or `KeyUsage` parameters. The default value for `KeySpec`,
1093
- # `SYMMETRIC_DEFAULT`, and the default value for `KeyUsage`,
1094
- # `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*.
1095
1134
  #
1096
1135
  #
1097
1136
  #
@@ -1106,6 +1145,12 @@ module Aws::KMS
1106
1145
  # operation. To change a replica key to a primary key, and its primary
1107
1146
  # key to a replica key, use the UpdatePrimaryRegion operation.
1108
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
+ #
1109
1154
  # This operation supports *multi-Region keys*, an KMS feature that
1110
1155
  # lets you create multiple interoperable KMS keys in different Amazon
1111
1156
  # Web Services Regions. Because these KMS keys have the same key ID,
@@ -1113,57 +1158,57 @@ module Aws::KMS
1113
1158
  # to encrypt data in one Amazon Web Services Region and decrypt it in
1114
1159
  # a different Amazon Web Services Region without re-encrypting the
1115
1160
  # data or making a cross-Region call. For more information about
1116
- # 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
1117
1162
  # Management Service Developer Guide*.
1118
1163
  #
1119
- # You can create symmetric and asymmetric multi-Region keys and
1120
- # multi-Region keys with imported key material. You cannot create
1121
- # multi-Region keys in a custom key store.
1122
1164
  #
1123
1165
  #
1124
- #
1125
- # : To import your own key material, begin by creating a symmetric KMS
1126
- # key with no key material. To do this, use the `Origin` parameter of
1127
- # `CreateKey` with a value of `EXTERNAL`. Next, use
1128
- # 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
1129
1170
  # token, and use the public key to encrypt your key material. Then,
1130
1171
  # use ImportKeyMaterial with your import token to import the key
1131
1172
  # material. For step-by-step instructions, see [Importing Key
1132
- # Material][6] in the <i> <i>Key Management Service Developer
1133
- # Guide</i> </i>. You cannot import the key material into an
1134
- # 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.
1135
1179
  #
1136
1180
  # To create a multi-Region primary key with imported key material, use
1137
1181
  # the `Origin` parameter of `CreateKey` with a value of `EXTERNAL` and
1138
1182
  # the `MultiRegion` parameter with a value of `True`. To create
1139
1183
  # replicas of the multi-Region primary key, use the ReplicateKey
1140
- # operation. For more information about multi-Region keys, see [Using
1141
- # multi-Region keys][5] in the *Key Management Service Developer
1142
- # 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*.
1143
1187
  #
1144
1188
  #
1145
1189
  #
1146
1190
  # Custom key store
1147
1191
  #
1148
- # : To create a symmetric KMS key in a [custom key store][7], use the
1149
- # `CustomKeyStoreId` parameter to specify the custom key store. You
1150
- # must also use the `Origin` parameter with a value of `AWS_CLOUDHSM`.
1151
- # The CloudHSM cluster that is associated with the custom key store
1152
- # must have at least two active HSMs in different Availability Zones
1153
- # 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.
1154
1198
  #
1155
- # You cannot create an asymmetric KMS key in a custom key store. For
1156
- # information about custom key stores in KMS see [Using Custom Key
1157
- # Stores][7] in the <i> <i>Key Management Service Developer Guide</i>
1158
- # </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>.
1159
1204
  #
1160
1205
  # **Cross-account use**\: No. You cannot use this operation to create a
1161
1206
  # KMS key in a different Amazon Web Services account.
1162
1207
  #
1163
- # **Required permissions**\: [kms:CreateKey][8] (IAM policy). To use the
1164
- # `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
1165
1210
  # information about related permissions, see [Allow a user to create KMS
1166
- # keys][9] in the *Key Management Service Developer Guide*.
1211
+ # keys][8] in the *Key Management Service Developer Guide*.
1167
1212
  #
1168
1213
  # **Related operations:**
1169
1214
  #
@@ -1176,14 +1221,13 @@ module Aws::KMS
1176
1221
  #
1177
1222
  #
1178
1223
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms-keys
1179
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
1180
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs
1181
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html
1182
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
1183
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
1184
- # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
1185
- # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
1186
- # [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
1187
1231
  #
1188
1232
  # @option params [String] :policy
1189
1233
  # The key policy to attach to the KMS key.
@@ -1238,14 +1282,17 @@ module Aws::KMS
1238
1282
  # @option params [String] :key_usage
1239
1283
  # Determines the [cryptographic operations][1] for which you can use the
1240
1284
  # KMS key. The default value is `ENCRYPT_DECRYPT`. This parameter is
1241
- # required only for asymmetric KMS keys. You can't change the
1242
- # `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.
1243
1288
  #
1244
1289
  # Select only one valid value.
1245
1290
  #
1246
- # * For symmetric KMS keys, omit the parameter or specify
1291
+ # * For symmetric encryption KMS keys, omit the parameter or specify
1247
1292
  # `ENCRYPT_DECRYPT`.
1248
1293
  #
1294
+ # * For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
1295
+ #
1249
1296
  # * For asymmetric KMS keys with RSA key material, specify
1250
1297
  # `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1251
1298
  #
@@ -1268,32 +1315,40 @@ module Aws::KMS
1268
1315
  # Specifies the type of KMS key to create. The default value,
1269
1316
  # `SYMMETRIC_DEFAULT`, creates a KMS key with a 256-bit symmetric key
1270
1317
  # for encryption and decryption. For help choosing a key spec for your
1271
- # KMS key, see [How to Choose Your KMS key Configuration][1] in the <i>
1272
- # <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>.
1273
1320
  #
1274
1321
  # The `KeySpec` determines whether the KMS key contains a symmetric key
1275
- # or an asymmetric key pair. It also determines the encryption
1276
- # algorithms or signing algorithms that the KMS key supports. You can't
1277
- # change the `KeySpec` after the KMS key is created. To further restrict
1278
- # the algorithms that can be used with the KMS key, use a condition key
1279
- # in its key policy or IAM policy. For more information, see
1280
- # [kms:EncryptionAlgorithm][2] or [kms:Signing Algorithm][3] in the <i>
1281
- # <i>Key Management Service Developer Guide</i> </i>.
1282
- #
1283
- # [Amazon Web Services services that are integrated with KMS][4] use
1284
- # symmetric KMS keys to protect your data. These services do not support
1285
- # asymmetric KMS keys. For help determining whether a KMS key is
1286
- # symmetric or asymmetric, see [Identifying Symmetric and Asymmetric KMS
1287
- # 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.
1288
1333
  #
1289
1334
  # KMS supports the following key specs for KMS keys:
1290
1335
  #
1291
- # * Symmetric key (default)
1336
+ # * Symmetric encryption key (default)
1292
1337
  #
1293
1338
  # * `SYMMETRIC_DEFAULT` (AES-256-GCM)
1294
1339
  #
1295
1340
  # ^
1296
1341
  #
1342
+ # * HMAC keys (symmetric)
1343
+ #
1344
+ # * `HMAC_224`
1345
+ #
1346
+ # * `HMAC_256`
1347
+ #
1348
+ # * `HMAC_384`
1349
+ #
1350
+ # * `HMAC_512`
1351
+ #
1297
1352
  # * Asymmetric RSA key pairs
1298
1353
  #
1299
1354
  # * `RSA_2048`
@@ -1318,11 +1373,11 @@ module Aws::KMS
1318
1373
  #
1319
1374
  #
1320
1375
  #
1321
- # [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
1322
1377
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm
1323
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm
1324
- # [4]: http://aws.amazon.com/kms/features/#AWS_Service_Integration
1325
- # [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
1326
1381
  #
1327
1382
  # @option params [String] :origin
1328
1383
  # The source of the key material for the KMS key. You cannot change the
@@ -1333,13 +1388,13 @@ module Aws::KMS
1333
1388
  # set the value to `EXTERNAL`. For more information about importing key
1334
1389
  # material into KMS, see [Importing Key Material][1] in the *Key
1335
1390
  # Management Service Developer Guide*. This value is valid only for
1336
- # symmetric KMS keys.
1391
+ # symmetric encryption KMS keys.
1337
1392
  #
1338
1393
  # To create a KMS key in an KMS [custom key store][2] and create its key
1339
1394
  # material in the associated CloudHSM cluster, set this value to
1340
1395
  # `AWS_CLOUDHSM`. You must also use the `CustomKeyStoreId` parameter to
1341
1396
  # identify the custom key store. This value is valid only for symmetric
1342
- # KMS keys.
1397
+ # encryption KMS keys.
1343
1398
  #
1344
1399
  #
1345
1400
  #
@@ -1354,9 +1409,9 @@ module Aws::KMS
1354
1409
  # the custom key store must have at least two active HSMs, each in a
1355
1410
  # different Availability Zone in the Region.
1356
1411
  #
1357
- # This parameter is valid only for symmetric KMS keys and regional KMS
1358
- # keys. You cannot create an asymmetric KMS key or a multi-Region key in
1359
- # 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.
1360
1415
  #
1361
1416
  # To find the ID of a custom key store, use the DescribeCustomKeyStores
1362
1417
  # operation.
@@ -1399,8 +1454,8 @@ module Aws::KMS
1399
1454
  # TagResource operation.
1400
1455
  #
1401
1456
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
1402
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
1403
- # Service Developer Guide*.
1457
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
1458
+ # Developer Guide*.
1404
1459
  #
1405
1460
  # </note>
1406
1461
  #
@@ -1440,7 +1495,7 @@ module Aws::KMS
1440
1495
  # encrypt data in one Amazon Web Services Region and decrypt it in a
1441
1496
  # different Amazon Web Services Region without re-encrypting the data or
1442
1497
  # making a cross-Region call. For more information about multi-Region
1443
- # 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
1444
1499
  # Developer Guide*.
1445
1500
  #
1446
1501
  # This value creates a *primary key*, not a replica. To create a
@@ -1661,14 +1716,46 @@ module Aws::KMS
1661
1716
  # }, # Detailed information about the KMS key that this operation creates.
1662
1717
  # }
1663
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
+ #
1664
1751
  # @example Request syntax with placeholder values
1665
1752
  #
1666
1753
  # resp = client.create_key({
1667
1754
  # policy: "PolicyType",
1668
1755
  # description: "DescriptionType",
1669
- # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT
1670
- # 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
1671
- # 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
1672
1759
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM
1673
1760
  # custom_key_store_id: "CustomKeyStoreIdType",
1674
1761
  # bypass_policy_lockout_safety_check: false,
@@ -1689,7 +1776,7 @@ module Aws::KMS
1689
1776
  # resp.key_metadata.creation_date #=> Time
1690
1777
  # resp.key_metadata.enabled #=> Boolean
1691
1778
  # resp.key_metadata.description #=> String
1692
- # 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"
1693
1780
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
1694
1781
  # resp.key_metadata.deletion_date #=> Time
1695
1782
  # resp.key_metadata.valid_to #=> Time
@@ -1698,8 +1785,8 @@ module Aws::KMS
1698
1785
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
1699
1786
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
1700
1787
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
1701
- # 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"
1702
- # 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"
1703
1790
  # resp.key_metadata.encryption_algorithms #=> Array
1704
1791
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
1705
1792
  # resp.key_metadata.signing_algorithms #=> Array
@@ -1712,6 +1799,8 @@ module Aws::KMS
1712
1799
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
1713
1800
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
1714
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"
1715
1804
  #
1716
1805
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey AWS API Documentation
1717
1806
  #
@@ -1736,29 +1825,30 @@ module Aws::KMS
1736
1825
  # * GenerateDataKeyPairWithoutPlaintext
1737
1826
  #
1738
1827
  # You can use this operation to decrypt ciphertext that was encrypted
1739
- # under a symmetric or asymmetric KMS key. When the KMS key is
1740
- # asymmetric, you must specify the KMS key and the encryption algorithm
1741
- # that was used to encrypt the ciphertext. For information about
1742
- # symmetric and asymmetric KMS keys, see [Using Symmetric and Asymmetric
1743
- # 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*.
1744
1833
  #
1745
- # The Decrypt operation also decrypts ciphertext that was encrypted
1834
+ # The `Decrypt` operation also decrypts ciphertext that was encrypted
1746
1835
  # outside of KMS by the public key in an KMS asymmetric KMS key.
1747
- # However, it cannot decrypt ciphertext produced by other libraries,
1748
- # such as the [Amazon Web Services Encryption SDK][2] or [Amazon S3
1749
- # client-side encryption][3]. These libraries return a ciphertext format
1750
- # that is incompatible with KMS.
1751
- #
1752
- # If the ciphertext was encrypted under a symmetric KMS key, the `KeyId`
1753
- # parameter is optional. KMS can get this information from metadata that
1754
- # it adds to the symmetric ciphertext blob. This feature adds durability
1755
- # to your implementation by ensuring that authorized users can decrypt
1756
- # ciphertext decades after it was encrypted, even if they've lost track
1757
- # of the key ID. However, specifying the KMS key is always recommended
1758
- # as a best practice. When you use the `KeyId` parameter to specify a
1759
- # KMS key, KMS only uses the KMS key you specify. If the ciphertext was
1760
- # encrypted under a different KMS key, the `Decrypt` operation fails.
1761
- # 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.
1762
1852
  #
1763
1853
  # Whenever possible, use key policies to give users permission to call
1764
1854
  # the `Decrypt` operation on a particular KMS key, instead of using IAM
@@ -1777,8 +1867,8 @@ module Aws::KMS
1777
1867
  # Service Developer Guide*.
1778
1868
  #
1779
1869
  # The KMS key that you use for this operation must be in a compatible
1780
- # key state. For details, see [Key state: Effect on your KMS key][7] in
1781
- # 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*.
1782
1872
  #
1783
1873
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
1784
1874
  # in a different Amazon Web Services account, specify the key ARN or
@@ -1813,17 +1903,19 @@ module Aws::KMS
1813
1903
  # @option params [Hash<String,String>] :encryption_context
1814
1904
  # Specifies the encryption context to use when decrypting the data. An
1815
1905
  # encryption context is valid only for [cryptographic operations][1]
1816
- # with a symmetric KMS key. The standard asymmetric encryption
1817
- # 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.
1818
1909
  #
1819
1910
  # An *encryption context* is a collection of non-secret key-value pairs
1820
- # that represents additional authenticated data. When you use an
1911
+ # that represent additional authenticated data. When you use an
1821
1912
  # encryption context to encrypt data, you must specify the same (an
1822
1913
  # exact case-sensitive match) encryption context to decrypt the data. An
1823
- # encryption context is optional when encrypting with a symmetric KMS
1824
- # 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.
1825
1917
  #
1826
- # For more information, see [Encryption Context][2] in the *Key
1918
+ # For more information, see [Encryption context][2] in the *Key
1827
1919
  # Management Service Developer Guide*.
1828
1920
  #
1829
1921
  #
@@ -1845,14 +1937,18 @@ module Aws::KMS
1845
1937
  # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
1846
1938
  #
1847
1939
  # @option params [String] :key_id
1848
- # Specifies the KMS key that KMS uses to decrypt the ciphertext. Enter a
1849
- # 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`.
1850
1945
  #
1851
1946
  # This parameter is required only when the ciphertext was encrypted
1852
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
1853
- # get the KMS key from metadata that it adds to the symmetric ciphertext
1854
- # blob. However, it is always recommended as a best practice. This
1855
- # 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.
1856
1952
  #
1857
1953
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
1858
1954
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -1882,7 +1978,7 @@ module Aws::KMS
1882
1978
  # This parameter is required only when the ciphertext was encrypted
1883
1979
  # under an asymmetric KMS key. The default value, `SYMMETRIC_DEFAULT`,
1884
1980
  # represents the only supported algorithm that is valid for symmetric
1885
- # KMS keys.
1981
+ # encryption KMS keys.
1886
1982
  #
1887
1983
  # @return [Types::DecryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1888
1984
  #
@@ -1936,8 +2032,8 @@ module Aws::KMS
1936
2032
  # Deletes the specified alias.
1937
2033
  #
1938
2034
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
1939
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
1940
- # Management Service Developer Guide*.
2035
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
2036
+ # Service Developer Guide*.
1941
2037
  #
1942
2038
  # </note>
1943
2039
  #
@@ -2112,8 +2208,8 @@ module Aws::KMS
2112
2208
  # reimport the same key material into the KMS key.
2113
2209
  #
2114
2210
  # The KMS key that you use for this operation must be in a compatible
2115
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2116
- # 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*.
2117
2213
  #
2118
2214
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2119
2215
  # key in a different Amazon Web Services account.
@@ -2339,14 +2435,13 @@ module Aws::KMS
2339
2435
  # This detailed information includes the key ARN, creation date (and
2340
2436
  # deletion date, if applicable), the key state, and the origin and
2341
2437
  # expiration date (if any) of the key material. It includes fields, like
2342
- # `KeySpec`, that help you distinguish symmetric from asymmetric KMS
2343
- # keys. It also provides information that is particularly important to
2344
- # asymmetric keys, such as the key usage (encryption or signing) and the
2345
- # encryption algorithms or signing algorithms that the KMS key supports.
2346
- # For KMS keys in custom key stores, it includes information about the
2347
- # custom key store, such as the key store ID and the CloudHSM cluster
2348
- # ID. For multi-Region keys, it displays the primary key and all related
2349
- # 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.
2350
2445
  #
2351
2446
  # `DescribeKey` does not return the following information:
2352
2447
  #
@@ -2364,11 +2459,10 @@ module Aws::KMS
2364
2459
  # * Key policies and grants on the KMS key. To get this information, use
2365
2460
  # GetKeyPolicy and ListGrants.
2366
2461
  #
2367
- # If you call the `DescribeKey` operation on a *predefined Amazon Web
2368
- # Services alias*, that is, an Amazon Web Services alias with no key ID,
2369
- # KMS creates an [Amazon Web Services managed key][2]. Then, it
2370
- # associates the alias with the new KMS key, and returns the `KeyId` and
2371
- # `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.
2372
2466
  #
2373
2467
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2374
2468
  # in a different Amazon Web Services account, specify the key ARN or
@@ -2450,10 +2544,10 @@ module Aws::KMS
2450
2544
  #
2451
2545
  # @example Example: To get details about a KMS key
2452
2546
  #
2453
- # # The following example gets metadata about a symmetric KMS key.
2547
+ # # The following example gets metadata for a symmetric encryption KMS key.
2454
2548
  #
2455
2549
  # resp = client.describe_key({
2456
- # 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.
2457
2551
  # })
2458
2552
  #
2459
2553
  # resp.to_h outputs the following:
@@ -2478,6 +2572,121 @@ module Aws::KMS
2478
2572
  # }, # An object that contains information about the specified KMS key.
2479
2573
  # }
2480
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
+ #
2481
2690
  # @example Request syntax with placeholder values
2482
2691
  #
2483
2692
  # resp = client.describe_key({
@@ -2493,7 +2702,7 @@ module Aws::KMS
2493
2702
  # resp.key_metadata.creation_date #=> Time
2494
2703
  # resp.key_metadata.enabled #=> Boolean
2495
2704
  # resp.key_metadata.description #=> String
2496
- # 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"
2497
2706
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
2498
2707
  # resp.key_metadata.deletion_date #=> Time
2499
2708
  # resp.key_metadata.valid_to #=> Time
@@ -2502,8 +2711,8 @@ module Aws::KMS
2502
2711
  # resp.key_metadata.cloud_hsm_cluster_id #=> String
2503
2712
  # resp.key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
2504
2713
  # resp.key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
2505
- # 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"
2506
- # 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"
2507
2716
  # resp.key_metadata.encryption_algorithms #=> Array
2508
2717
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
2509
2718
  # resp.key_metadata.signing_algorithms #=> Array
@@ -2516,6 +2725,8 @@ module Aws::KMS
2516
2725
  # resp.key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
2517
2726
  # resp.key_metadata.multi_region_configuration.replica_keys[0].region #=> String
2518
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"
2519
2730
  #
2520
2731
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey AWS API Documentation
2521
2732
  #
@@ -2530,12 +2741,12 @@ module Aws::KMS
2530
2741
  # prevents use of the KMS key for [cryptographic operations][1].
2531
2742
  #
2532
2743
  # For more information about how key state affects the use of a KMS key,
2533
- # see [Key state: Effect on your KMS key][2] in the <i> <i>Key
2534
- # 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>.
2535
2746
  #
2536
2747
  # The KMS key that you use for this operation must be in a compatible
2537
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2538
- # 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*.
2539
2750
  #
2540
2751
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2541
2752
  # key in a different Amazon Web Services account.
@@ -2592,21 +2803,22 @@ module Aws::KMS
2592
2803
  end
2593
2804
 
2594
2805
  # Disables [automatic rotation of the key material][1] for the specified
2595
- # symmetric KMS key.
2806
+ # symmetric encryption KMS key.
2596
2807
  #
2597
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2598
- # keys with [imported key material][3], or KMS keys in a [custom key
2599
- # store][4]. To enable or disable automatic rotation of a set of related
2600
- # [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.
2601
2813
  #
2602
2814
  # The KMS key that you use for this operation must be in a compatible
2603
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2604
- # 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*.
2605
2817
  #
2606
2818
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2607
2819
  # key in a different Amazon Web Services account.
2608
2820
  #
2609
- # **Required permissions**\: [kms:DisableKeyRotation][7] (key policy)
2821
+ # **Required permissions**\: [kms:DisableKeyRotation][8] (key policy)
2610
2822
  #
2611
2823
  # **Related operations:**
2612
2824
  #
@@ -2617,17 +2829,19 @@ module Aws::KMS
2617
2829
  #
2618
2830
  #
2619
2831
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2620
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2621
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2622
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2623
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2624
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2625
- # [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
2626
2839
  #
2627
2840
  # @option params [required, String] :key_id
2628
- # Identifies a symmetric KMS key. You cannot enable or disable automatic
2629
- # rotation of [asymmetric KMS keys][1], KMS keys with [imported key
2630
- # 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].
2631
2845
  #
2632
2846
  # Specify the key ID or key ARN of the KMS key.
2633
2847
  #
@@ -2644,8 +2858,9 @@ module Aws::KMS
2644
2858
  #
2645
2859
  #
2646
2860
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks
2647
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2648
- # [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
2649
2864
  #
2650
2865
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2651
2866
  #
@@ -2763,8 +2978,8 @@ module Aws::KMS
2763
2978
  # KMS key for [cryptographic operations][1].
2764
2979
  #
2765
2980
  # The KMS key that you use for this operation must be in a compatible
2766
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2767
- # 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*.
2768
2983
  #
2769
2984
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2770
2985
  # key in a different Amazon Web Services account.
@@ -2821,21 +3036,22 @@ module Aws::KMS
2821
3036
  end
2822
3037
 
2823
3038
  # Enables [automatic rotation of the key material][1] for the specified
2824
- # symmetric KMS key.
3039
+ # symmetric encryption KMS key.
2825
3040
  #
2826
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
2827
- # keys with [imported key material][3], or KMS keys in a [custom key
2828
- # store][4]. To enable or disable automatic rotation of a set of related
2829
- # [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.
2830
3046
  #
2831
3047
  # The KMS key that you use for this operation must be in a compatible
2832
- # key state. For details, see [Key state: Effect on your KMS key][6] in
2833
- # 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*.
2834
3050
  #
2835
3051
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
2836
3052
  # key in a different Amazon Web Services account.
2837
3053
  #
2838
- # **Required permissions**\: [kms:EnableKeyRotation][7] (key policy)
3054
+ # **Required permissions**\: [kms:EnableKeyRotation][8] (key policy)
2839
3055
  #
2840
3056
  # **Related operations:**
2841
3057
  #
@@ -2846,19 +3062,20 @@ module Aws::KMS
2846
3062
  #
2847
3063
  #
2848
3064
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
2849
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2850
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2851
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2852
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
2853
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
2854
- # [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
2855
3072
  #
2856
3073
  # @option params [required, String] :key_id
2857
- # Identifies a symmetric KMS key. You cannot enable automatic rotation
2858
- # of [asymmetric KMS keys][1], KMS keys with [imported key material][2],
2859
- # or KMS keys in a [custom key store][3]. To enable or disable automatic
2860
- # rotation of a set of related [multi-Region keys][4], set the property
2861
- # 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.
2862
3079
  #
2863
3080
  # Specify the key ID or key ARN of the KMS key.
2864
3081
  #
@@ -2874,10 +3091,11 @@ module Aws::KMS
2874
3091
  #
2875
3092
  #
2876
3093
  #
2877
- # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
2878
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
2879
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
2880
- # [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
2881
3099
  #
2882
3100
  # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
2883
3101
  #
@@ -2905,36 +3123,22 @@ module Aws::KMS
2905
3123
  req.send_request(options)
2906
3124
  end
2907
3125
 
2908
- # Encrypts plaintext into ciphertext by using a KMS key. The `Encrypt`
2909
- # operation has two primary use cases:
2910
- #
2911
- # * You can encrypt small amounts of arbitrary data, such as a personal
2912
- # identifier or database password, or other sensitive information.
2913
- #
2914
- # * You can use the `Encrypt` operation to move encrypted data from one
2915
- # Amazon Web Services Region to another. For example, in Region A,
2916
- # generate a data key and use the plaintext key to encrypt your data.
2917
- # Then, in Region A, use the `Encrypt` operation to encrypt the
2918
- # plaintext data key under a KMS key in Region B. Now, you can move
2919
- # the encrypted data and the encrypted data key to Region B. When
2920
- # necessary, you can decrypt the encrypted data key and the encrypted
2921
- # data entirely within in Region B.
2922
- #
2923
- # You don't need to use the `Encrypt` operation to encrypt a data key.
2924
- # The GenerateDataKey and GenerateDataKeyPair operations return a
2925
- # plaintext data key and an encrypted copy of that data key.
2926
- #
2927
- # When you encrypt data, you must specify a symmetric or asymmetric KMS
2928
- # key to use in the encryption operation. The KMS key must have a
2929
- # `KeyUsage` value of `ENCRYPT_DECRYPT.` To find the `KeyUsage` of a KMS
2930
- # key, use the DescribeKey operation.
2931
- #
2932
- # If you use a symmetric KMS key, you can use an encryption context to
2933
- # add additional security to your encryption operation. If you specify
2934
- # an `EncryptionContext` when encrypting data, you must specify the same
2935
- # encryption context (a case-sensitive exact match) when decrypting the
2936
- # data. Otherwise, the request to decrypt fails with an
2937
- # `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
2938
3142
  # Context][1] in the *Key Management Service Developer Guide*.
2939
3143
  #
2940
3144
  # If you specify an asymmetric KMS key, you must also specify the
@@ -2949,15 +3153,15 @@ module Aws::KMS
2949
3153
  # fails.
2950
3154
  #
2951
3155
  # You are not required to supply the key ID and encryption algorithm
2952
- # when you decrypt with symmetric KMS keys because KMS stores this
2953
- # 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
2954
3158
  # ciphertext generated with asymmetric keys. The standard format for
2955
3159
  # asymmetric key ciphertext does not include configurable fields.
2956
3160
  #
2957
3161
  # The maximum size of the data that you can encrypt varies with the type
2958
3162
  # of KMS key and the encryption algorithm that you choose.
2959
3163
  #
2960
- # * Symmetric KMS keys
3164
+ # * Symmetric encryption KMS keys
2961
3165
  #
2962
3166
  # * `SYMMETRIC_DEFAULT`\: 4096 bytes
2963
3167
  #
@@ -2982,8 +3186,8 @@ module Aws::KMS
2982
3186
  # * `RSAES_OAEP_SHA_256`\: 446 bytes
2983
3187
  #
2984
3188
  # The KMS key that you use for this operation must be in a compatible
2985
- # key state. For details, see [Key state: Effect on your KMS key][2] in
2986
- # 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*.
2987
3191
  #
2988
3192
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
2989
3193
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3006,7 +3210,9 @@ module Aws::KMS
3006
3210
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3007
3211
  #
3008
3212
  # @option params [required, String] :key_id
3009
- # 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.
3010
3216
  #
3011
3217
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3012
3218
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3033,18 +3239,19 @@ module Aws::KMS
3033
3239
  # @option params [Hash<String,String>] :encryption_context
3034
3240
  # Specifies the encryption context that will be used to encrypt the
3035
3241
  # data. An encryption context is valid only for [cryptographic
3036
- # operations][1] with a symmetric KMS key. The standard asymmetric
3037
- # encryption algorithms that KMS uses do not support an encryption
3038
- # 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.
3039
3245
  #
3040
3246
  # An *encryption context* is a collection of non-secret key-value pairs
3041
- # that represents additional authenticated data. When you use an
3247
+ # that represent additional authenticated data. When you use an
3042
3248
  # encryption context to encrypt data, you must specify the same (an
3043
3249
  # exact case-sensitive match) encryption context to decrypt the data. An
3044
- # encryption context is optional when encrypting with a symmetric KMS
3045
- # 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.
3046
3253
  #
3047
- # For more information, see [Encryption Context][2] in the *Key
3254
+ # For more information, see [Encryption context][2] in the *Key
3048
3255
  # Management Service Developer Guide*.
3049
3256
  #
3050
3257
  #
@@ -3071,9 +3278,9 @@ module Aws::KMS
3071
3278
  # that you specify.
3072
3279
  #
3073
3280
  # This parameter is required only for asymmetric KMS keys. The default
3074
- # value, `SYMMETRIC_DEFAULT`, is the algorithm used for symmetric KMS
3075
- # keys. If you are using an asymmetric KMS key, we recommend
3076
- # 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.
3077
3284
  #
3078
3285
  # @return [Types::EncryptResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3079
3286
  #
@@ -3124,19 +3331,17 @@ module Aws::KMS
3124
3331
  req.send_request(options)
3125
3332
  end
3126
3333
 
3127
- # Generates a unique symmetric data key for client-side encryption. This
3334
+ # Returns a unique symmetric data key for use outside of KMS. This
3128
3335
  # operation returns a plaintext copy of the data key and a copy that is
3129
- # encrypted under a KMS key that you specify. You can use the plaintext
3130
- # key to encrypt your data outside of KMS and store the encrypted data
3131
- # key with the encrypted data.
3132
- #
3133
- # `GenerateDataKey` returns a unique data key for each request. The
3134
- # bytes in the plaintext key are not related to the caller or the KMS
3135
- # key.
3136
- #
3137
- # To generate a data key, specify the symmetric KMS key that will be
3138
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3139
- # 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
3140
3345
  # DescribeKey operation. You must also specify the length of the data
3141
3346
  # key. Use either the `KeySpec` or `NumberOfBytes` parameters (but not
3142
3347
  # both). For 128-bit and 256-bit data keys, use the `KeySpec` parameter.
@@ -3147,7 +3352,7 @@ module Aws::KMS
3147
3352
  # GenerateDataKeyPairWithoutPlaintext operation. To get a
3148
3353
  # cryptographically secure random byte string, use GenerateRandom.
3149
3354
  #
3150
- # You can use the optional encryption context to add additional security
3355
+ # You can use an optional encryption context to add additional security
3151
3356
  # to the encryption operation. If you specify an `EncryptionContext`,
3152
3357
  # you must specify the same encryption context (a case-sensitive exact
3153
3358
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3162,8 +3367,8 @@ module Aws::KMS
3162
3367
  # Service Developer Guide*.
3163
3368
  #
3164
3369
  # The KMS key that you use for this operation must be in a compatible
3165
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3166
- # 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*.
3167
3372
  #
3168
3373
  # **How to use your data key**
3169
3374
  #
@@ -3222,7 +3427,10 @@ module Aws::KMS
3222
3427
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3223
3428
  #
3224
3429
  # @option params [required, String] :key_id
3225
- # 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.
3226
3434
  #
3227
3435
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3228
3436
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3248,13 +3456,14 @@ module Aws::KMS
3248
3456
  # data key.
3249
3457
  #
3250
3458
  # An *encryption context* is a collection of non-secret key-value pairs
3251
- # that represents additional authenticated data. When you use an
3459
+ # that represent additional authenticated data. When you use an
3252
3460
  # encryption context to encrypt data, you must specify the same (an
3253
3461
  # exact case-sensitive match) encryption context to decrypt the data. An
3254
- # encryption context is optional when encrypting with a symmetric KMS
3255
- # 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.
3256
3465
  #
3257
- # For more information, see [Encryption Context][1] in the *Key
3466
+ # For more information, see [Encryption context][1] in the *Key
3258
3467
  # Management Service Developer Guide*.
3259
3468
  #
3260
3469
  #
@@ -3342,11 +3551,13 @@ module Aws::KMS
3342
3551
  req.send_request(options)
3343
3552
  end
3344
3553
 
3345
- # Generates a unique asymmetric data key pair. The `GenerateDataKeyPair`
3554
+ # Returns a unique asymmetric data key pair for use outside of KMS. This
3346
3555
  # operation returns a plaintext public key, a plaintext private key, and
3347
- # a copy of the private key that is encrypted under the symmetric KMS
3348
- # key you specify. You can use the data key pair to perform asymmetric
3349
- # 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.
3350
3561
  #
3351
3562
  # You can use the public key that `GenerateDataKeyPair` returns to
3352
3563
  # encrypt data or verify a signature outside of KMS. Then, store the
@@ -3354,10 +3565,10 @@ module Aws::KMS
3354
3565
  # data or sign a message, you can use the Decrypt operation to decrypt
3355
3566
  # the encrypted private key.
3356
3567
  #
3357
- # To generate a data key pair, you must specify a symmetric KMS key to
3358
- # encrypt the private key in a data key pair. You cannot use an
3359
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3360
- # 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.
3361
3572
  #
3362
3573
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3363
3574
  # (ECC) data key pair. KMS recommends that your use ECC key pairs for
@@ -3375,13 +3586,13 @@ module Aws::KMS
3375
3586
  # to decrypt the encrypted private key in the data key pair.
3376
3587
  #
3377
3588
  # `GenerateDataKeyPair` returns a unique data key pair for each request.
3378
- # The bytes in the keys are not related to the caller or the KMS key
3379
- # that is used to encrypt the private key. The public key is a
3380
- # DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC 5280][1].
3381
- # The private key is a DER-encoded PKCS8 PrivateKeyInfo, as specified in
3382
- # [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].
3383
3594
  #
3384
- # You can use the optional encryption context to add additional security
3595
+ # You can use an optional encryption context to add additional security
3385
3596
  # to the encryption operation. If you specify an `EncryptionContext`,
3386
3597
  # you must specify the same encryption context (a case-sensitive exact
3387
3598
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3390,8 +3601,8 @@ module Aws::KMS
3390
3601
  # Service Developer Guide*.
3391
3602
  #
3392
3603
  # The KMS key that you use for this operation must be in a compatible
3393
- # key state. For details, see [Key state: Effect on your KMS key][4] in
3394
- # 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*.
3395
3606
  #
3396
3607
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3397
3608
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3424,13 +3635,14 @@ module Aws::KMS
3424
3635
  # private key in the data key pair.
3425
3636
  #
3426
3637
  # An *encryption context* is a collection of non-secret key-value pairs
3427
- # that represents additional authenticated data. When you use an
3638
+ # that represent additional authenticated data. When you use an
3428
3639
  # encryption context to encrypt data, you must specify the same (an
3429
3640
  # exact case-sensitive match) encryption context to decrypt the data. An
3430
- # encryption context is optional when encrypting with a symmetric KMS
3431
- # 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.
3432
3644
  #
3433
- # For more information, see [Encryption Context][1] in the *Key
3645
+ # For more information, see [Encryption context][1] in the *Key
3434
3646
  # Management Service Developer Guide*.
3435
3647
  #
3436
3648
  #
@@ -3438,10 +3650,10 @@ module Aws::KMS
3438
3650
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3439
3651
  #
3440
3652
  # @option params [required, String] :key_id
3441
- # Specifies the symmetric KMS key that encrypts the private key in the
3442
- # data key pair. You cannot specify an asymmetric KMS key or a KMS key
3443
- # in a custom key store. To get the type and origin of your KMS key, use
3444
- # 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.
3445
3657
  #
3446
3658
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3447
3659
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3495,16 +3707,16 @@ module Aws::KMS
3495
3707
  # @example Example: To generate an RSA key pair for encryption and decryption
3496
3708
  #
3497
3709
  # # This example generates an RSA data key pair for encryption and decryption. The operation returns a plaintext public key
3498
- # # 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.
3499
3711
  #
3500
3712
  # resp = client.generate_data_key_pair({
3501
- # 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.
3502
3714
  # key_pair_spec: "RSA_3072", # The requested key spec of the RSA data key pair.
3503
3715
  # })
3504
3716
  #
3505
3717
  # resp.to_h outputs the following:
3506
3718
  # {
3507
- # 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.
3508
3720
  # key_pair_spec: "RSA_3072", # The actual key spec of the RSA data key pair.
3509
3721
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the RSA data key pair.
3510
3722
  # private_key_plaintext: "<binary data>", # The plaintext private key of the RSA data key pair.
@@ -3539,11 +3751,12 @@ module Aws::KMS
3539
3751
  req.send_request(options)
3540
3752
  end
3541
3753
 
3542
- # Generates a unique asymmetric data key pair. The
3543
- # `GenerateDataKeyPairWithoutPlaintext` operation returns a plaintext
3544
- # public key and a copy of the private key that is encrypted under the
3545
- # symmetric KMS key you specify. Unlike GenerateDataKeyPair, this
3546
- # 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.
3547
3760
  #
3548
3761
  # You can use the public key that `GenerateDataKeyPairWithoutPlaintext`
3549
3762
  # returns to encrypt data or verify a signature outside of KMS. Then,
@@ -3551,10 +3764,10 @@ module Aws::KMS
3551
3764
  # decrypt data or sign a message, you can use the Decrypt operation to
3552
3765
  # decrypt the encrypted private key.
3553
3766
  #
3554
- # To generate a data key pair, you must specify a symmetric KMS key to
3555
- # encrypt the private key in a data key pair. You cannot use an
3556
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3557
- # 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.
3558
3771
  #
3559
3772
  # Use the `KeyPairSpec` parameter to choose an RSA or Elliptic Curve
3560
3773
  # (ECC) data key pair. KMS recommends that your use ECC key pairs for
@@ -3568,7 +3781,7 @@ module Aws::KMS
3568
3781
  # a DER-encoded X.509 SubjectPublicKeyInfo, as specified in [RFC
3569
3782
  # 5280][1].
3570
3783
  #
3571
- # You can use the optional encryption context to add additional security
3784
+ # You can use an optional encryption context to add additional security
3572
3785
  # to the encryption operation. If you specify an `EncryptionContext`,
3573
3786
  # you must specify the same encryption context (a case-sensitive exact
3574
3787
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3577,8 +3790,8 @@ module Aws::KMS
3577
3790
  # Service Developer Guide*.
3578
3791
  #
3579
3792
  # The KMS key that you use for this operation must be in a compatible
3580
- # key state. For details, see [Key state: Effect on your KMS key][3] in
3581
- # 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*.
3582
3795
  #
3583
3796
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3584
3797
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3611,13 +3824,14 @@ module Aws::KMS
3611
3824
  # private key in the data key pair.
3612
3825
  #
3613
3826
  # An *encryption context* is a collection of non-secret key-value pairs
3614
- # that represents additional authenticated data. When you use an
3827
+ # that represent additional authenticated data. When you use an
3615
3828
  # encryption context to encrypt data, you must specify the same (an
3616
3829
  # exact case-sensitive match) encryption context to decrypt the data. An
3617
- # encryption context is optional when encrypting with a symmetric KMS
3618
- # 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.
3619
3833
  #
3620
- # For more information, see [Encryption Context][1] in the *Key
3834
+ # For more information, see [Encryption context][1] in the *Key
3621
3835
  # Management Service Developer Guide*.
3622
3836
  #
3623
3837
  #
@@ -3625,10 +3839,10 @@ module Aws::KMS
3625
3839
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context
3626
3840
  #
3627
3841
  # @option params [required, String] :key_id
3628
- # Specifies the KMS key that encrypts the private key in the data key
3629
- # pair. You must specify a symmetric KMS key. You cannot use an
3630
- # asymmetric KMS key or a KMS key in a custom key store. To get the type
3631
- # 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.
3632
3846
  #
3633
3847
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3634
3848
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3681,16 +3895,16 @@ module Aws::KMS
3681
3895
  # @example Example: To generate an asymmetric data key pair without a plaintext key
3682
3896
  #
3683
3897
  # # This example returns an asymmetric elliptic curve (ECC) data key pair. The private key is encrypted under the symmetric
3684
- # # 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.
3685
3899
  #
3686
3900
  # resp = client.generate_data_key_pair_without_plaintext({
3687
- # 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.
3688
3902
  # key_pair_spec: "ECC_NIST_P521", # The requested key spec of the ECC asymmetric data key pair.
3689
3903
  # })
3690
3904
  #
3691
3905
  # resp.to_h outputs the following:
3692
3906
  # {
3693
- # 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.
3694
3908
  # key_pair_spec: "ECC_NIST_P521", # The actual key spec of the ECC asymmetric data key pair.
3695
3909
  # private_key_ciphertext_blob: "<binary data>", # The encrypted private key of the asymmetric ECC data key pair.
3696
3910
  # public_key: "<binary data>", # The public key (plaintext).
@@ -3723,40 +3937,40 @@ module Aws::KMS
3723
3937
  req.send_request(options)
3724
3938
  end
3725
3939
 
3726
- # Generates a unique symmetric data key. This operation returns a data
3727
- # key that is encrypted under a KMS key that you specify. To request an
3728
- # asymmetric data key pair, use the GenerateDataKeyPair or
3729
- # 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.
3730
3944
  #
3731
3945
  # `GenerateDataKeyWithoutPlaintext` is identical to the GenerateDataKey
3732
- # 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
+ #
3733
3949
  # This operation is useful for systems that need to encrypt data at some
3734
3950
  # point, but not immediately. When you need to encrypt the data, you
3735
- # call the Decrypt operation on the encrypted copy of the key.
3736
- #
3737
- # It's also useful in distributed systems with different levels of
3738
- # trust. For example, you might store encrypted data in containers. One
3739
- # component of your system creates new containers and stores an
3740
- # encrypted data key with each container. Then, a different component
3741
- # puts the data into the containers. That component first decrypts the
3742
- # data key, uses the plaintext data key to encrypt data, puts the
3743
- # encrypted data into the container, and then destroys the plaintext
3744
- # data key. In this system, the component that creates the containers
3745
- # never sees the plaintext data key.
3746
- #
3747
- # `GenerateDataKeyWithoutPlaintext` returns a unique data key for each
3748
- # request. The bytes in the keys are not related to the caller or KMS
3749
- # key that is used to encrypt the private key.
3750
- #
3751
- # To generate a data key, you must specify the symmetric KMS key that is
3752
- # used to encrypt the data key. You cannot use an asymmetric KMS key to
3753
- # generate a data key. To get the type of your KMS key, use the
3754
- # 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.
3755
3969
  #
3756
3970
  # If the operation succeeds, you will find the encrypted copy of the
3757
3971
  # data key in the `CiphertextBlob` field.
3758
3972
  #
3759
- # You can use the optional encryption context to add additional security
3973
+ # You can use an optional encryption context to add additional security
3760
3974
  # to the encryption operation. If you specify an `EncryptionContext`,
3761
3975
  # you must specify the same encryption context (a case-sensitive exact
3762
3976
  # match) when decrypting the encrypted data key. Otherwise, the request
@@ -3765,8 +3979,8 @@ module Aws::KMS
3765
3979
  # Service Developer Guide*.
3766
3980
  #
3767
3981
  # The KMS key that you use for this operation must be in a compatible
3768
- # key state. For details, see [Key state: Effect on your KMS key][2] in
3769
- # 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*.
3770
3984
  #
3771
3985
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
3772
3986
  # in a different Amazon Web Services account, specify the key ARN or
@@ -3794,7 +4008,10 @@ module Aws::KMS
3794
4008
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3795
4009
  #
3796
4010
  # @option params [required, String] :key_id
3797
- # 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.
3798
4015
  #
3799
4016
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3800
4017
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -3820,13 +4037,14 @@ module Aws::KMS
3820
4037
  # data key.
3821
4038
  #
3822
4039
  # An *encryption context* is a collection of non-secret key-value pairs
3823
- # that represents additional authenticated data. When you use an
4040
+ # that represent additional authenticated data. When you use an
3824
4041
  # encryption context to encrypt data, you must specify the same (an
3825
4042
  # exact case-sensitive match) encryption context to decrypt the data. An
3826
- # encryption context is optional when encrypting with a symmetric KMS
3827
- # 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.
3828
4046
  #
3829
- # For more information, see [Encryption Context][1] in the *Key
4047
+ # For more information, see [Encryption context][1] in the *Key
3830
4048
  # Management Service Developer Guide*.
3831
4049
  #
3832
4050
  #
@@ -3904,6 +4122,126 @@ module Aws::KMS
3904
4122
  req.send_request(options)
3905
4123
  end
3906
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
+
3907
4245
  # Returns a random byte string that is cryptographically secure.
3908
4246
  #
3909
4247
  # By default, the random byte string is generated in KMS. To generate
@@ -4053,15 +4391,16 @@ module Aws::KMS
4053
4391
  # Gets a Boolean value that indicates whether [automatic rotation of the
4054
4392
  # key material][1] is enabled for the specified KMS key.
4055
4393
  #
4056
- # You cannot enable automatic rotation of [asymmetric KMS keys][2], KMS
4057
- # keys with [imported key material][3], or KMS keys in a [custom key
4058
- # store][4]. To enable or disable automatic rotation of a set of related
4059
- # [multi-Region keys][5], set the property on the primary key. The key
4060
- # 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`.
4061
4400
  #
4062
4401
  # The KMS key that you use for this operation must be in a compatible
4063
- # key state. For details, see [Key state: Effect on your KMS key][6] in
4064
- # 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*.
4065
4404
  #
4066
4405
  # * Disabled: The key rotation status does not change when you disable a
4067
4406
  # KMS key. However, while the KMS key is disabled, KMS does not rotate
@@ -4076,7 +4415,7 @@ module Aws::KMS
4076
4415
  # a different Amazon Web Services account, specify the key ARN in the
4077
4416
  # value of the `KeyId` parameter.
4078
4417
  #
4079
- # **Required permissions**\: [kms:GetKeyRotationStatus][7] (key policy)
4418
+ # **Required permissions**\: [kms:GetKeyRotationStatus][8] (key policy)
4080
4419
  #
4081
4420
  # **Related operations:**
4082
4421
  #
@@ -4087,12 +4426,13 @@ module Aws::KMS
4087
4426
  #
4088
4427
  #
4089
4428
  # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
4090
- # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#asymmetric-cmks
4091
- # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html
4092
- # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html
4093
- # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-replica-key
4094
- # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
4095
- # [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
4096
4436
  #
4097
4437
  # @option params [required, String] :key_id
4098
4438
  # Gets the rotation status for the specified KMS key.
@@ -4147,21 +4487,22 @@ module Aws::KMS
4147
4487
  req.send_request(options)
4148
4488
  end
4149
4489
 
4150
- # Returns the items you need to import key material into a symmetric,
4151
- # customer managed KMS key. For more information about importing key
4152
- # material into KMS, see [Importing Key Material][1] in the *Key
4153
- # 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*.
4154
4494
  #
4155
4495
  # This operation returns a public key and an import token. Use the
4156
4496
  # public key to encrypt the symmetric key material. Store the import
4157
4497
  # token to send with a subsequent ImportKeyMaterial request.
4158
4498
  #
4159
- # You must specify the key ID of the symmetric KMS key into which you
4160
- # will import key material. This KMS key's `Origin` must be `EXTERNAL`.
4161
- # You must also specify the wrapping algorithm and type of wrapping key
4162
- # (public key) that you will use to encrypt the key material. You cannot
4163
- # perform this operation on an asymmetric KMS key or on any KMS key in a
4164
- # 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.
4165
4506
  #
4166
4507
  # To import key material, you must use the public key and import token
4167
4508
  # from the same response. These items are valid for 24 hours. The
@@ -4171,8 +4512,8 @@ module Aws::KMS
4171
4512
  # `GetParametersForImport` request.
4172
4513
  #
4173
4514
  # The KMS key that you use for this operation must be in a compatible
4174
- # key state. For details, see [Key state: Effect on your KMS key][2] in
4175
- # 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*.
4176
4517
  #
4177
4518
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4178
4519
  # key in a different Amazon Web Services account.
@@ -4193,8 +4534,8 @@ module Aws::KMS
4193
4534
  # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4194
4535
  #
4195
4536
  # @option params [required, String] :key_id
4196
- # The identifier of the symmetric KMS key into which you will import key
4197
- # 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`.
4198
4539
  #
4199
4540
  # Specify the key ID or key ARN of the KMS key.
4200
4541
  #
@@ -4277,9 +4618,8 @@ module Aws::KMS
4277
4618
  # callers with `kms:GetPublicKey` permission can download the public key
4278
4619
  # of an asymmetric KMS key. You can share the public key to allow others
4279
4620
  # to encrypt messages and verify signatures outside of KMS. For
4280
- # information about symmetric and asymmetric KMS keys, see [Using
4281
- # Symmetric and Asymmetric KMS keys][1] in the *Key Management Service
4282
- # Developer Guide*.
4621
+ # information about asymmetric KMS keys, see [Asymmetric KMS keys][1] in
4622
+ # the *Key Management Service Developer Guide*.
4283
4623
  #
4284
4624
  # You do not need to download the public key. Instead, you can use the
4285
4625
  # public key within KMS by calling the Encrypt, ReEncrypt, or Verify
@@ -4311,8 +4651,8 @@ module Aws::KMS
4311
4651
  # in a verification operation.
4312
4652
  #
4313
4653
  # The KMS key that you use for this operation must be in a compatible
4314
- # key state. For details, see [Key state: Effect on your KMS key][7] in
4315
- # 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*.
4316
4656
  #
4317
4657
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
4318
4658
  # in a different Amazon Web Services account, specify the key ARN or
@@ -4412,9 +4752,9 @@ module Aws::KMS
4412
4752
  #
4413
4753
  # resp.key_id #=> String
4414
4754
  # resp.public_key #=> String
4415
- # 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"
4416
- # 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"
4417
- # 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"
4418
4758
  # resp.encryption_algorithms #=> Array
4419
4759
  # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
4420
4760
  # resp.signing_algorithms #=> Array
@@ -4429,16 +4769,17 @@ module Aws::KMS
4429
4769
  req.send_request(options)
4430
4770
  end
4431
4771
 
4432
- # Imports key material into an existing symmetric KMS KMS key that was
4433
- # created without key material. After you successfully import key
4434
- # material into a KMS key, you can [reimport the same key material][1]
4435
- # into that KMS key, but you cannot import different key material.
4436
- #
4437
- # You cannot perform this operation on an asymmetric KMS key or on any
4438
- # KMS key in a different Amazon Web Services account. For more
4439
- # information about creating KMS keys with no key material and then
4440
- # importing key material, see [Importing Key Material][2] in the *Key
4441
- # 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*.
4442
4783
  #
4443
4784
  # Before using this operation, call GetParametersForImport. Its response
4444
4785
  # includes a public key and an import token. Use the public key to
@@ -4480,8 +4821,8 @@ module Aws::KMS
4480
4821
  # Service Developer Guide*.
4481
4822
  #
4482
4823
  # The KMS key that you use for this operation must be in a compatible
4483
- # key state. For details, see [Key state: Effect on your KMS key][4] in
4484
- # 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*.
4485
4826
  #
4486
4827
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
4487
4828
  # key in a different Amazon Web Services account.
@@ -4503,10 +4844,13 @@ module Aws::KMS
4503
4844
  # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
4504
4845
  #
4505
4846
  # @option params [required, String] :key_id
4506
- # The identifier of the symmetric KMS key that receives the imported key
4507
- # material. The KMS key's `Origin` must be `EXTERNAL`. This must be the
4508
- # same KMS key specified in the `KeyID` parameter of the corresponding
4509
- # 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
4510
4854
  #
4511
4855
  # Specify the key ID or key ARN of the KMS key.
4512
4856
  #
@@ -4748,7 +5092,7 @@ module Aws::KMS
4748
5092
  # list by grant ID or grantee principal.
4749
5093
  #
4750
5094
  # For detailed information about grants, including grant terminology,
4751
- # 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
4752
5096
  # Guide</i> </i>. For examples of working with grants in several
4753
5097
  # programming languages, see [Programming grants][2].
4754
5098
  #
@@ -4918,7 +5262,7 @@ module Aws::KMS
4918
5262
  # resp.grants[0].retiring_principal #=> String
4919
5263
  # resp.grants[0].issuing_account #=> String
4920
5264
  # resp.grants[0].operations #=> Array
4921
- # 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"
4922
5266
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
4923
5267
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
4924
5268
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5274,7 +5618,7 @@ module Aws::KMS
5274
5618
  # a grant, use the RetireGrant operation.
5275
5619
  #
5276
5620
  # For detailed information about grants, including grant terminology,
5277
- # 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
5278
5622
  # Guide</i> </i>. For examples of working with grants in several
5279
5623
  # programming languages, see [Programming grants][2].
5280
5624
  #
@@ -5386,7 +5730,7 @@ module Aws::KMS
5386
5730
  # resp.grants[0].retiring_principal #=> String
5387
5731
  # resp.grants[0].issuing_account #=> String
5388
5732
  # resp.grants[0].operations #=> Array
5389
- # 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"
5390
5734
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
5391
5735
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
5392
5736
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -5536,7 +5880,7 @@ module Aws::KMS
5536
5880
  # [encryption context][2] of a ciphertext.
5537
5881
  #
5538
5882
  # The `ReEncrypt` operation can decrypt ciphertext that was encrypted by
5539
- # 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
5540
5884
  # GenerateDataKey. It can also decrypt ciphertext that was encrypted by
5541
5885
  # using the public key of an [asymmetric KMS key][3] outside of KMS.
5542
5886
  # However, it cannot decrypt ciphertext produced by other libraries,
@@ -5554,25 +5898,24 @@ module Aws::KMS
5554
5898
  # algorithm that was used. This information is required to decrypt the
5555
5899
  # data.
5556
5900
  #
5557
- # * If your ciphertext was encrypted under a symmetric KMS key, the
5558
- # `SourceKeyId` parameter is optional. KMS can get this information
5559
- # from metadata that it adds to the symmetric ciphertext blob. This
5560
- # feature adds durability to your implementation by ensuring that
5561
- # authorized users can decrypt ciphertext decades after it was
5562
- # encrypted, even if they've lost track of the key ID. However,
5563
- # specifying the source KMS key is always recommended as a best
5564
- # practice. When you use the `SourceKeyId` parameter to specify a KMS
5565
- # key, KMS uses only the KMS key you specify. If the ciphertext was
5566
- # 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
5567
5911
  # fails. This practice ensures that you use the KMS key that you
5568
5912
  # intend.
5569
5913
  #
5570
5914
  # * To reencrypt the data, you must use the `DestinationKeyId` parameter
5571
5915
  # specify the KMS key that re-encrypts the data after it is decrypted.
5572
- # You can select a symmetric or asymmetric KMS key. If the destination
5573
- # KMS key is an asymmetric KMS key, you must also provide the
5574
- # encryption algorithm. The algorithm that you choose must be
5575
- # 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.
5576
5919
  #
5577
5920
  # When you use an asymmetric KMS key to encrypt or reencrypt data, be
5578
5921
  # sure to record the KMS key and encryption algorithm that you choose.
@@ -5582,14 +5925,15 @@ module Aws::KMS
5582
5925
  # fails.
5583
5926
  #
5584
5927
  # You are not required to supply the key ID and encryption algorithm
5585
- # when you decrypt with symmetric KMS keys because KMS stores this
5586
- # information in the ciphertext blob. KMS cannot store metadata in
5587
- # ciphertext generated with asymmetric keys. The standard format for
5588
- # 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.
5589
5933
  #
5590
5934
  # The KMS key that you use for this operation must be in a compatible
5591
- # key state. For details, see [Key state: Effect on your KMS key][6] in
5592
- # 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*.
5593
5937
  #
5594
5938
  # **Cross-account use**\: Yes. The source KMS key and destination KMS
5595
5939
  # key can be in different Amazon Web Services accounts. Either or both
@@ -5640,13 +5984,14 @@ module Aws::KMS
5640
5984
  # ciphertext.
5641
5985
  #
5642
5986
  # An *encryption context* is a collection of non-secret key-value pairs
5643
- # that represents additional authenticated data. When you use an
5987
+ # that represent additional authenticated data. When you use an
5644
5988
  # encryption context to encrypt data, you must specify the same (an
5645
5989
  # exact case-sensitive match) encryption context to decrypt the data. An
5646
- # encryption context is optional when encrypting with a symmetric KMS
5647
- # 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.
5648
5993
  #
5649
- # For more information, see [Encryption Context][1] in the *Key
5994
+ # For more information, see [Encryption context][1] in the *Key
5650
5995
  # Management Service Developer Guide*.
5651
5996
  #
5652
5997
  #
@@ -5655,14 +6000,18 @@ module Aws::KMS
5655
6000
  #
5656
6001
  # @option params [String] :source_key_id
5657
6002
  # Specifies the KMS key that KMS will use to decrypt the ciphertext
5658
- # before it is re-encrypted. Enter a key ID of the KMS key that was used
5659
- # 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`.
5660
6008
  #
5661
6009
  # This parameter is required only when the ciphertext was encrypted
5662
- # under an asymmetric KMS key. If you used a symmetric KMS key, KMS can
5663
- # get the KMS key from metadata that it adds to the symmetric ciphertext
5664
- # blob. However, it is always recommended as a best practice. This
5665
- # 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.
5666
6015
  #
5667
6016
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5668
6017
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5685,9 +6034,9 @@ module Aws::KMS
5685
6034
  #
5686
6035
  # @option params [required, String] :destination_key_id
5687
6036
  # A unique identifier for the KMS key that is used to reencrypt the
5688
- # data. Specify a symmetric or asymmetric KMS key with a `KeyUsage`
5689
- # value of `ENCRYPT_DECRYPT`. To find the `KeyUsage` value of a KMS key,
5690
- # 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.
5691
6040
  #
5692
6041
  # To specify a KMS key, use its key ID, key ARN, alias name, or alias
5693
6042
  # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
@@ -5713,17 +6062,18 @@ module Aws::KMS
5713
6062
  # data.
5714
6063
  #
5715
6064
  # A destination encryption context is valid only when the destination
5716
- # KMS key is a symmetric KMS key. The standard ciphertext format for
5717
- # 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.
5718
6067
  #
5719
6068
  # An *encryption context* is a collection of non-secret key-value pairs
5720
- # that represents additional authenticated data. When you use an
6069
+ # that represent additional authenticated data. When you use an
5721
6070
  # encryption context to encrypt data, you must specify the same (an
5722
6071
  # exact case-sensitive match) encryption context to decrypt the data. An
5723
- # encryption context is optional when encrypting with a symmetric KMS
5724
- # 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.
5725
6075
  #
5726
- # For more information, see [Encryption Context][1] in the *Key
6076
+ # For more information, see [Encryption context][1] in the *Key
5727
6077
  # Management Service Developer Guide*.
5728
6078
  #
5729
6079
  #
@@ -5733,8 +6083,8 @@ module Aws::KMS
5733
6083
  # @option params [String] :source_encryption_algorithm
5734
6084
  # Specifies the encryption algorithm that KMS will use to decrypt the
5735
6085
  # ciphertext before it is reencrypted. The default value,
5736
- # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric KMS
5737
- # keys.
6086
+ # `SYMMETRIC_DEFAULT`, represents the algorithm used for symmetric
6087
+ # encryption KMS keys.
5738
6088
  #
5739
6089
  # Specify the same algorithm that was used to encrypt the ciphertext. If
5740
6090
  # you specify a different algorithm, the decrypt attempt fails.
@@ -5746,7 +6096,7 @@ module Aws::KMS
5746
6096
  # Specifies the encryption algorithm that KMS will use to reecrypt the
5747
6097
  # data after it has decrypted it. The default value,
5748
6098
  # `SYMMETRIC_DEFAULT`, represents the encryption algorithm used for
5749
- # symmetric KMS keys.
6099
+ # symmetric encryption KMS keys.
5750
6100
  #
5751
6101
  # This parameter is required only when the destination KMS key is an
5752
6102
  # asymmetric KMS key.
@@ -5837,7 +6187,7 @@ module Aws::KMS
5837
6187
  # encrypt data in one Amazon Web Services Region and decrypt it in a
5838
6188
  # different Amazon Web Services Region without re-encrypting the data or
5839
6189
  # making a cross-Region call. For more information about multi-Region
5840
- # 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
5841
6191
  # Developer Guide*.
5842
6192
  #
5843
6193
  # A *replica key* is a fully-functional KMS key that can be used
@@ -5848,8 +6198,8 @@ module Aws::KMS
5848
6198
  # [automatic key rotation status][6]. KMS automatically synchronizes
5849
6199
  # these shared properties among related multi-Region keys. All other
5850
6200
  # properties of a replica key can differ, including its [key policy][7],
5851
- # [tags][8], [aliases][9], and [key state][10]. KMS pricing and quotas
5852
- # 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.
5853
6203
  #
5854
6204
  # When this operation completes, the new replica key has a transient key
5855
6205
  # state of `Creating`. This key state changes to `Enabled` (or
@@ -5859,9 +6209,17 @@ module Aws::KMS
5859
6209
  # If you are creating and using the replica key programmatically, retry
5860
6210
  # on `KMSInvalidStateException` or call `DescribeKey` to check its
5861
6211
  # `KeyState` value before using it. For details about the `Creating` key
5862
- # state, see [Key state: Effect on your KMS
5863
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
5864
- # 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.
5865
6223
  #
5866
6224
  # The CloudTrail log of a `ReplicateKey` operation records a
5867
6225
  # `ReplicateKey` operation in the primary key's Region and a CreateKey
@@ -5914,6 +6272,7 @@ module Aws::KMS
5914
6272
  # [8]: https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html
5915
6273
  # [9]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html
5916
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
5917
6276
  #
5918
6277
  # @option params [required, String] :key_id
5919
6278
  # Identifies the multi-Region primary key that is being replicated. To
@@ -5941,24 +6300,33 @@ module Aws::KMS
5941
6300
  # [KMS service endpoints][1] in the *Amazon Web Services General
5942
6301
  # Reference*.
5943
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
+ #
5944
6312
  # The replica must be in a different Amazon Web Services Region than its
5945
6313
  # primary key and other replicas of that primary key, but in the same
5946
6314
  # Amazon Web Services partition. KMS must be available in the replica
5947
6315
  # Region. If the Region is not enabled by default, the Amazon Web
5948
- # Services account must be enabled in the Region.
5949
- #
5950
- # For information about Amazon Web Services partitions, see [Amazon
5951
- # Resource Names (ARNs) in the *Amazon Web Services General
5952
- # Reference*.][2] For information about enabling and disabling Regions,
5953
- # see [Enabling a Region][3] and [Disabling a Region][4] in the *Amazon
5954
- # 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*.
5955
6322
  #
5956
6323
  #
5957
6324
  #
5958
6325
  # [1]: https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region
5959
- # [2]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
5960
- # [3]: https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable
5961
- # [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
5962
6330
  #
5963
6331
  # @option params [String] :policy
5964
6332
  # The key policy to attach to the KMS key. This parameter is optional.
@@ -6032,8 +6400,8 @@ module Aws::KMS
6032
6400
  # TagResource operation.
6033
6401
  #
6034
6402
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6035
- # key. For details, see [Using ABAC in KMS][1] in the *Key Management
6036
- # Service Developer Guide*.
6403
+ # key. For details, see [ABAC in KMS][1] in the *Key Management Service
6404
+ # Developer Guide*.
6037
6405
  #
6038
6406
  # </note>
6039
6407
  #
@@ -6138,7 +6506,7 @@ module Aws::KMS
6138
6506
  # resp.replica_key_metadata.creation_date #=> Time
6139
6507
  # resp.replica_key_metadata.enabled #=> Boolean
6140
6508
  # resp.replica_key_metadata.description #=> String
6141
- # 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"
6142
6510
  # resp.replica_key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
6143
6511
  # resp.replica_key_metadata.deletion_date #=> Time
6144
6512
  # resp.replica_key_metadata.valid_to #=> Time
@@ -6147,8 +6515,8 @@ module Aws::KMS
6147
6515
  # resp.replica_key_metadata.cloud_hsm_cluster_id #=> String
6148
6516
  # resp.replica_key_metadata.expiration_model #=> String, one of "KEY_MATERIAL_EXPIRES", "KEY_MATERIAL_DOES_NOT_EXPIRE"
6149
6517
  # resp.replica_key_metadata.key_manager #=> String, one of "AWS", "CUSTOMER"
6150
- # 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"
6151
- # 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"
6152
6520
  # resp.replica_key_metadata.encryption_algorithms #=> Array
6153
6521
  # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256"
6154
6522
  # resp.replica_key_metadata.signing_algorithms #=> Array
@@ -6161,6 +6529,8 @@ module Aws::KMS
6161
6529
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].arn #=> String
6162
6530
  # resp.replica_key_metadata.multi_region_configuration.replica_keys[0].region #=> String
6163
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"
6164
6534
  # resp.replica_policy #=> String
6165
6535
  # resp.replica_tags #=> Array
6166
6536
  # resp.replica_tags[0].tag_key #=> String
@@ -6182,14 +6552,13 @@ module Aws::KMS
6182
6552
  #
6183
6553
  # This operation can be called by the *retiring principal* for a grant,
6184
6554
  # by the *grantee principal* if the grant allows the `RetireGrant`
6185
- # operation, and by the Amazon Web Services account (root user) in which
6186
- # the grant is created. It can also be called by principals to whom
6187
- # permission for retiring a grant is delegated. For details, see
6188
- # [Retiring and revoking grants][2] in the *Key Management Service
6189
- # 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*.
6190
6559
  #
6191
6560
  # For detailed information about grants, including grant terminology,
6192
- # 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
6193
6562
  # Guide</i> </i>. For examples of working with grants in several
6194
6563
  # programming languages, see [Programming grants][4].
6195
6564
  #
@@ -6287,7 +6656,7 @@ module Aws::KMS
6287
6656
  # Service Developer Guide</i> </i>.
6288
6657
  #
6289
6658
  # For detailed information about grants, including grant terminology,
6290
- # 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
6291
6660
  # Guide</i> </i>. For examples of working with grants in several
6292
6661
  # programming languages, see [Programming grants][4].
6293
6662
  #
@@ -6404,8 +6773,8 @@ module Aws::KMS
6404
6773
  # Guide*.
6405
6774
  #
6406
6775
  # The KMS key that you use for this operation must be in a compatible
6407
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6408
- # 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*.
6409
6778
  #
6410
6779
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6411
6780
  # key in a different Amazon Web Services account.
@@ -6499,11 +6868,11 @@ module Aws::KMS
6499
6868
  end
6500
6869
 
6501
6870
  # Creates a [digital signature][1] for a message or message digest by
6502
- # 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
6503
6872
  # signature, use the Verify operation, or use the public key in the same
6504
- # asymmetric KMS key outside of KMS. For information about symmetric and
6505
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][2]
6506
- # 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*.
6507
6876
  #
6508
6877
  # Digital signatures are generated and verified by using asymmetric key
6509
6878
  # pair, such as an RSA or ECC pair that is represented by an asymmetric
@@ -6537,8 +6906,8 @@ module Aws::KMS
6537
6906
  # KMS.
6538
6907
  #
6539
6908
  # The KMS key that you use for this operation must be in a compatible
6540
- # key state. For details, see [Key state: Effect on your KMS key][3] in
6541
- # 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*.
6542
6911
  #
6543
6912
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
6544
6913
  # in a different Amazon Web Services account, specify the key ARN or
@@ -6665,8 +7034,8 @@ module Aws::KMS
6665
7034
  # Adds or edits tags on a [customer managed key][1].
6666
7035
  #
6667
7036
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6668
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6669
- # Service Developer Guide*.
7037
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7038
+ # Developer Guide*.
6670
7039
  #
6671
7040
  # </note>
6672
7041
  #
@@ -6688,8 +7057,8 @@ module Aws::KMS
6688
7057
  # General Reference*.
6689
7058
  #
6690
7059
  # The KMS key that you use for this operation must be in a compatible
6691
- # key state. For details, see [Key state: Effect on your KMS key][9] in
6692
- # 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*.
6693
7062
  #
6694
7063
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6695
7064
  # key in a different Amazon Web Services account.
@@ -6786,8 +7155,8 @@ module Aws::KMS
6786
7155
  # specify the tag key and the KMS key.
6787
7156
  #
6788
7157
  # <note markdown="1"> Tagging or untagging a KMS key can allow or deny permission to the KMS
6789
- # key. For details, see [Using ABAC in KMS][2] in the *Key Management
6790
- # Service Developer Guide*.
7158
+ # key. For details, see [ABAC in KMS][2] in the *Key Management Service
7159
+ # Developer Guide*.
6791
7160
  #
6792
7161
  # </note>
6793
7162
  #
@@ -6802,8 +7171,8 @@ module Aws::KMS
6802
7171
  # General Reference*.
6803
7172
  #
6804
7173
  # The KMS key that you use for this operation must be in a compatible
6805
- # key state. For details, see [Key state: Effect on your KMS key][5] in
6806
- # 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*.
6807
7176
  #
6808
7177
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6809
7178
  # key in a different Amazon Web Services account.
@@ -6884,8 +7253,8 @@ module Aws::KMS
6884
7253
  # Amazon Web Services account and Region.
6885
7254
  #
6886
7255
  # <note markdown="1"> Adding, deleting, or updating an alias can allow or deny permission to
6887
- # the KMS key. For details, see [Using ABAC in KMS][1] in the *Key
6888
- # Management Service Developer Guide*.
7256
+ # the KMS key. For details, see [ABAC in KMS][1] in the *Key Management
7257
+ # Service Developer Guide*.
6889
7258
  #
6890
7259
  # </note>
6891
7260
  #
@@ -6907,8 +7276,8 @@ module Aws::KMS
6907
7276
  # ListAliases operation.
6908
7277
  #
6909
7278
  # The KMS key that you use for this operation must be in a compatible
6910
- # key state. For details, see [Key state: Effect on your KMS key][2] in
6911
- # 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*.
6912
7281
  #
6913
7282
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
6914
7283
  # key in a different Amazon Web Services account.
@@ -7173,8 +7542,8 @@ module Aws::KMS
7173
7542
  # key, use DescribeKey.
7174
7543
  #
7175
7544
  # The KMS key that you use for this operation must be in a compatible
7176
- # key state. For details, see [Key state: Effect on your KMS key][1] in
7177
- # 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*.
7178
7547
  #
7179
7548
  # **Cross-account use**\: No. You cannot perform this operation on a KMS
7180
7549
  # key in a different Amazon Web Services account.
@@ -7256,7 +7625,7 @@ module Aws::KMS
7256
7625
  # encrypt data in one Amazon Web Services Region and decrypt it in a
7257
7626
  # different Amazon Web Services Region without re-encrypting the data or
7258
7627
  # making a cross-Region call. For more information about multi-Region
7259
- # 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
7260
7629
  # Developer Guide*.
7261
7630
  #
7262
7631
  # The *primary key* of a multi-Region key is the source for properties
@@ -7286,9 +7655,8 @@ module Aws::KMS
7286
7655
  # can use the keys in cryptographic operations, but you cannot replicate
7287
7656
  # the new primary key or perform certain management operations, such as
7288
7657
  # enabling or disabling these keys. For details about the `Updating` key
7289
- # state, see [Key state: Effect on your KMS
7290
- # key](kms/latest/developerguide/key-state.html) in the *Key Management
7291
- # Service Developer Guide*.
7658
+ # state, see [Key states of KMS keys][9] in the *Key Management Service
7659
+ # Developer Guide*.
7292
7660
  #
7293
7661
  # This operation does not return any output. To verify that primary key
7294
7662
  # is changed, use the DescribeKey operation.
@@ -7321,6 +7689,7 @@ module Aws::KMS
7321
7689
  # [6]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-origin
7322
7690
  # [7]: https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html
7323
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
7324
7693
  #
7325
7694
  # @option params [required, String] :key_id
7326
7695
  # Identifies the current primary key. When the operation completes, this
@@ -7377,9 +7746,9 @@ module Aws::KMS
7377
7746
  #
7378
7747
  # A digital signature is generated by using the private key in an
7379
7748
  # asymmetric KMS key. The signature is verified by using the public key
7380
- # in the same asymmetric KMS key. For information about symmetric and
7381
- # asymmetric KMS keys, see [Using Symmetric and Asymmetric KMS keys][1]
7382
- # 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*.
7383
7752
  #
7384
7753
  # To verify a digital signature, you can use the `Verify` operation.
7385
7754
  # Specify the same asymmetric KMS key, message, and signing algorithm
@@ -7396,8 +7765,8 @@ module Aws::KMS
7396
7765
  # signatures.
7397
7766
  #
7398
7767
  # The KMS key that you use for this operation must be in a compatible
7399
- # key state. For details, see [Key state: Effect on your KMS key][2] in
7400
- # 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*.
7401
7770
  #
7402
7771
  # **Cross-account use**\: Yes. To perform this operation with a KMS key
7403
7772
  # in a different Amazon Web Services account, specify the key ARN or
@@ -7499,7 +7868,7 @@ module Aws::KMS
7499
7868
  # resp.to_h outputs the following:
7500
7869
  # {
7501
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.
7502
- # 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.
7503
7872
  # signing_algorithm: "ECDSA_SHA_384", # The signing algorithm that was used to verify the signature.
7504
7873
  # }
7505
7874
  #
@@ -7529,6 +7898,128 @@ module Aws::KMS
7529
7898
  req.send_request(options)
7530
7899
  end
7531
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
+
7532
8023
  # @!endgroup
7533
8024
 
7534
8025
  # @param params ({})
@@ -7542,7 +8033,7 @@ module Aws::KMS
7542
8033
  params: params,
7543
8034
  config: config)
7544
8035
  context[:gem_name] = 'aws-sdk-kms'
7545
- context[:gem_version] = '1.53.0'
8036
+ context[:gem_version] = '1.56.0'
7546
8037
  Seahorse::Client::Request.new(handlers, context)
7547
8038
  end
7548
8039