aws-sdk-kms 1.79.0 → 1.85.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,7 @@ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
22
22
  require 'aws-sdk-core/plugins/response_paging.rb'
23
23
  require 'aws-sdk-core/plugins/stub_responses.rb'
24
24
  require 'aws-sdk-core/plugins/idempotency_token.rb'
25
+ require 'aws-sdk-core/plugins/invocation_id.rb'
25
26
  require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
26
27
  require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
28
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
@@ -72,6 +73,7 @@ module Aws::KMS
72
73
  add_plugin(Aws::Plugins::ResponsePaging)
73
74
  add_plugin(Aws::Plugins::StubResponses)
74
75
  add_plugin(Aws::Plugins::IdempotencyToken)
76
+ add_plugin(Aws::Plugins::InvocationId)
75
77
  add_plugin(Aws::Plugins::JsonvalueConverter)
76
78
  add_plugin(Aws::Plugins::ClientMetricsPlugin)
77
79
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
@@ -196,10 +198,17 @@ module Aws::KMS
196
198
  # When set to 'true' the request body will not be compressed
197
199
  # for supported operations.
198
200
  #
199
- # @option options [String] :endpoint
200
- # The client endpoint is normally constructed from the `:region`
201
- # option. You should only configure an `:endpoint` when connecting
202
- # to test or custom endpoints. This should be a valid HTTP(S) URI.
201
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
202
+ # Normally you should not configure the `:endpoint` option
203
+ # directly. This is normally constructed from the `:region`
204
+ # option. Configuring `:endpoint` is normally reserved for
205
+ # connecting to test or custom endpoints. The endpoint should
206
+ # be a URI formatted like:
207
+ #
208
+ # 'http://example.com'
209
+ # 'https://example.com'
210
+ # 'http://example.com:123'
211
+ #
203
212
  #
204
213
  # @option options [Integer] :endpoint_cache_max_entries (1000)
205
214
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -292,8 +301,9 @@ module Aws::KMS
292
301
  #
293
302
  # @option options [String] :sdk_ua_app_id
294
303
  # A unique and opaque application ID that is appended to the
295
- # User-Agent header as app/<sdk_ua_app_id>. It should have a
296
- # maximum length of 50.
304
+ # User-Agent header as app/sdk_ua_app_id. It should have a
305
+ # maximum length of 50. This variable is sourced from environment
306
+ # variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
297
307
  #
298
308
  # @option options [String] :secret_access_key
299
309
  #
@@ -347,50 +357,65 @@ module Aws::KMS
347
357
  # @option options [Aws::KMS::EndpointProvider] :endpoint_provider
348
358
  # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::KMS::EndpointParameters`
349
359
  #
350
- # @option options [URI::HTTP,String] :http_proxy A proxy to send
351
- # requests through. Formatted like 'http://proxy.com:123'.
352
- #
353
- # @option options [Float] :http_open_timeout (15) The number of
354
- # seconds to wait when opening a HTTP session before raising a
355
- # `Timeout::Error`.
356
- #
357
- # @option options [Float] :http_read_timeout (60) The default
358
- # number of seconds to wait for response data. This value can
359
- # safely be set per-request on the session.
360
- #
361
- # @option options [Float] :http_idle_timeout (5) The number of
362
- # seconds a connection is allowed to sit idle before it is
363
- # considered stale. Stale connections are closed and removed
364
- # from the pool before making a request.
365
- #
366
- # @option options [Float] :http_continue_timeout (1) The number of
367
- # seconds to wait for a 100-continue response before sending the
368
- # request body. This option has no effect unless the request has
369
- # "Expect" header set to "100-continue". Defaults to `nil` which
370
- # disables this behaviour. This value can safely be set per
371
- # request on the session.
372
- #
373
- # @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
374
- # in seconds.
360
+ # @option options [Float] :http_continue_timeout (1)
361
+ # The number of seconds to wait for a 100-continue response before sending the
362
+ # request body. This option has no effect unless the request has "Expect"
363
+ # header set to "100-continue". Defaults to `nil` which disables this
364
+ # behaviour. This value can safely be set per request on the session.
365
+ #
366
+ # @option options [Float] :http_idle_timeout (5)
367
+ # The number of seconds a connection is allowed to sit idle before it
368
+ # is considered stale. Stale connections are closed and removed from the
369
+ # pool before making a request.
370
+ #
371
+ # @option options [Float] :http_open_timeout (15)
372
+ # The default number of seconds to wait for response data.
373
+ # This value can safely be set per-request on the session.
374
+ #
375
+ # @option options [URI::HTTP,String] :http_proxy
376
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
377
+ #
378
+ # @option options [Float] :http_read_timeout (60)
379
+ # The default number of seconds to wait for response data.
380
+ # This value can safely be set per-request on the session.
381
+ #
382
+ # @option options [Boolean] :http_wire_trace (false)
383
+ # When `true`, HTTP debug output will be sent to the `:logger`.
384
+ #
385
+ # @option options [Proc] :on_chunk_received
386
+ # When a Proc object is provided, it will be used as callback when each chunk
387
+ # of the response body is received. It provides three arguments: the chunk,
388
+ # the number of bytes received, and the total number of
389
+ # bytes in the response (or nil if the server did not send a `content-length`).
390
+ #
391
+ # @option options [Proc] :on_chunk_sent
392
+ # When a Proc object is provided, it will be used as callback when each chunk
393
+ # of the request body is sent. It provides three arguments: the chunk,
394
+ # the number of bytes read from the body, and the total number of
395
+ # bytes in the body.
396
+ #
397
+ # @option options [Boolean] :raise_response_errors (true)
398
+ # When `true`, response errors are raised.
399
+ #
400
+ # @option options [String] :ssl_ca_bundle
401
+ # Full path to the SSL certificate authority bundle file that should be used when
402
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
403
+ # `:ssl_ca_directory` the the system default will be used if available.
404
+ #
405
+ # @option options [String] :ssl_ca_directory
406
+ # Full path of the directory that contains the unbundled SSL certificate
407
+ # authority files for verifying peer certificates. If you do
408
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
409
+ # default will be used if available.
375
410
  #
376
- # @option options [Boolean] :http_wire_trace (false) When `true`,
377
- # HTTP debug output will be sent to the `:logger`.
411
+ # @option options [String] :ssl_ca_store
412
+ # Sets the X509::Store to verify peer certificate.
378
413
  #
379
- # @option options [Boolean] :ssl_verify_peer (true) When `true`,
380
- # SSL peer certificates are verified when establishing a
381
- # connection.
414
+ # @option options [Float] :ssl_timeout
415
+ # Sets the SSL timeout in seconds
382
416
  #
383
- # @option options [String] :ssl_ca_bundle Full path to the SSL
384
- # certificate authority bundle file that should be used when
385
- # verifying peer certificates. If you do not pass
386
- # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
387
- # will be used if available.
388
- #
389
- # @option options [String] :ssl_ca_directory Full path of the
390
- # directory that contains the unbundled SSL certificate
391
- # authority files for verifying peer certificates. If you do
392
- # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
393
- # system default will be used if available.
417
+ # @option options [Boolean] :ssl_verify_peer (true)
418
+ # When `true`, SSL peer certificates are verified when establishing a connection.
394
419
  #
395
420
  def initialize(*args)
396
421
  super
@@ -1396,7 +1421,7 @@ module Aws::KMS
1396
1421
  # key_id: "KeyIdType", # required
1397
1422
  # grantee_principal: "PrincipalIdType", # required
1398
1423
  # retiring_principal: "PrincipalIdType",
1399
- # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac
1424
+ # operations: ["Decrypt"], # required, accepts Decrypt, Encrypt, GenerateDataKey, GenerateDataKeyWithoutPlaintext, ReEncryptFrom, ReEncryptTo, Sign, Verify, GetPublicKey, CreateGrant, RetireGrant, DescribeKey, GenerateDataKeyPair, GenerateDataKeyPairWithoutPlaintext, GenerateMac, VerifyMac, DeriveSharedSecret
1400
1425
  # constraints: {
1401
1426
  # encryption_context_subset: {
1402
1427
  # "EncryptionContextKey" => "EncryptionContextValue",
@@ -1483,12 +1508,17 @@ module Aws::KMS
1483
1508
  # key pair, or an SM2 key pair (China Regions only). The private key
1484
1509
  # in an asymmetric KMS key never leaves KMS unencrypted. However, you
1485
1510
  # can use the GetPublicKey operation to download the public key so it
1486
- # can be used outside of KMS. KMS keys with RSA or SM2 key pairs can
1487
- # be used to encrypt or decrypt data or sign and verify messages (but
1488
- # not both). KMS keys with ECC key pairs can be used only to sign and
1489
- # verify messages. For information about asymmetric KMS keys, see
1490
- # [Asymmetric KMS keys][3] in the *Key Management Service Developer
1491
- # Guide*.
1511
+ # can be used outside of KMS. Each KMS key can have only one key
1512
+ # usage. KMS keys with RSA key pairs can be used to encrypt and
1513
+ # decrypt data or sign and verify messages (but not both). KMS keys
1514
+ # with NIST-recommended ECC key pairs can be used to sign and verify
1515
+ # messages or derive shared secrets (but not both). KMS keys with
1516
+ # `ECC_SECG_P256K1` can be used only to sign and verify messages. KMS
1517
+ # keys with SM2 key pairs (China Regions only) can be used to either
1518
+ # encrypt and decrypt data, sign and verify messages, or derive shared
1519
+ # secrets (you must choose one key usage type). For information about
1520
+ # asymmetric KMS keys, see [Asymmetric KMS keys][3] in the *Key
1521
+ # Management Service Developer Guide*.
1492
1522
  #
1493
1523
  #
1494
1524
  #
@@ -1710,14 +1740,17 @@ module Aws::KMS
1710
1740
  #
1711
1741
  # * For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC`.
1712
1742
  #
1713
- # * For asymmetric KMS keys with RSA key material, specify
1743
+ # * For asymmetric KMS keys with RSA key pairs, specify
1714
1744
  # `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1715
1745
  #
1716
- # * For asymmetric KMS keys with ECC key material, specify
1746
+ # * For asymmetric KMS keys with NIST-recommended elliptic curve key
1747
+ # pairs, specify `SIGN_VERIFY` or `KEY_AGREEMENT`.
1748
+ #
1749
+ # * For asymmetric KMS keys with `ECC_SECG_P256K1` key pairs specify
1717
1750
  # `SIGN_VERIFY`.
1718
1751
  #
1719
- # * For asymmetric KMS keys with SM2 key material (China Regions only),
1720
- # specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY`.
1752
+ # * For asymmetric KMS keys with SM2 key pairs (China Regions only),
1753
+ # specify `ENCRYPT_DECRYPT`, `SIGN_VERIFY`, or `KEY_AGREEMENT`.
1721
1754
  #
1722
1755
  #
1723
1756
  #
@@ -1770,7 +1803,8 @@ module Aws::KMS
1770
1803
  #
1771
1804
  # * `HMAC_512`
1772
1805
  #
1773
- # * Asymmetric RSA key pairs
1806
+ # * Asymmetric RSA key pairs (encryption and decryption -or- signing and
1807
+ # verification)
1774
1808
  #
1775
1809
  # * `RSA_2048`
1776
1810
  #
@@ -1778,7 +1812,8 @@ module Aws::KMS
1778
1812
  #
1779
1813
  # * `RSA_4096`
1780
1814
  #
1781
- # * Asymmetric NIST-recommended elliptic curve key pairs
1815
+ # * Asymmetric NIST-recommended elliptic curve key pairs (signing and
1816
+ # verification -or- deriving shared secrets)
1782
1817
  #
1783
1818
  # * `ECC_NIST_P256` (secp256r1)
1784
1819
  #
@@ -1786,15 +1821,16 @@ module Aws::KMS
1786
1821
  #
1787
1822
  # * `ECC_NIST_P521` (secp521r1)
1788
1823
  #
1789
- # * Other asymmetric elliptic curve key pairs
1824
+ # * Other asymmetric elliptic curve key pairs (signing and verification)
1790
1825
  #
1791
1826
  # * `ECC_SECG_P256K1` (secp256k1), commonly used for cryptocurrencies.
1792
1827
  #
1793
1828
  # ^
1794
1829
  #
1795
- # * SM2 key pairs (China Regions only)
1830
+ # * SM2 key pairs (encryption and decryption -or- signing and
1831
+ # verification -or- deriving shared secrets)
1796
1832
  #
1797
- # * `SM2`
1833
+ # * `SM2` (China Regions only)
1798
1834
  #
1799
1835
  # ^
1800
1836
  #
@@ -2258,7 +2294,7 @@ module Aws::KMS
2258
2294
  # resp = client.create_key({
2259
2295
  # policy: "PolicyType",
2260
2296
  # description: "DescriptionType",
2261
- # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC
2297
+ # key_usage: "SIGN_VERIFY", # accepts SIGN_VERIFY, ENCRYPT_DECRYPT, GENERATE_VERIFY_MAC, KEY_AGREEMENT
2262
2298
  # customer_master_key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
2263
2299
  # key_spec: "RSA_2048", # accepts RSA_2048, RSA_3072, RSA_4096, ECC_NIST_P256, ECC_NIST_P384, ECC_NIST_P521, ECC_SECG_P256K1, SYMMETRIC_DEFAULT, HMAC_224, HMAC_256, HMAC_384, HMAC_512, SM2
2264
2300
  # origin: "AWS_KMS", # accepts AWS_KMS, EXTERNAL, AWS_CLOUDHSM, EXTERNAL_KEY_STORE
@@ -2282,7 +2318,7 @@ module Aws::KMS
2282
2318
  # resp.key_metadata.creation_date #=> Time
2283
2319
  # resp.key_metadata.enabled #=> Boolean
2284
2320
  # resp.key_metadata.description #=> String
2285
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
2321
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
2286
2322
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
2287
2323
  # resp.key_metadata.deletion_date #=> Time
2288
2324
  # resp.key_metadata.valid_to #=> Time
@@ -2297,6 +2333,8 @@ module Aws::KMS
2297
2333
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
2298
2334
  # resp.key_metadata.signing_algorithms #=> Array
2299
2335
  # resp.key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
2336
+ # resp.key_metadata.key_agreement_algorithms #=> Array
2337
+ # resp.key_metadata.key_agreement_algorithms[0] #=> String, one of "ECDH"
2300
2338
  # resp.key_metadata.multi_region #=> Boolean
2301
2339
  # resp.key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
2302
2340
  # resp.key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -2893,6 +2931,270 @@ module Aws::KMS
2893
2931
  req.send_request(options)
2894
2932
  end
2895
2933
 
2934
+ # Derives a shared secret using a key agreement algorithm.
2935
+ #
2936
+ # <note markdown="1"> You must use an asymmetric NIST-recommended elliptic curve (ECC) or
2937
+ # SM2 (China Regions only) KMS key pair with a `KeyUsage` value of
2938
+ # `KEY_AGREEMENT` to call DeriveSharedSecret.
2939
+ #
2940
+ # </note>
2941
+ #
2942
+ # DeriveSharedSecret uses the [Elliptic Curve Cryptography Cofactor
2943
+ # Diffie-Hellman Primitive][1] (ECDH) to establish a key agreement
2944
+ # between two peers by deriving a shared secret from their elliptic
2945
+ # curve public-private key pairs. You can use the raw shared secret that
2946
+ # DeriveSharedSecret returns to derive a symmetric key that can encrypt
2947
+ # and decrypt data that is sent between the two peers, or that can
2948
+ # generate and verify HMACs. KMS recommends that you follow [NIST
2949
+ # recommendations for key derivation][2] when using the raw shared
2950
+ # secret to derive a symmetric key.
2951
+ #
2952
+ # The following workflow demonstrates how to establish key agreement
2953
+ # over an insecure communication channel using DeriveSharedSecret.
2954
+ #
2955
+ # 1. **Alice** calls CreateKey to create an asymmetric KMS key pair
2956
+ # with a `KeyUsage` value of `KEY_AGREEMENT`.
2957
+ #
2958
+ # The asymmetric KMS key must use a NIST-recommended elliptic curve
2959
+ # (ECC) or SM2 (China Regions only) key spec.
2960
+ #
2961
+ # 2. **Bob** creates an elliptic curve key pair.
2962
+ #
2963
+ # Bob can call CreateKey to create an asymmetric KMS key pair or
2964
+ # generate a key pair outside of KMS. Bob's key pair must use the
2965
+ # same NIST-recommended elliptic curve (ECC) or SM2 (China Regions
2966
+ # ony) curve as Alice.
2967
+ #
2968
+ # 3. Alice and Bob **exchange their public keys** through an insecure
2969
+ # communication channel (like the internet).
2970
+ #
2971
+ # Use GetPublicKey to download the public key of your asymmetric KMS
2972
+ # key pair.
2973
+ #
2974
+ # <note markdown="1"> KMS strongly recommends verifying that the public key you receive
2975
+ # came from the expected party before using it to derive a shared
2976
+ # secret.
2977
+ #
2978
+ # </note>
2979
+ #
2980
+ # 4. **Alice** calls DeriveSharedSecret.
2981
+ #
2982
+ # KMS uses the private key from the KMS key pair generated in **Step
2983
+ # 1**, Bob's public key, and the Elliptic Curve Cryptography
2984
+ # Cofactor Diffie-Hellman Primitive to derive the shared secret. The
2985
+ # private key in your KMS key pair never leaves KMS unencrypted.
2986
+ # DeriveSharedSecret returns the raw shared secret.
2987
+ #
2988
+ # 5. **Bob** uses the Elliptic Curve Cryptography Cofactor
2989
+ # Diffie-Hellman Primitive to calculate the same raw secret using
2990
+ # his private key and Alice's public key.
2991
+ #
2992
+ # To derive a shared secret you must provide a key agreement algorithm,
2993
+ # the private key of the caller's asymmetric NIST-recommended elliptic
2994
+ # curve or SM2 (China Regions only) KMS key pair, and the public key
2995
+ # from your peer's NIST-recommended elliptic curve or SM2 (China
2996
+ # Regions only) key pair. The public key can be from another asymmetric
2997
+ # KMS key pair or from a key pair generated outside of KMS, but both key
2998
+ # pairs must be on the same elliptic curve.
2999
+ #
3000
+ # The KMS key that you use for this operation must be in a compatible
3001
+ # key state. For details, see [Key states of KMS keys][3] in the *Key
3002
+ # Management Service Developer Guide*.
3003
+ #
3004
+ # **Cross-account use**: Yes. To perform this operation with a KMS key
3005
+ # in a different Amazon Web Services account, specify the key ARN or
3006
+ # alias ARN in the value of the `KeyId` parameter.
3007
+ #
3008
+ # **Required permissions**: [kms:DeriveSharedSecret][4] (key policy)
3009
+ #
3010
+ # **Related operations:**
3011
+ #
3012
+ # * CreateKey
3013
+ #
3014
+ # * GetPublicKey
3015
+ #
3016
+ # * DescribeKey
3017
+ #
3018
+ # **Eventual consistency**: The KMS API follows an eventual consistency
3019
+ # model. For more information, see [KMS eventual consistency][5].
3020
+ #
3021
+ #
3022
+ #
3023
+ # [1]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar3.pdf#page=60
3024
+ # [2]: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Cr2.pdf
3025
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html
3026
+ # [4]: https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html
3027
+ # [5]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html
3028
+ #
3029
+ # @option params [required, String] :key_id
3030
+ # Identifies an asymmetric NIST-recommended ECC or SM2 (China Regions
3031
+ # only) KMS key. KMS uses the private key in the specified key pair to
3032
+ # derive the shared secret. The key usage of the KMS key must be
3033
+ # `KEY_AGREEMENT`. To find the `KeyUsage` of a KMS key, use the
3034
+ # DescribeKey operation.
3035
+ #
3036
+ # To specify a KMS key, use its key ID, key ARN, alias name, or alias
3037
+ # ARN. When using an alias name, prefix it with `"alias/"`. To specify a
3038
+ # KMS key in a different Amazon Web Services account, you must use the
3039
+ # key ARN or alias ARN.
3040
+ #
3041
+ # For example:
3042
+ #
3043
+ # * Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
3044
+ #
3045
+ # * Key ARN:
3046
+ # `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
3047
+ #
3048
+ # * Alias name: `alias/ExampleAlias`
3049
+ #
3050
+ # * Alias ARN: `arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias`
3051
+ #
3052
+ # To get the key ID and key ARN for a KMS key, use ListKeys or
3053
+ # DescribeKey. To get the alias name and alias ARN, use ListAliases.
3054
+ #
3055
+ # @option params [required, String] :key_agreement_algorithm
3056
+ # Specifies the key agreement algorithm used to derive the shared
3057
+ # secret. The only valid value is `ECDH`.
3058
+ #
3059
+ # @option params [required, String, StringIO, File] :public_key
3060
+ # Specifies the public key in your peer's NIST-recommended elliptic
3061
+ # curve (ECC) or SM2 (China Regions only) key pair.
3062
+ #
3063
+ # The public key must be a DER-encoded X.509 public key, also known as
3064
+ # `SubjectPublicKeyInfo` (SPKI), as defined in [RFC 5280][1].
3065
+ #
3066
+ # GetPublicKey returns the public key of an asymmetric KMS key pair in
3067
+ # the required DER-encoded format.
3068
+ #
3069
+ # <note markdown="1"> If you use [Amazon Web Services CLI version 1][2], you must provide
3070
+ # the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web
3071
+ # Services CLI Base64-encodes the public key a second time, resulting in
3072
+ # a `ValidationException`.
3073
+ #
3074
+ # </note>
3075
+ #
3076
+ # You can specify the public key as binary data in a file using fileb
3077
+ # (`fileb://<path-to-file>`) or in-line using a Base64 encoded string.
3078
+ #
3079
+ #
3080
+ #
3081
+ # [1]: https://tools.ietf.org/html/rfc5280
3082
+ # [2]: https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html
3083
+ #
3084
+ # @option params [Array<String>] :grant_tokens
3085
+ # A list of grant tokens.
3086
+ #
3087
+ # Use a grant token when your permission to call this operation comes
3088
+ # from a new grant that has not yet achieved *eventual consistency*. For
3089
+ # more information, see [Grant token][1] and [Using a grant token][2] in
3090
+ # the *Key Management Service Developer Guide*.
3091
+ #
3092
+ #
3093
+ #
3094
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token
3095
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
3096
+ #
3097
+ # @option params [Boolean] :dry_run
3098
+ # Checks if your request will succeed. `DryRun` is an optional
3099
+ # parameter.
3100
+ #
3101
+ # To learn more about how to use this parameter, see [Testing your KMS
3102
+ # API calls][1] in the *Key Management Service Developer Guide*.
3103
+ #
3104
+ #
3105
+ #
3106
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html
3107
+ #
3108
+ # @option params [Types::RecipientInfo] :recipient
3109
+ # A signed [attestation document][1] from an Amazon Web Services Nitro
3110
+ # enclave and the encryption algorithm to use with the enclave's public
3111
+ # key. The only valid encryption algorithm is `RSAES_OAEP_SHA_256`.
3112
+ #
3113
+ # This parameter only supports attestation documents for Amazon Web
3114
+ # Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web
3115
+ # Services Nitro Enclaves, use the [Amazon Web Services Nitro Enclaves
3116
+ # SDK][2] to generate the attestation document and then use the
3117
+ # Recipient parameter from any Amazon Web Services SDK to provide the
3118
+ # attestation document for the enclave.
3119
+ #
3120
+ # When you use this parameter, instead of returning a plaintext copy of
3121
+ # the shared secret, KMS encrypts the plaintext shared secret under the
3122
+ # public key in the attestation document, and returns the resulting
3123
+ # ciphertext in the `CiphertextForRecipient` field in the response. This
3124
+ # ciphertext can be decrypted only with the private key in the enclave.
3125
+ # The `CiphertextBlob` field in the response contains the encrypted
3126
+ # shared secret derived from the KMS key specified by the `KeyId`
3127
+ # parameter and public key specified by the `PublicKey` parameter. The
3128
+ # `SharedSecret` field in the response is null or empty.
3129
+ #
3130
+ # For information about the interaction between KMS and Amazon Web
3131
+ # Services Nitro Enclaves, see [How Amazon Web Services Nitro Enclaves
3132
+ # uses KMS][3] in the *Key Management Service Developer Guide*.
3133
+ #
3134
+ #
3135
+ #
3136
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc
3137
+ # [2]: https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk
3138
+ # [3]: https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html
3139
+ #
3140
+ # @return [Types::DeriveSharedSecretResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3141
+ #
3142
+ # * {Types::DeriveSharedSecretResponse#key_id #key_id} => String
3143
+ # * {Types::DeriveSharedSecretResponse#shared_secret #shared_secret} => String
3144
+ # * {Types::DeriveSharedSecretResponse#ciphertext_for_recipient #ciphertext_for_recipient} => String
3145
+ # * {Types::DeriveSharedSecretResponse#key_agreement_algorithm #key_agreement_algorithm} => String
3146
+ # * {Types::DeriveSharedSecretResponse#key_origin #key_origin} => String
3147
+ #
3148
+ #
3149
+ # @example Example: To derive a shared secret
3150
+ #
3151
+ # # The following example derives a shared secret using a key agreement algorithm.
3152
+ #
3153
+ # resp = client.derive_shared_secret({
3154
+ # key_agreement_algorithm: "ECDH", # The key agreement algorithm used to derive the shared secret. The only valid value is ECDH.
3155
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The key identifier for an asymmetric KMS key pair. The private key in the specified key pair is used to derive the shared secret.
3156
+ # public_key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvH3Yj0wbkLEpUl95Cv1cJVjsVNSjwGq3tCLnzXfhVwVvmzGN8pYj3U8nKwgouaHbBWNJYjP5VutbbkKS4Kv4GojwZBJyHN17kmxo8yTjRmjR15SKIQ8cqRA2uaERMLnpztIXdZp232PQPbWGxDyXYJ0aJ5EFSag", # The public key in your peer's asymmetric key pair.
3157
+ # })
3158
+ #
3159
+ # resp.to_h outputs the following:
3160
+ # {
3161
+ # key_agreement_algorithm: "ECDH", # The key agreement algorithm used to derive the shared secret.
3162
+ # key_id: "1234abcd-12ab-34cd-56ef-1234567890ab", # The asymmetric KMS key pair used to derive the shared secret.
3163
+ # key_origin: "AWS_KMS", # The source of the key material for the specified KMS key.
3164
+ # shared_secret: "MEYCIQCKZLWyTk5runarx6XiAkU9gv3lbwPO/pHa+DXFehzdDwIhANwpsIV2g/9SPWLLsF6p/hiSskuIXMTRwqrMdVKWTMHG", # The raw secret derived from the specified key agreement algorithm, private key in the asymmetric KMS key, and your peer's public key.
3165
+ # }
3166
+ #
3167
+ # @example Request syntax with placeholder values
3168
+ #
3169
+ # resp = client.derive_shared_secret({
3170
+ # key_id: "KeyIdType", # required
3171
+ # key_agreement_algorithm: "ECDH", # required, accepts ECDH
3172
+ # public_key: "data", # required
3173
+ # grant_tokens: ["GrantTokenType"],
3174
+ # dry_run: false,
3175
+ # recipient: {
3176
+ # key_encryption_algorithm: "RSAES_OAEP_SHA_256", # accepts RSAES_OAEP_SHA_256
3177
+ # attestation_document: "data",
3178
+ # },
3179
+ # })
3180
+ #
3181
+ # @example Response structure
3182
+ #
3183
+ # resp.key_id #=> String
3184
+ # resp.shared_secret #=> String
3185
+ # resp.ciphertext_for_recipient #=> String
3186
+ # resp.key_agreement_algorithm #=> String, one of "ECDH"
3187
+ # resp.key_origin #=> String, one of "AWS_KMS", "EXTERNAL", "AWS_CLOUDHSM", "EXTERNAL_KEY_STORE"
3188
+ #
3189
+ # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeriveSharedSecret AWS API Documentation
3190
+ #
3191
+ # @overload derive_shared_secret(params = {})
3192
+ # @param [Hash] params ({})
3193
+ def derive_shared_secret(params = {}, options = {})
3194
+ req = build_request(:derive_shared_secret, params)
3195
+ req.send_request(options)
3196
+ end
3197
+
2896
3198
  # Gets information about [custom key stores][1] in the account and
2897
3199
  # Region.
2898
3200
  #
@@ -3477,7 +3779,7 @@ module Aws::KMS
3477
3779
  # resp.key_metadata.creation_date #=> Time
3478
3780
  # resp.key_metadata.enabled #=> Boolean
3479
3781
  # resp.key_metadata.description #=> String
3480
- # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
3782
+ # resp.key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
3481
3783
  # resp.key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
3482
3784
  # resp.key_metadata.deletion_date #=> Time
3483
3785
  # resp.key_metadata.valid_to #=> Time
@@ -3492,6 +3794,8 @@ module Aws::KMS
3492
3794
  # resp.key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
3493
3795
  # resp.key_metadata.signing_algorithms #=> Array
3494
3796
  # resp.key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
3797
+ # resp.key_metadata.key_agreement_algorithms #=> Array
3798
+ # resp.key_metadata.key_agreement_algorithms[0] #=> String, one of "ECDH"
3495
3799
  # resp.key_metadata.multi_region #=> Boolean
3496
3800
  # resp.key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
3497
3801
  # resp.key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -4758,8 +5062,11 @@ module Aws::KMS
4758
5062
  # key. The only valid encryption algorithm is `RSAES_OAEP_SHA_256`.
4759
5063
  #
4760
5064
  # This parameter only supports attestation documents for Amazon Web
4761
- # Services Nitro Enclaves. To include this parameter, use the [Amazon
4762
- # Web Services Nitro Enclaves SDK][2] or any Amazon Web Services SDK.
5065
+ # Services Nitro Enclaves. To call DeriveSharedSecret for an Amazon Web
5066
+ # Services Nitro Enclaves, use the [Amazon Web Services Nitro Enclaves
5067
+ # SDK][2] to generate the attestation document and then use the
5068
+ # Recipient parameter from any Amazon Web Services SDK to provide the
5069
+ # attestation document for the enclave.
4763
5070
  #
4764
5071
  # When you use this parameter, instead of returning a plaintext copy of
4765
5072
  # the private data key, KMS encrypts the plaintext private data key
@@ -6063,8 +6370,8 @@ module Aws::KMS
6063
6370
  #
6064
6371
  # resp = client.get_parameters_for_import({
6065
6372
  # key_id: "KeyIdType", # required
6066
- # wrapping_algorithm: "RSAES_PKCS1_V1_5", # required, accepts RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, RSA_AES_KEY_WRAP_SHA_1, RSA_AES_KEY_WRAP_SHA_256
6067
- # wrapping_key_spec: "RSA_2048", # required, accepts RSA_2048, RSA_3072, RSA_4096
6373
+ # wrapping_algorithm: "RSAES_PKCS1_V1_5", # required, accepts RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256, RSA_AES_KEY_WRAP_SHA_1, RSA_AES_KEY_WRAP_SHA_256, SM2PKE
6374
+ # wrapping_key_spec: "RSA_2048", # required, accepts RSA_2048, RSA_3072, RSA_4096, SM2
6068
6375
  # })
6069
6376
  #
6070
6377
  # @example Response structure
@@ -6106,7 +6413,8 @@ module Aws::KMS
6106
6413
  # * [KeySpec][2]: The type of key material in the public key, such as
6107
6414
  # `RSA_4096` or `ECC_NIST_P521`.
6108
6415
  #
6109
- # * [KeyUsage][3]: Whether the key is used for encryption or signing.
6416
+ # * [KeyUsage][3]: Whether the key is used for encryption, signing, or
6417
+ # deriving a shared secret.
6110
6418
  #
6111
6419
  # * [EncryptionAlgorithms][4] or [SigningAlgorithms][5]: A list of the
6112
6420
  # encryption algorithms or the signing algorithms for the key.
@@ -6195,6 +6503,7 @@ module Aws::KMS
6195
6503
  # * {Types::GetPublicKeyResponse#key_usage #key_usage} => String
6196
6504
  # * {Types::GetPublicKeyResponse#encryption_algorithms #encryption_algorithms} => Array&lt;String&gt;
6197
6505
  # * {Types::GetPublicKeyResponse#signing_algorithms #signing_algorithms} => Array&lt;String&gt;
6506
+ # * {Types::GetPublicKeyResponse#key_agreement_algorithms #key_agreement_algorithms} => Array&lt;String&gt;
6198
6507
  #
6199
6508
  #
6200
6509
  # @example Example: To download the public key of an asymmetric KMS key
@@ -6232,11 +6541,13 @@ module Aws::KMS
6232
6541
  # resp.public_key #=> String
6233
6542
  # resp.customer_master_key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
6234
6543
  # resp.key_spec #=> String, one of "RSA_2048", "RSA_3072", "RSA_4096", "ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "ECC_SECG_P256K1", "SYMMETRIC_DEFAULT", "HMAC_224", "HMAC_256", "HMAC_384", "HMAC_512", "SM2"
6235
- # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
6544
+ # resp.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
6236
6545
  # resp.encryption_algorithms #=> Array
6237
6546
  # resp.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
6238
6547
  # resp.signing_algorithms #=> Array
6239
6548
  # resp.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
6549
+ # resp.key_agreement_algorithms #=> Array
6550
+ # resp.key_agreement_algorithms[0] #=> String, one of "ECDH"
6240
6551
  #
6241
6552
  # @see http://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey AWS API Documentation
6242
6553
  #
@@ -6839,7 +7150,7 @@ module Aws::KMS
6839
7150
  # resp.grants[0].retiring_principal #=> String
6840
7151
  # resp.grants[0].issuing_account #=> String
6841
7152
  # resp.grants[0].operations #=> Array
6842
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
7153
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac", "DeriveSharedSecret"
6843
7154
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
6844
7155
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
6845
7156
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -7461,7 +7772,7 @@ module Aws::KMS
7461
7772
  # resp.grants[0].retiring_principal #=> String
7462
7773
  # resp.grants[0].issuing_account #=> String
7463
7774
  # resp.grants[0].operations #=> Array
7464
- # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac"
7775
+ # resp.grants[0].operations[0] #=> String, one of "Decrypt", "Encrypt", "GenerateDataKey", "GenerateDataKeyWithoutPlaintext", "ReEncryptFrom", "ReEncryptTo", "Sign", "Verify", "GetPublicKey", "CreateGrant", "RetireGrant", "DescribeKey", "GenerateDataKeyPair", "GenerateDataKeyPairWithoutPlaintext", "GenerateMac", "VerifyMac", "DeriveSharedSecret"
7465
7776
  # resp.grants[0].constraints.encryption_context_subset #=> Hash
7466
7777
  # resp.grants[0].constraints.encryption_context_subset["EncryptionContextKey"] #=> String
7467
7778
  # resp.grants[0].constraints.encryption_context_equals #=> Hash
@@ -8299,7 +8610,7 @@ module Aws::KMS
8299
8610
  # resp.replica_key_metadata.creation_date #=> Time
8300
8611
  # resp.replica_key_metadata.enabled #=> Boolean
8301
8612
  # resp.replica_key_metadata.description #=> String
8302
- # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC"
8613
+ # resp.replica_key_metadata.key_usage #=> String, one of "SIGN_VERIFY", "ENCRYPT_DECRYPT", "GENERATE_VERIFY_MAC", "KEY_AGREEMENT"
8303
8614
  # resp.replica_key_metadata.key_state #=> String, one of "Creating", "Enabled", "Disabled", "PendingDeletion", "PendingImport", "PendingReplicaDeletion", "Unavailable", "Updating"
8304
8615
  # resp.replica_key_metadata.deletion_date #=> Time
8305
8616
  # resp.replica_key_metadata.valid_to #=> Time
@@ -8314,6 +8625,8 @@ module Aws::KMS
8314
8625
  # resp.replica_key_metadata.encryption_algorithms[0] #=> String, one of "SYMMETRIC_DEFAULT", "RSAES_OAEP_SHA_1", "RSAES_OAEP_SHA_256", "SM2PKE"
8315
8626
  # resp.replica_key_metadata.signing_algorithms #=> Array
8316
8627
  # resp.replica_key_metadata.signing_algorithms[0] #=> String, one of "RSASSA_PSS_SHA_256", "RSASSA_PSS_SHA_384", "RSASSA_PSS_SHA_512", "RSASSA_PKCS1_V1_5_SHA_256", "RSASSA_PKCS1_V1_5_SHA_384", "RSASSA_PKCS1_V1_5_SHA_512", "ECDSA_SHA_256", "ECDSA_SHA_384", "ECDSA_SHA_512", "SM2DSA"
8628
+ # resp.replica_key_metadata.key_agreement_algorithms #=> Array
8629
+ # resp.replica_key_metadata.key_agreement_algorithms[0] #=> String, one of "ECDH"
8317
8630
  # resp.replica_key_metadata.multi_region #=> Boolean
8318
8631
  # resp.replica_key_metadata.multi_region_configuration.multi_region_key_type #=> String, one of "PRIMARY", "REPLICA"
8319
8632
  # resp.replica_key_metadata.multi_region_configuration.primary_key.arn #=> String
@@ -10433,7 +10746,7 @@ module Aws::KMS
10433
10746
  params: params,
10434
10747
  config: config)
10435
10748
  context[:gem_name] = 'aws-sdk-kms'
10436
- context[:gem_version] = '1.79.0'
10749
+ context[:gem_version] = '1.85.0'
10437
10750
  Seahorse::Client::Request.new(handlers, context)
10438
10751
  end
10439
10752