Skip to content

Commit 1489723

Browse files
author
awstools
committed
feat(client-kms): This release includes feature to import customer's asymmetric (RSA, ECC and SM2) and HMAC keys into KMS in China.
1 parent 03f1f70 commit 1489723

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

clients/client-kms/src/commands/GetParametersForImportCommand.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
5252
* material.</p>
5353
* <ul>
5454
* <li>
55-
* <p>The public key (or "wrapping key") of an RSA key pair that KMS generates.</p>
55+
* <p>The public key (or "wrapping key") of an asymmetric key pair that KMS generates.</p>
5656
* <p>You will use this public key to encrypt ("wrap") your key material while it's in
5757
* transit to KMS. </p>
5858
* </li>
@@ -116,8 +116,8 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
116116
* const client = new KMSClient(config);
117117
* const input = { // GetParametersForImportRequest
118118
* KeyId: "STRING_VALUE", // required
119-
* WrappingAlgorithm: "RSAES_PKCS1_V1_5" || "RSAES_OAEP_SHA_1" || "RSAES_OAEP_SHA_256" || "RSA_AES_KEY_WRAP_SHA_1" || "RSA_AES_KEY_WRAP_SHA_256", // required
120-
* WrappingKeySpec: "RSA_2048" || "RSA_3072" || "RSA_4096", // required
119+
* WrappingAlgorithm: "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", // required
120+
* WrappingKeySpec: "RSA_2048" || "RSA_3072" || "RSA_4096" || "SM2", // required
121121
* };
122122
* const command = new GetParametersForImportCommand(input);
123123
* const response = await client.send(command);

clients/client-kms/src/models/models_0.ts

+19-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const AlgorithmSpec = {
1313
RSAES_PKCS1_V1_5: "RSAES_PKCS1_V1_5",
1414
RSA_AES_KEY_WRAP_SHA_1: "RSA_AES_KEY_WRAP_SHA_1",
1515
RSA_AES_KEY_WRAP_SHA_256: "RSA_AES_KEY_WRAP_SHA_256",
16+
SM2PKE: "SM2PKE",
1617
} as const;
1718

1819
/**
@@ -4211,6 +4212,7 @@ export const WrappingKeySpec = {
42114212
RSA_2048: "RSA_2048",
42124213
RSA_3072: "RSA_3072",
42134214
RSA_4096: "RSA_4096",
4215+
SM2: "SM2",
42144216
} as const;
42154217

42164218
/**
@@ -4245,13 +4247,19 @@ export interface GetParametersForImportRequest {
42454247
KeyId: string | undefined;
42464248

42474249
/**
4248-
* <p>The algorithm you will use with the RSA public key (<code>PublicKey</code>) in the
4250+
* <p>The algorithm you will use with the asymmetric public key (<code>PublicKey</code>) in the
42494251
* 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>
42504252
* <p>For RSA_AES wrapping algorithms, you encrypt your key material with an AES key that you
42514253
* generate, then encrypt your AES key with the RSA public key from KMS. For RSAES wrapping
4252-
* algorithms, you encrypt your key material directly with the RSA public key from KMS.</p>
4254+
* algorithms, you encrypt your key material directly with the RSA public key from KMS.
4255+
* For SM2PKE wrapping algorithms, you encrypt your key material directly with the SM2 public key
4256+
* from KMS.</p>
42534257
* <p>The wrapping algorithms that you can use depend on the type of key material that you are
4254-
* importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm.</p>
4258+
* importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm, except
4259+
* in China Regions, where you must use the SM2PKE wrapping algorithm to import an RSA private key.</p>
4260+
* <p>The SM2PKE wrapping algorithm is available only in China Regions. The
4261+
* <code>RSA_AES_KEY_WRAP_SHA_256</code> and <code>RSA_AES_KEY_WRAP_SHA_1</code>
4262+
* wrapping algorithms are not supported in China Regions.</p>
42554263
* <ul>
42564264
* <li>
42574265
* <p>
@@ -4282,17 +4290,23 @@ export interface GetParametersForImportRequest {
42824290
* <b>RSAES_PKCS1_V1_5</b> (Deprecated) — As of October
42834291
* 10, 2023, KMS does not support the RSAES_PKCS1_V1_5 wrapping algorithm.</p>
42844292
* </li>
4293+
* <li>
4294+
* <p>
4295+
* <b>SM2PKE</b> (China Regions only) — supported for
4296+
* wrapping RSA, ECC, and SM2 key material.</p>
4297+
* </li>
42854298
* </ul>
42864299
* @public
42874300
*/
42884301
WrappingAlgorithm: AlgorithmSpec | undefined;
42894302

42904303
/**
4291-
* <p>The type of RSA public key to return in the response. You will use this wrapping key with
4304+
* <p>The type of public key to return in the response. You will use this wrapping key with
42924305
* the specified wrapping algorithm to protect your key material during import. </p>
4293-
* <p>Use the longest RSA wrapping key that is practical. </p>
4306+
* <p>Use the longest wrapping key that is practical. </p>
42944307
* <p>You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key.
42954308
* Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key.</p>
4309+
* <p>The SM2 wrapping key spec is available only in China Regions.</p>
42964310
* @public
42974311
*/
42984312
WrappingKeySpec: WrappingKeySpec | undefined;

0 commit comments

Comments
 (0)