@aws-sdk/client-kms 3.596.0 → 3.597.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.
Files changed (39) hide show
  1. package/README.md +8 -0
  2. package/dist-cjs/index.js +72 -0
  3. package/dist-es/KMS.js +2 -0
  4. package/dist-es/commands/DeriveSharedSecretCommand.js +25 -0
  5. package/dist-es/commands/index.js +1 -0
  6. package/dist-es/models/models_0.js +9 -0
  7. package/dist-es/protocols/Aws_json1_1.js +40 -0
  8. package/dist-types/KMS.d.ts +7 -0
  9. package/dist-types/KMSClient.d.ts +3 -2
  10. package/dist-types/commands/CreateGrantCommand.d.ts +1 -1
  11. package/dist-types/commands/CreateKeyCommand.d.ts +11 -5
  12. package/dist-types/commands/DecryptCommand.d.ts +2 -1
  13. package/dist-types/commands/DeriveSharedSecretCommand.d.ts +224 -0
  14. package/dist-types/commands/DescribeKeyCommand.d.ts +4 -1
  15. package/dist-types/commands/EncryptCommand.d.ts +2 -1
  16. package/dist-types/commands/GenerateDataKeyCommand.d.ts +2 -1
  17. package/dist-types/commands/GenerateDataKeyPairCommand.d.ts +2 -1
  18. package/dist-types/commands/GenerateDataKeyPairWithoutPlaintextCommand.d.ts +2 -1
  19. package/dist-types/commands/GenerateDataKeyWithoutPlaintextCommand.d.ts +2 -1
  20. package/dist-types/commands/GenerateMacCommand.d.ts +2 -1
  21. package/dist-types/commands/GetParametersForImportCommand.d.ts +1 -1
  22. package/dist-types/commands/GetPublicKeyCommand.d.ts +8 -3
  23. package/dist-types/commands/ListGrantsCommand.d.ts +1 -1
  24. package/dist-types/commands/ListRetirableGrantsCommand.d.ts +1 -1
  25. package/dist-types/commands/ReEncryptCommand.d.ts +2 -1
  26. package/dist-types/commands/ReplicateKeyCommand.d.ts +4 -1
  27. package/dist-types/commands/SignCommand.d.ts +2 -1
  28. package/dist-types/commands/VerifyCommand.d.ts +2 -1
  29. package/dist-types/commands/VerifyMacCommand.d.ts +2 -1
  30. package/dist-types/commands/index.d.ts +1 -0
  31. package/dist-types/models/models_0.d.ts +182 -33
  32. package/dist-types/protocols/Aws_json1_1.d.ts +9 -0
  33. package/dist-types/ts3.4/KMS.d.ts +17 -0
  34. package/dist-types/ts3.4/KMSClient.d.ts +6 -0
  35. package/dist-types/ts3.4/commands/DeriveSharedSecretCommand.d.ts +40 -0
  36. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  37. package/dist-types/ts3.4/models/models_0.d.ts +27 -0
  38. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +12 -0
  39. package/package.json +1 -1
@@ -917,6 +917,7 @@ export interface GrantConstraints {
917
917
  export declare const GrantOperation: {
918
918
  readonly CreateGrant: "CreateGrant";
919
919
  readonly Decrypt: "Decrypt";
920
+ readonly DeriveSharedSecret: "DeriveSharedSecret";
920
921
  readonly DescribeKey: "DescribeKey";
921
922
  readonly Encrypt: "Encrypt";
922
923
  readonly GenerateDataKey: "GenerateDataKey";
@@ -1166,6 +1167,7 @@ export type KeySpec = (typeof KeySpec)[keyof typeof KeySpec];
1166
1167
  export declare const KeyUsageType: {
1167
1168
  readonly ENCRYPT_DECRYPT: "ENCRYPT_DECRYPT";
1168
1169
  readonly GENERATE_VERIFY_MAC: "GENERATE_VERIFY_MAC";
1170
+ readonly KEY_AGREEMENT: "KEY_AGREEMENT";
1169
1171
  readonly SIGN_VERIFY: "SIGN_VERIFY";
1170
1172
  };
1171
1173
  /**
@@ -1266,16 +1268,20 @@ export interface CreateKeyRequest {
1266
1268
  * <p>For HMAC KMS keys (symmetric), specify <code>GENERATE_VERIFY_MAC</code>.</p>
1267
1269
  * </li>
1268
1270
  * <li>
1269
- * <p>For asymmetric KMS keys with RSA key material, specify <code>ENCRYPT_DECRYPT</code> or
1271
+ * <p>For asymmetric KMS keys with RSA key pairs, specify <code>ENCRYPT_DECRYPT</code> or
1270
1272
  * <code>SIGN_VERIFY</code>.</p>
1271
1273
  * </li>
1272
1274
  * <li>
1273
- * <p>For asymmetric KMS keys with ECC key material, specify
1275
+ * <p>For asymmetric KMS keys with NIST-recommended elliptic curve key pairs, specify
1276
+ * <code>SIGN_VERIFY</code> or <code>KEY_AGREEMENT</code>.</p>
1277
+ * </li>
1278
+ * <li>
1279
+ * <p>For asymmetric KMS keys with <code>ECC_SECG_P256K1</code> key pairs specify
1274
1280
  * <code>SIGN_VERIFY</code>.</p>
1275
1281
  * </li>
1276
1282
  * <li>
1277
- * <p>For asymmetric KMS keys with SM2 key material (China Regions only), specify
1278
- * <code>ENCRYPT_DECRYPT</code> or <code>SIGN_VERIFY</code>.</p>
1283
+ * <p>For asymmetric KMS keys with SM2 key pairs (China Regions only), specify
1284
+ * <code>ENCRYPT_DECRYPT</code>, <code>SIGN_VERIFY</code>, or <code>KEY_AGREEMENT</code>.</p>
1279
1285
  * </li>
1280
1286
  * </ul>
1281
1287
  * @public
@@ -1349,7 +1355,7 @@ export interface CreateKeyRequest {
1349
1355
  * </ul>
1350
1356
  * </li>
1351
1357
  * <li>
1352
- * <p>Asymmetric RSA key pairs</p>
1358
+ * <p>Asymmetric RSA key pairs (encryption and decryption -or- signing and verification)</p>
1353
1359
  * <ul>
1354
1360
  * <li>
1355
1361
  * <p>
@@ -1369,7 +1375,7 @@ export interface CreateKeyRequest {
1369
1375
  * </ul>
1370
1376
  * </li>
1371
1377
  * <li>
1372
- * <p>Asymmetric NIST-recommended elliptic curve key pairs</p>
1378
+ * <p>Asymmetric NIST-recommended elliptic curve key pairs (signing and verification -or- deriving shared secrets)</p>
1373
1379
  * <ul>
1374
1380
  * <li>
1375
1381
  * <p>
@@ -1386,7 +1392,7 @@ export interface CreateKeyRequest {
1386
1392
  * </ul>
1387
1393
  * </li>
1388
1394
  * <li>
1389
- * <p>Other asymmetric elliptic curve key pairs</p>
1395
+ * <p>Other asymmetric elliptic curve key pairs (signing and verification)</p>
1390
1396
  * <ul>
1391
1397
  * <li>
1392
1398
  * <p>
@@ -1396,12 +1402,11 @@ export interface CreateKeyRequest {
1396
1402
  * </ul>
1397
1403
  * </li>
1398
1404
  * <li>
1399
- * <p>SM2 key pairs (China Regions only)</p>
1405
+ * <p>SM2 key pairs (encryption and decryption -or- signing and verification -or- deriving shared secrets)</p>
1400
1406
  * <ul>
1401
1407
  * <li>
1402
1408
  * <p>
1403
- * <code>SM2</code>
1404
- * </p>
1409
+ * <code>SM2</code> (China Regions only)</p>
1405
1410
  * </li>
1406
1411
  * </ul>
1407
1412
  * </li>
@@ -1547,6 +1552,17 @@ export declare const ExpirationModelType: {
1547
1552
  * @public
1548
1553
  */
1549
1554
  export type ExpirationModelType = (typeof ExpirationModelType)[keyof typeof ExpirationModelType];
1555
+ /**
1556
+ * @public
1557
+ * @enum
1558
+ */
1559
+ export declare const KeyAgreementAlgorithmSpec: {
1560
+ readonly ECDH: "ECDH";
1561
+ };
1562
+ /**
1563
+ * @public
1564
+ */
1565
+ export type KeyAgreementAlgorithmSpec = (typeof KeyAgreementAlgorithmSpec)[keyof typeof KeyAgreementAlgorithmSpec];
1550
1566
  /**
1551
1567
  * @public
1552
1568
  * @enum
@@ -1820,6 +1836,11 @@ export interface KeyMetadata {
1820
1836
  * @public
1821
1837
  */
1822
1838
  SigningAlgorithms?: SigningAlgorithmSpec[];
1839
+ /**
1840
+ * <p>The key agreement algorithm used to derive a shared secret.</p>
1841
+ * @public
1842
+ */
1843
+ KeyAgreementAlgorithms?: KeyAgreementAlgorithmSpec[];
1823
1844
  /**
1824
1845
  * <p>Indicates whether the KMS key is a multi-Region (<code>True</code>) or regional
1825
1846
  * (<code>False</code>) key. This value is <code>True</code> for multi-Region primary and
@@ -2533,7 +2554,8 @@ export declare class InvalidCiphertextException extends __BaseException {
2533
2554
  * <code>KeyUsage</code> must be <code>ENCRYPT_DECRYPT</code>. For signing and verifying
2534
2555
  * messages, the <code>KeyUsage</code> must be <code>SIGN_VERIFY</code>. For generating and
2535
2556
  * verifying message authentication codes (MACs), the <code>KeyUsage</code> must be
2536
- * <code>GENERATE_VERIFY_MAC</code>. To find the <code>KeyUsage</code> of a KMS key, use the
2557
+ * <code>GENERATE_VERIFY_MAC</code>. For deriving key agreement secrets, the
2558
+ * <code>KeyUsage</code> must be <code>KEY_AGREEMENT</code>. To find the <code>KeyUsage</code> of a KMS key, use the
2537
2559
  * <a>DescribeKey</a> operation.</p>
2538
2560
  * <p>To find the encryption or signing algorithms supported for a particular KMS key, use the
2539
2561
  * <a>DescribeKey</a> operation.</p>
@@ -2610,6 +2632,134 @@ export interface DeleteImportedKeyMaterialRequest {
2610
2632
  */
2611
2633
  KeyId: string | undefined;
2612
2634
  }
2635
+ /**
2636
+ * @public
2637
+ */
2638
+ export interface DeriveSharedSecretRequest {
2639
+ /**
2640
+ * <p>Identifies an asymmetric NIST-recommended ECC or SM2 (China Regions only) KMS key. KMS
2641
+ * uses the private key in the specified key pair to derive the shared secret. The key usage of
2642
+ * the KMS key must be <code>KEY_AGREEMENT</code>. To find the
2643
+ * <code>KeyUsage</code> of a KMS key, use the <a>DescribeKey</a> operation.</p>
2644
+ * <p>To specify a KMS key, use its key ID, key ARN, alias name, or alias ARN. When using an alias name, prefix it with <code>"alias/"</code>. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN or alias ARN.</p>
2645
+ * <p>For example:</p>
2646
+ * <ul>
2647
+ * <li>
2648
+ * <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code>
2649
+ * </p>
2650
+ * </li>
2651
+ * <li>
2652
+ * <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>
2653
+ * </p>
2654
+ * </li>
2655
+ * <li>
2656
+ * <p>Alias name: <code>alias/ExampleAlias</code>
2657
+ * </p>
2658
+ * </li>
2659
+ * <li>
2660
+ * <p>Alias ARN: <code>arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias</code>
2661
+ * </p>
2662
+ * </li>
2663
+ * </ul>
2664
+ * <p>To get the key ID and key ARN for a KMS key, use <a>ListKeys</a> or <a>DescribeKey</a>. To get the alias name and alias ARN, use <a>ListAliases</a>.</p>
2665
+ * @public
2666
+ */
2667
+ KeyId: string | undefined;
2668
+ /**
2669
+ * <p>Specifies the key agreement algorithm used to derive the shared secret. The only valid value is <code>ECDH</code>.</p>
2670
+ * @public
2671
+ */
2672
+ KeyAgreementAlgorithm: KeyAgreementAlgorithmSpec | undefined;
2673
+ /**
2674
+ * <p>Specifies the public key in your peer's NIST-recommended elliptic curve (ECC) or SM2 (China Regions only) key pair.</p>
2675
+ * <p>The public key must be a DER-encoded X.509 public key, also known as <code>SubjectPublicKeyInfo</code> (SPKI), as defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.</p>
2676
+ * <p>
2677
+ * <a>GetPublicKey</a> returns the public key of an asymmetric KMS key pair in the required DER-encoded format.</p>
2678
+ * <note>
2679
+ * <p>If you use <a href="https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-welcome.html">Amazon Web Services CLI version 1</a>,
2680
+ * you must provide the DER-encoded X.509 public key in a file. Otherwise, the Amazon Web Services CLI Base64-encodes the public key a
2681
+ * second time, resulting in a <code>ValidationException</code>.</p>
2682
+ * </note>
2683
+ * <p>You can specify the public key as binary data in a file using fileb (<code>fileb://<path-to-file></code>) or
2684
+ * in-line using a Base64 encoded string.</p>
2685
+ * @public
2686
+ */
2687
+ PublicKey: Uint8Array | undefined;
2688
+ /**
2689
+ * <p>A list of grant tokens.</p>
2690
+ * <p>Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved <i>eventual consistency</i>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant token</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token">Using a grant token</a> in the
2691
+ * <i>Key Management Service Developer Guide</i>.</p>
2692
+ * @public
2693
+ */
2694
+ GrantTokens?: string[];
2695
+ /**
2696
+ * <p>Checks if your request will succeed. <code>DryRun</code> is an optional parameter. </p>
2697
+ * <p>To learn more about how to use this parameter, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/programming-dryrun.html">Testing your KMS API calls</a> in the <i>Key Management Service Developer Guide</i>.</p>
2698
+ * @public
2699
+ */
2700
+ DryRun?: boolean;
2701
+ /**
2702
+ * <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from
2703
+ * an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The
2704
+ * only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>. </p>
2705
+ * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To call
2706
+ * DeriveSharedSecret for an Amazon Web Services Nitro Enclaves, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> to generate the attestation
2707
+ * document and then use the Recipient parameter from any Amazon Web Services SDK to provide the attestation
2708
+ * document for the enclave.</p>
2709
+ * <p>When you use this parameter, instead of returning a plaintext copy of the shared secret,
2710
+ * KMS encrypts the plaintext shared secret under the public key in the attestation
2711
+ * document, and returns the resulting ciphertext in the <code>CiphertextForRecipient</code>
2712
+ * field in the response. This ciphertext can be decrypted only with the private key in the
2713
+ * enclave. The <code>CiphertextBlob</code> field in the response contains the encrypted shared
2714
+ * secret derived from the KMS key specified by the <code>KeyId</code> parameter and public key
2715
+ * specified by the <code>PublicKey</code> parameter. The <code>SharedSecret</code> field in
2716
+ * the response is null or empty.</p>
2717
+ * <p>For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2718
+ * @public
2719
+ */
2720
+ Recipient?: RecipientInfo;
2721
+ }
2722
+ /**
2723
+ * @public
2724
+ */
2725
+ export interface DeriveSharedSecretResponse {
2726
+ /**
2727
+ * <p>Identifies the KMS key used to derive the shared secret.</p>
2728
+ * @public
2729
+ */
2730
+ KeyId?: string;
2731
+ /**
2732
+ * <p>The raw secret derived from the specified key agreement algorithm, private key in the
2733
+ * asymmetric KMS key, and your peer's public key.</p>
2734
+ * <p>If the response includes the <code>CiphertextForRecipient</code> field, the <code>SharedSecret</code> field is null or
2735
+ * empty.</p>
2736
+ * @public
2737
+ */
2738
+ SharedSecret?: Uint8Array;
2739
+ /**
2740
+ * <p>The plaintext shared secret encrypted with the public key in the attestation document.</p>
2741
+ * <p>This field is included in the response only when the <code>Recipient</code> parameter in
2742
+ * the request includes a valid attestation document from an Amazon Web Services Nitro enclave.
2743
+ * For information about the interaction between KMS and Amazon Web Services Nitro Enclaves, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html">How Amazon Web Services Nitro Enclaves uses KMS</a> in the <i>Key Management Service Developer Guide</i>.</p>
2744
+ * @public
2745
+ */
2746
+ CiphertextForRecipient?: Uint8Array;
2747
+ /**
2748
+ * <p>Identifies the key agreement algorithm used to derive the shared secret.</p>
2749
+ * @public
2750
+ */
2751
+ KeyAgreementAlgorithm?: KeyAgreementAlgorithmSpec;
2752
+ /**
2753
+ * <p>The source of the key material for the specified KMS key.</p>
2754
+ * <p>When this value is <code>AWS_KMS</code>, KMS created the key material. When this value is <code>EXTERNAL</code>,
2755
+ * the key material was imported or the KMS key doesn't have any key material.</p>
2756
+ * <p>The only valid values for DeriveSharedSecret are <code>AWS_KMS</code> and <code>EXTERNAL</code>. DeriveSharedSecret
2757
+ * does not support KMS keys with a <code>KeyOrigin</code> value of <code>AWS_CLOUDHSM</code> or
2758
+ * <code>EXTERNAL_KEY_STORE</code>.</p>
2759
+ * @public
2760
+ */
2761
+ KeyOrigin?: OriginType;
2762
+ }
2613
2763
  /**
2614
2764
  * @public
2615
2765
  */
@@ -3156,8 +3306,10 @@ export interface GenerateDataKeyPairRequest {
3156
3306
  * <p>A signed <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc">attestation document</a> from
3157
3307
  * an Amazon Web Services Nitro enclave and the encryption algorithm to use with the enclave's public key. The
3158
3308
  * only valid encryption algorithm is <code>RSAES_OAEP_SHA_256</code>. </p>
3159
- * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To include this
3160
- * parameter, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> or any Amazon Web Services SDK.</p>
3309
+ * <p>This parameter only supports attestation documents for Amazon Web Services Nitro Enclaves. To call
3310
+ * DeriveSharedSecret for an Amazon Web Services Nitro Enclaves, use the <a href="https://docs.aws.amazon.com/enclaves/latest/user/developing-applications.html#sdk">Amazon Web Services Nitro Enclaves SDK</a> to generate the attestation
3311
+ * document and then use the Recipient parameter from any Amazon Web Services SDK to provide the attestation
3312
+ * document for the enclave.</p>
3161
3313
  * <p>When you use this parameter, instead of returning a plaintext copy of the private data
3162
3314
  * key, KMS encrypts the plaintext private data key under the public key in the attestation
3163
3315
  * document, and returns the resulting ciphertext in the <code>CiphertextForRecipient</code>
@@ -3658,19 +3810,13 @@ export interface GetParametersForImportRequest {
3658
3810
  */
3659
3811
  KeyId: string | undefined;
3660
3812
  /**
3661
- * <p>The algorithm you will use with the asymmetric public key (<code>PublicKey</code>) in the
3813
+ * <p>The algorithm you will use with the RSA public key (<code>PublicKey</code>) in the
3662
3814
  * response to protect your key material during import. For more information, see <a href="kms/latest/developerguide/importing-keys-get-public-key-and-token.html#select-wrapping-algorithm">Select a wrapping algorithm</a> in the <i>Key Management Service Developer Guide</i>.</p>
3663
3815
  * <p>For RSA_AES wrapping algorithms, you encrypt your key material with an AES key that you
3664
3816
  * generate, then encrypt your AES key with the RSA public key from KMS. For RSAES wrapping
3665
- * algorithms, you encrypt your key material directly with the RSA public key from KMS.
3666
- * For SM2PKE wrapping algorithms, you encrypt your key material directly with the SM2 public key
3667
- * from KMS.</p>
3817
+ * algorithms, you encrypt your key material directly with the RSA public key from KMS.</p>
3668
3818
  * <p>The wrapping algorithms that you can use depend on the type of key material that you are
3669
- * importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm, except
3670
- * in China Regions, where you must use the SM2PKE wrapping algorithm to import an RSA private key.</p>
3671
- * <p>The SM2PKE wrapping algorithm is available only in China Regions. The
3672
- * <code>RSA_AES_KEY_WRAP_SHA_256</code> and <code>RSA_AES_KEY_WRAP_SHA_1</code>
3673
- * wrapping algorithms are not supported in China Regions.</p>
3819
+ * importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm.</p>
3674
3820
  * <ul>
3675
3821
  * <li>
3676
3822
  * <p>
@@ -3701,22 +3847,16 @@ export interface GetParametersForImportRequest {
3701
3847
  * <b>RSAES_PKCS1_V1_5</b> (Deprecated) — As of October
3702
3848
  * 10, 2023, KMS does not support the RSAES_PKCS1_V1_5 wrapping algorithm.</p>
3703
3849
  * </li>
3704
- * <li>
3705
- * <p>
3706
- * <b>SM2PKE</b> (China Regions only) — supported for
3707
- * wrapping RSA, ECC, and SM2 key material.</p>
3708
- * </li>
3709
3850
  * </ul>
3710
3851
  * @public
3711
3852
  */
3712
3853
  WrappingAlgorithm: AlgorithmSpec | undefined;
3713
3854
  /**
3714
- * <p>The type of public key to return in the response. You will use this wrapping key with
3855
+ * <p>The type of RSA public key to return in the response. You will use this wrapping key with
3715
3856
  * the specified wrapping algorithm to protect your key material during import. </p>
3716
- * <p>Use the longest wrapping key that is practical. </p>
3857
+ * <p>Use the longest RSA wrapping key that is practical. </p>
3717
3858
  * <p>You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key.
3718
3859
  * Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key.</p>
3719
- * <p>The SM2 wrapping key spec is available only in China Regions.</p>
3720
3860
  * @public
3721
3861
  */
3722
3862
  WrappingKeySpec: WrappingKeySpec | undefined;
@@ -3823,9 +3963,9 @@ export interface GetPublicKeyResponse {
3823
3963
  */
3824
3964
  KeySpec?: KeySpec;
3825
3965
  /**
3826
- * <p>The permitted use of the public key. Valid values are <code>ENCRYPT_DECRYPT</code> or
3827
- * <code>SIGN_VERIFY</code>. </p>
3828
- * <p>This information is critical. If a public key with <code>SIGN_VERIFY</code> key usage
3966
+ * <p>The permitted use of the public key. Valid values for asymmetric key pairs are <code>ENCRYPT_DECRYPT</code>,
3967
+ * <code>SIGN_VERIFY</code>, and <code>KEY_AGREEMENT</code>. </p>
3968
+ * <p>This information is critical. For example, if a public key with <code>SIGN_VERIFY</code> key usage
3829
3969
  * encrypts data outside of KMS, the ciphertext cannot be decrypted. </p>
3830
3970
  * @public
3831
3971
  */
@@ -3846,6 +3986,11 @@ export interface GetPublicKeyResponse {
3846
3986
  * @public
3847
3987
  */
3848
3988
  SigningAlgorithms?: SigningAlgorithmSpec[];
3989
+ /**
3990
+ * <p>The key agreement algorithm used to derive a shared secret. This field is present only when the KMS key has a <code>KeyUsage</code> value of <code>KEY_AGREEMENT</code>.</p>
3991
+ * @public
3992
+ */
3993
+ KeyAgreementAlgorithms?: KeyAgreementAlgorithmSpec[];
3849
3994
  }
3850
3995
  /**
3851
3996
  * <p>Contains information about a grant.</p>
@@ -5757,6 +5902,10 @@ export declare const CustomKeyStoresListEntryFilterSensitiveLog: (obj: CustomKey
5757
5902
  * @internal
5758
5903
  */
5759
5904
  export declare const DecryptResponseFilterSensitiveLog: (obj: DecryptResponse) => any;
5905
+ /**
5906
+ * @internal
5907
+ */
5908
+ export declare const DeriveSharedSecretResponseFilterSensitiveLog: (obj: DeriveSharedSecretResponse) => any;
5760
5909
  /**
5761
5910
  * @internal
5762
5911
  */
@@ -10,6 +10,7 @@ import { DecryptCommandInput, DecryptCommandOutput } from "../commands/DecryptCo
10
10
  import { DeleteAliasCommandInput, DeleteAliasCommandOutput } from "../commands/DeleteAliasCommand";
11
11
  import { DeleteCustomKeyStoreCommandInput, DeleteCustomKeyStoreCommandOutput } from "../commands/DeleteCustomKeyStoreCommand";
12
12
  import { DeleteImportedKeyMaterialCommandInput, DeleteImportedKeyMaterialCommandOutput } from "../commands/DeleteImportedKeyMaterialCommand";
13
+ import { DeriveSharedSecretCommandInput, DeriveSharedSecretCommandOutput } from "../commands/DeriveSharedSecretCommand";
13
14
  import { DescribeCustomKeyStoresCommandInput, DescribeCustomKeyStoresCommandOutput } from "../commands/DescribeCustomKeyStoresCommand";
14
15
  import { DescribeKeyCommandInput, DescribeKeyCommandOutput } from "../commands/DescribeKeyCommand";
15
16
  import { DisableKeyCommandInput, DisableKeyCommandOutput } from "../commands/DisableKeyCommand";
@@ -92,6 +93,10 @@ export declare const se_DeleteCustomKeyStoreCommand: (input: DeleteCustomKeyStor
92
93
  * serializeAws_json1_1DeleteImportedKeyMaterialCommand
93
94
  */
94
95
  export declare const se_DeleteImportedKeyMaterialCommand: (input: DeleteImportedKeyMaterialCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
96
+ /**
97
+ * serializeAws_json1_1DeriveSharedSecretCommand
98
+ */
99
+ export declare const se_DeriveSharedSecretCommand: (input: DeriveSharedSecretCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
95
100
  /**
96
101
  * serializeAws_json1_1DescribeCustomKeyStoresCommand
97
102
  */
@@ -300,6 +305,10 @@ export declare const de_DeleteCustomKeyStoreCommand: (output: __HttpResponse, co
300
305
  * deserializeAws_json1_1DeleteImportedKeyMaterialCommand
301
306
  */
302
307
  export declare const de_DeleteImportedKeyMaterialCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<DeleteImportedKeyMaterialCommandOutput>;
308
+ /**
309
+ * deserializeAws_json1_1DeriveSharedSecretCommand
310
+ */
311
+ export declare const de_DeriveSharedSecretCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<DeriveSharedSecretCommandOutput>;
303
312
  /**
304
313
  * deserializeAws_json1_1DescribeCustomKeyStoresCommand
305
314
  */
@@ -39,6 +39,10 @@ import {
39
39
  DeleteImportedKeyMaterialCommandInput,
40
40
  DeleteImportedKeyMaterialCommandOutput,
41
41
  } from "./commands/DeleteImportedKeyMaterialCommand";
42
+ import {
43
+ DeriveSharedSecretCommandInput,
44
+ DeriveSharedSecretCommandOutput,
45
+ } from "./commands/DeriveSharedSecretCommand";
42
46
  import {
43
47
  DescribeCustomKeyStoresCommandInput,
44
48
  DescribeCustomKeyStoresCommandOutput,
@@ -337,6 +341,19 @@ export interface KMS {
337
341
  options: __HttpHandlerOptions,
338
342
  cb: (err: any, data?: DeleteImportedKeyMaterialCommandOutput) => void
339
343
  ): void;
344
+ deriveSharedSecret(
345
+ args: DeriveSharedSecretCommandInput,
346
+ options?: __HttpHandlerOptions
347
+ ): Promise<DeriveSharedSecretCommandOutput>;
348
+ deriveSharedSecret(
349
+ args: DeriveSharedSecretCommandInput,
350
+ cb: (err: any, data?: DeriveSharedSecretCommandOutput) => void
351
+ ): void;
352
+ deriveSharedSecret(
353
+ args: DeriveSharedSecretCommandInput,
354
+ options: __HttpHandlerOptions,
355
+ cb: (err: any, data?: DeriveSharedSecretCommandOutput) => void
356
+ ): void;
340
357
  describeCustomKeyStores(): Promise<DescribeCustomKeyStoresCommandOutput>;
341
358
  describeCustomKeyStores(
342
359
  args: DescribeCustomKeyStoresCommandInput,
@@ -85,6 +85,10 @@ import {
85
85
  DeleteImportedKeyMaterialCommandInput,
86
86
  DeleteImportedKeyMaterialCommandOutput,
87
87
  } from "./commands/DeleteImportedKeyMaterialCommand";
88
+ import {
89
+ DeriveSharedSecretCommandInput,
90
+ DeriveSharedSecretCommandOutput,
91
+ } from "./commands/DeriveSharedSecretCommand";
88
92
  import {
89
93
  DescribeCustomKeyStoresCommandInput,
90
94
  DescribeCustomKeyStoresCommandOutput,
@@ -268,6 +272,7 @@ export type ServiceInputTypes =
268
272
  | DeleteAliasCommandInput
269
273
  | DeleteCustomKeyStoreCommandInput
270
274
  | DeleteImportedKeyMaterialCommandInput
275
+ | DeriveSharedSecretCommandInput
271
276
  | DescribeCustomKeyStoresCommandInput
272
277
  | DescribeKeyCommandInput
273
278
  | DisableKeyCommandInput
@@ -321,6 +326,7 @@ export type ServiceOutputTypes =
321
326
  | DeleteAliasCommandOutput
322
327
  | DeleteCustomKeyStoreCommandOutput
323
328
  | DeleteImportedKeyMaterialCommandOutput
329
+ | DeriveSharedSecretCommandOutput
324
330
  | DescribeCustomKeyStoresCommandOutput
325
331
  | DescribeKeyCommandOutput
326
332
  | DisableKeyCommandOutput
@@ -0,0 +1,40 @@
1
+ import { Command as $Command } from "@smithy/smithy-client";
2
+ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
3
+ import {
4
+ KMSClientResolvedConfig,
5
+ ServiceInputTypes,
6
+ ServiceOutputTypes,
7
+ } from "../KMSClient";
8
+ import {
9
+ DeriveSharedSecretRequest,
10
+ DeriveSharedSecretResponse,
11
+ } from "../models/models_0";
12
+ export { __MetadataBearer };
13
+ export { $Command };
14
+ export interface DeriveSharedSecretCommandInput
15
+ extends DeriveSharedSecretRequest {}
16
+ export interface DeriveSharedSecretCommandOutput
17
+ extends DeriveSharedSecretResponse,
18
+ __MetadataBearer {}
19
+ declare const DeriveSharedSecretCommand_base: {
20
+ new (
21
+ input: DeriveSharedSecretCommandInput
22
+ ): import("@smithy/smithy-client").CommandImpl<
23
+ DeriveSharedSecretCommandInput,
24
+ DeriveSharedSecretCommandOutput,
25
+ KMSClientResolvedConfig,
26
+ ServiceInputTypes,
27
+ ServiceOutputTypes
28
+ >;
29
+ new (
30
+ __0_0: DeriveSharedSecretCommandInput
31
+ ): import("@smithy/smithy-client").CommandImpl<
32
+ DeriveSharedSecretCommandInput,
33
+ DeriveSharedSecretCommandOutput,
34
+ KMSClientResolvedConfig,
35
+ ServiceInputTypes,
36
+ ServiceOutputTypes
37
+ >;
38
+ getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
39
+ };
40
+ export declare class DeriveSharedSecretCommand extends DeriveSharedSecretCommand_base {}
@@ -8,6 +8,7 @@ export * from "./DecryptCommand";
8
8
  export * from "./DeleteAliasCommand";
9
9
  export * from "./DeleteCustomKeyStoreCommand";
10
10
  export * from "./DeleteImportedKeyMaterialCommand";
11
+ export * from "./DeriveSharedSecretCommand";
11
12
  export * from "./DescribeCustomKeyStoresCommand";
12
13
  export * from "./DescribeKeyCommand";
13
14
  export * from "./DisableKeyCommand";
@@ -329,6 +329,7 @@ export interface GrantConstraints {
329
329
  export declare const GrantOperation: {
330
330
  readonly CreateGrant: "CreateGrant";
331
331
  readonly Decrypt: "Decrypt";
332
+ readonly DeriveSharedSecret: "DeriveSharedSecret";
332
333
  readonly DescribeKey: "DescribeKey";
333
334
  readonly Encrypt: "Encrypt";
334
335
  readonly GenerateDataKey: "GenerateDataKey";
@@ -415,6 +416,7 @@ export type KeySpec = (typeof KeySpec)[keyof typeof KeySpec];
415
416
  export declare const KeyUsageType: {
416
417
  readonly ENCRYPT_DECRYPT: "ENCRYPT_DECRYPT";
417
418
  readonly GENERATE_VERIFY_MAC: "GENERATE_VERIFY_MAC";
419
+ readonly KEY_AGREEMENT: "KEY_AGREEMENT";
418
420
  readonly SIGN_VERIFY: "SIGN_VERIFY";
419
421
  };
420
422
  export type KeyUsageType = (typeof KeyUsageType)[keyof typeof KeyUsageType];
@@ -456,6 +458,11 @@ export declare const ExpirationModelType: {
456
458
  };
457
459
  export type ExpirationModelType =
458
460
  (typeof ExpirationModelType)[keyof typeof ExpirationModelType];
461
+ export declare const KeyAgreementAlgorithmSpec: {
462
+ readonly ECDH: "ECDH";
463
+ };
464
+ export type KeyAgreementAlgorithmSpec =
465
+ (typeof KeyAgreementAlgorithmSpec)[keyof typeof KeyAgreementAlgorithmSpec];
459
466
  export declare const KeyManagerType: {
460
467
  readonly AWS: "AWS";
461
468
  readonly CUSTOMER: "CUSTOMER";
@@ -533,6 +540,7 @@ export interface KeyMetadata {
533
540
  KeySpec?: KeySpec;
534
541
  EncryptionAlgorithms?: EncryptionAlgorithmSpec[];
535
542
  SigningAlgorithms?: SigningAlgorithmSpec[];
543
+ KeyAgreementAlgorithms?: KeyAgreementAlgorithmSpec[];
536
544
  MultiRegion?: boolean;
537
545
  MultiRegionConfiguration?: MultiRegionConfiguration;
538
546
  PendingDeletionWindowInDays?: number;
@@ -692,6 +700,21 @@ export interface DeleteCustomKeyStoreResponse {}
692
700
  export interface DeleteImportedKeyMaterialRequest {
693
701
  KeyId: string | undefined;
694
702
  }
703
+ export interface DeriveSharedSecretRequest {
704
+ KeyId: string | undefined;
705
+ KeyAgreementAlgorithm: KeyAgreementAlgorithmSpec | undefined;
706
+ PublicKey: Uint8Array | undefined;
707
+ GrantTokens?: string[];
708
+ DryRun?: boolean;
709
+ Recipient?: RecipientInfo;
710
+ }
711
+ export interface DeriveSharedSecretResponse {
712
+ KeyId?: string;
713
+ SharedSecret?: Uint8Array;
714
+ CiphertextForRecipient?: Uint8Array;
715
+ KeyAgreementAlgorithm?: KeyAgreementAlgorithmSpec;
716
+ KeyOrigin?: OriginType;
717
+ }
695
718
  export interface DescribeCustomKeyStoresRequest {
696
719
  CustomKeyStoreId?: string;
697
720
  CustomKeyStoreName?: string;
@@ -880,6 +903,7 @@ export interface GetPublicKeyResponse {
880
903
  KeyUsage?: KeyUsageType;
881
904
  EncryptionAlgorithms?: EncryptionAlgorithmSpec[];
882
905
  SigningAlgorithms?: SigningAlgorithmSpec[];
906
+ KeyAgreementAlgorithms?: KeyAgreementAlgorithmSpec[];
883
907
  }
884
908
  export interface GrantListEntry {
885
909
  KeyId?: string;
@@ -1171,6 +1195,9 @@ export declare const CustomKeyStoresListEntryFilterSensitiveLog: (
1171
1195
  export declare const DecryptResponseFilterSensitiveLog: (
1172
1196
  obj: DecryptResponse
1173
1197
  ) => any;
1198
+ export declare const DeriveSharedSecretResponseFilterSensitiveLog: (
1199
+ obj: DeriveSharedSecretResponse
1200
+ ) => any;
1174
1201
  export declare const DescribeCustomKeyStoresResponseFilterSensitiveLog: (
1175
1202
  obj: DescribeCustomKeyStoresResponse
1176
1203
  ) => any;
@@ -43,6 +43,10 @@ import {
43
43
  DeleteImportedKeyMaterialCommandInput,
44
44
  DeleteImportedKeyMaterialCommandOutput,
45
45
  } from "../commands/DeleteImportedKeyMaterialCommand";
46
+ import {
47
+ DeriveSharedSecretCommandInput,
48
+ DeriveSharedSecretCommandOutput,
49
+ } from "../commands/DeriveSharedSecretCommand";
46
50
  import {
47
51
  DescribeCustomKeyStoresCommandInput,
48
52
  DescribeCustomKeyStoresCommandOutput,
@@ -248,6 +252,10 @@ export declare const se_DeleteImportedKeyMaterialCommand: (
248
252
  input: DeleteImportedKeyMaterialCommandInput,
249
253
  context: __SerdeContext
250
254
  ) => Promise<__HttpRequest>;
255
+ export declare const se_DeriveSharedSecretCommand: (
256
+ input: DeriveSharedSecretCommandInput,
257
+ context: __SerdeContext
258
+ ) => Promise<__HttpRequest>;
251
259
  export declare const se_DescribeCustomKeyStoresCommand: (
252
260
  input: DescribeCustomKeyStoresCommandInput,
253
261
  context: __SerdeContext
@@ -456,6 +464,10 @@ export declare const de_DeleteImportedKeyMaterialCommand: (
456
464
  output: __HttpResponse,
457
465
  context: __SerdeContext
458
466
  ) => Promise<DeleteImportedKeyMaterialCommandOutput>;
467
+ export declare const de_DeriveSharedSecretCommand: (
468
+ output: __HttpResponse,
469
+ context: __SerdeContext
470
+ ) => Promise<DeriveSharedSecretCommandOutput>;
459
471
  export declare const de_DescribeCustomKeyStoresCommand: (
460
472
  output: __HttpResponse,
461
473
  context: __SerdeContext
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kms",
3
3
  "description": "AWS SDK for JavaScript Kms Client for Node.js, Browser and React Native",
4
- "version": "3.596.0",
4
+ "version": "3.597.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-kms",