Skip to content

Commit 7627474

Browse files
author
awstools
committed
feat(client-payment-cryptography): Adds optional support to retrieve previously generated import and export tokens to simplify import and export functions
1 parent 4aa232c commit 7627474

5 files changed

Lines changed: 37 additions & 10 deletions

File tree

clients/client-payment-cryptography/src/commands/GetParametersForExportCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface GetParametersForExportCommandInput extends GetParametersForExpo
3131
export interface GetParametersForExportCommandOutput extends GetParametersForExportOutput, __MetadataBearer {}
3232

3333
/**
34-
* <p>Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.</p> <p>The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html">ExportKey</a>. The export token expires in 30 days. You can use the same export token to export multiple keys from your service account.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html">ExportKey</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForImport.html">GetParametersForImport</a> </p> </li> </ul>
34+
* <p>Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.</p> <p>The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html">ExportKey</a>. The export token expires in 30 days. You can use the same export token to export multiple keys from your service account.</p> <p>To return a previously generated export token and signing key certificate instead of generating new ones, set <code>ReuseLastGeneratedToken</code> to <code>true</code>.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html">ExportKey</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForImport.html">GetParametersForImport</a> </p> </li> </ul>
3535
* @example
3636
* Use a bare-bones client and the command you need to make an API call.
3737
* ```javascript
@@ -43,6 +43,7 @@ export interface GetParametersForExportCommandOutput extends GetParametersForExp
4343
* const input = { // GetParametersForExportInput
4444
* KeyMaterialType: "STRING_VALUE", // required
4545
* SigningKeyAlgorithm: "STRING_VALUE", // required
46+
* ReuseLastGeneratedToken: true || false,
4647
* };
4748
* const command = new GetParametersForExportCommand(input);
4849
* const response = await client.send(command);

clients/client-payment-cryptography/src/commands/GetParametersForImportCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface GetParametersForImportCommandInput extends GetParametersForImpo
3131
export interface GetParametersForImportCommandOutput extends GetParametersForImportOutput, __MetadataBearer {}
3232

3333
/**
34-
* <p>Gets the import token and the wrapping key certificate in PEM format (base64 encoded) to initiate a TR-34 WrappedKeyBlock or a RSA WrappedKeyCryptogram import into Amazon Web Services Payment Cryptography.</p> <p>The wrapping key certificate wraps the key under import. The import token and wrapping key certificate must be in place and operational before calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a>. The import token expires in 30 days. You can use the same import token to import multiple keys into your service account.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForExport.html">GetParametersForExport</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a> </p> </li> </ul>
34+
* <p>Gets the import token and the wrapping key certificate in PEM format (base64 encoded) to initiate a TR-34 WrappedKeyBlock or a RSA WrappedKeyCryptogram import into Amazon Web Services Payment Cryptography.</p> <p>The wrapping key certificate wraps the key under import. The import token and wrapping key certificate must be in place and operational before calling <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a>. The import token expires in 30 days. You can use the same import token to import multiple keys into your service account.</p> <p>To return a previously generated import token and wrapping key certificate instead of generating new ones, set <code>ReuseLastGeneratedToken</code> to <code>true</code>.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForExport.html">GetParametersForExport</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a> </p> </li> </ul>
3535
* @example
3636
* Use a bare-bones client and the command you need to make an API call.
3737
* ```javascript
@@ -43,6 +43,7 @@ export interface GetParametersForImportCommandOutput extends GetParametersForImp
4343
* const input = { // GetParametersForImportInput
4444
* KeyMaterialType: "STRING_VALUE", // required
4545
* WrappingKeyAlgorithm: "STRING_VALUE", // required
46+
* ReuseLastGeneratedToken: true || false,
4647
* };
4748
* const command = new GetParametersForImportCommand(input);
4849
* const response = await client.send(command);

clients/client-payment-cryptography/src/models/models_0.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,12 @@ export interface GetParametersForExportInput {
11581158
* @public
11591159
*/
11601160
SigningKeyAlgorithm: KeyAlgorithm | undefined;
1161+
1162+
/**
1163+
* <p>Specifies whether to reuse the existing export token and signing key certificate. If set to <code>true</code> and a valid export token exists for the same key material type and signing key algorithm with at least 7 days of remaining validity, the existing token and signing key certificate are returned. Otherwise, a new export token and signing key certificate are generated. The default value is <code>false</code>, which generates a new export token and signing key certificate on every call.</p>
1164+
* @public
1165+
*/
1166+
ReuseLastGeneratedToken?: boolean | undefined;
11611167
}
11621168

11631169
/**
@@ -1210,6 +1216,12 @@ export interface GetParametersForImportInput {
12101216
* @public
12111217
*/
12121218
WrappingKeyAlgorithm: KeyAlgorithm | undefined;
1219+
1220+
/**
1221+
* <p>Specifies whether to reuse the existing import token and wrapping key certificate. If set to <code>true</code> and a valid import token exists for the same key material type and wrapping key algorithm with at least 7 days of remaining validity, the existing token and wrapping key certificate are returned. Otherwise, a new import token and wrapping key certificate are generated. The default value is <code>false</code>, which generates a new import token and wrapping key certificate on every call.</p>
1222+
* @public
1223+
*/
1224+
ReuseLastGeneratedToken?: boolean | undefined;
12131225
}
12141226

12151227
/**
@@ -1263,7 +1275,7 @@ export interface GetPublicKeyCertificateInput {
12631275
*/
12641276
export interface GetPublicKeyCertificateOutput {
12651277
/**
1266-
* <p>The public key component of the asymmetric key pair in a certificate PEM format (base64 encoded). It is signed by the root certificate authority (CA). The certificate expires in 90 days.</p>
1278+
* <p>The public key component of the asymmetric key pair in a certificate PEM format (base64 encoded). It is signed by the root certificate authority (CA). The certificate is valid for 90 days from the time it is issued. The service returns a cached certificate if one exists with at least 30 days of remaining validity. Otherwise, a new 90-day certificate is issued.</p>
12671279
* @public
12681280
*/
12691281
KeyCertificate: string | undefined;

clients/client-payment-cryptography/src/schemas/schemas_0.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ const _RKO = "RestoreKeyOutput";
155155
const _RKRR = "RemoveKeyReplicationRegions";
156156
const _RKRRI = "RemoveKeyReplicationRegionsInput";
157157
const _RKRRO = "RemoveKeyReplicationRegionsOutput";
158+
const _RLGT = "ReuseLastGeneratedToken";
158159
const _RN = "RandomNonce";
159160
const _RNFE = "ResourceNotFoundException";
160161
const _RR = "ReplicationRegions";
@@ -481,8 +482,8 @@ export var GetKeyOutput$: StaticStructureSchema = [3, n0, _GKO,
481482
];
482483
export var GetParametersForExportInput$: StaticStructureSchema = [3, n0, _GPFEI,
483484
0,
484-
[_KMT, _SKA],
485-
[0, 0], 2
485+
[_KMT, _SKA, _RLGT],
486+
[0, 0, 2], 2
486487
];
487488
export var GetParametersForExportOutput$: StaticStructureSchema = [3, n0, _GPFEO,
488489
0,
@@ -491,8 +492,8 @@ export var GetParametersForExportOutput$: StaticStructureSchema = [3, n0, _GPFEO
491492
];
492493
export var GetParametersForImportInput$: StaticStructureSchema = [3, n0, _GPFII,
493494
0,
494-
[_KMT, _WKA],
495-
[0, 0], 2
495+
[_KMT, _WKA, _RLGT],
496+
[0, 0, 2], 2
496497
];
497498
export var GetParametersForImportOutput$: StaticStructureSchema = [3, n0, _GPFIO,
498499
0,

codegen/sdk-codegen/aws-models/payment-cryptography.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@
15451545
],
15461546
"traits": {
15471547
"aws.api#controlPlane": {},
1548-
"smithy.api#documentation": "<p>Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.</p> <p>The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html\">ExportKey</a>. The export token expires in 30 days. You can use the same export token to export multiple keys from your service account.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html\">ExportKey</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForImport.html\">GetParametersForImport</a> </p> </li> </ul>"
1548+
"smithy.api#documentation": "<p>Gets the export token and the signing key certificate to initiate a TR-34 key export from Amazon Web Services Payment Cryptography.</p> <p>The signing key certificate signs the wrapped key under export within the TR-34 key payload. The export token and signing key certificate must be in place and operational before calling <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html\">ExportKey</a>. The export token expires in 30 days. You can use the same export token to export multiple keys from your service account.</p> <p>To return a previously generated export token and signing key certificate instead of generating new ones, set <code>ReuseLastGeneratedToken</code> to <code>true</code>.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ExportKey.html\">ExportKey</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForImport.html\">GetParametersForImport</a> </p> </li> </ul>"
15491549
}
15501550
},
15511551
"com.amazonaws.paymentcryptography#GetParametersForExportInput": {
@@ -1564,6 +1564,12 @@
15641564
"smithy.api#documentation": "<p>The signing key algorithm to generate a signing key certificate. This certificate signs the wrapped key under export within the TR-34 key block. <code>RSA_2048</code> is the only signing key algorithm allowed.</p>",
15651565
"smithy.api#required": {}
15661566
}
1567+
},
1568+
"ReuseLastGeneratedToken": {
1569+
"target": "smithy.api#Boolean",
1570+
"traits": {
1571+
"smithy.api#documentation": "<p>Specifies whether to reuse the existing export token and signing key certificate. If set to <code>true</code> and a valid export token exists for the same key material type and signing key algorithm with at least 7 days of remaining validity, the existing token and signing key certificate are returned. Otherwise, a new export token and signing key certificate are generated. The default value is <code>false</code>, which generates a new export token and signing key certificate on every call.</p>"
1572+
}
15671573
}
15681574
},
15691575
"traits": {
@@ -1649,7 +1655,7 @@
16491655
],
16501656
"traits": {
16511657
"aws.api#controlPlane": {},
1652-
"smithy.api#documentation": "<p>Gets the import token and the wrapping key certificate in PEM format (base64 encoded) to initiate a TR-34 WrappedKeyBlock or a RSA WrappedKeyCryptogram import into Amazon Web Services Payment Cryptography.</p> <p>The wrapping key certificate wraps the key under import. The import token and wrapping key certificate must be in place and operational before calling <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html\">ImportKey</a>. The import token expires in 30 days. You can use the same import token to import multiple keys into your service account.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForExport.html\">GetParametersForExport</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html\">ImportKey</a> </p> </li> </ul>"
1658+
"smithy.api#documentation": "<p>Gets the import token and the wrapping key certificate in PEM format (base64 encoded) to initiate a TR-34 WrappedKeyBlock or a RSA WrappedKeyCryptogram import into Amazon Web Services Payment Cryptography.</p> <p>The wrapping key certificate wraps the key under import. The import token and wrapping key certificate must be in place and operational before calling <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html\">ImportKey</a>. The import token expires in 30 days. You can use the same import token to import multiple keys into your service account.</p> <p>To return a previously generated import token and wrapping key certificate instead of generating new ones, set <code>ReuseLastGeneratedToken</code> to <code>true</code>.</p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetParametersForExport.html\">GetParametersForExport</a> </p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html\">ImportKey</a> </p> </li> </ul>"
16531659
}
16541660
},
16551661
"com.amazonaws.paymentcryptography#GetParametersForImportInput": {
@@ -1668,6 +1674,12 @@
16681674
"smithy.api#documentation": "<p>The wrapping key algorithm to generate a wrapping key certificate. This certificate wraps the key under import.</p> <p>At this time, <code>RSA_2048</code> is the allowed algorithm for TR-34 WrappedKeyBlock import. Additionally, <code>RSA_2048</code>, <code>RSA_3072</code>, <code>RSA_4096</code> are the allowed algorithms for RSA WrappedKeyCryptogram import.</p>",
16691675
"smithy.api#required": {}
16701676
}
1677+
},
1678+
"ReuseLastGeneratedToken": {
1679+
"target": "smithy.api#Boolean",
1680+
"traits": {
1681+
"smithy.api#documentation": "<p>Specifies whether to reuse the existing import token and wrapping key certificate. If set to <code>true</code> and a valid import token exists for the same key material type and wrapping key algorithm with at least 7 days of remaining validity, the existing token and wrapping key certificate are returned. Otherwise, a new import token and wrapping key certificate are generated. The default value is <code>false</code>, which generates a new import token and wrapping key certificate on every call.</p>"
1682+
}
16711683
}
16721684
},
16731685
"traits": {
@@ -1772,7 +1784,7 @@
17721784
"KeyCertificate": {
17731785
"target": "com.amazonaws.paymentcryptography#CertificateType",
17741786
"traits": {
1775-
"smithy.api#documentation": "<p>The public key component of the asymmetric key pair in a certificate PEM format (base64 encoded). It is signed by the root certificate authority (CA). The certificate expires in 90 days.</p>",
1787+
"smithy.api#documentation": "<p>The public key component of the asymmetric key pair in a certificate PEM format (base64 encoded). It is signed by the root certificate authority (CA). The certificate is valid for 90 days from the time it is issued. The service returns a cached certificate if one exists with at least 30 days of remaining validity. Otherwise, a new 90-day certificate is issued.</p>",
17761788
"smithy.api#required": {}
17771789
}
17781790
},

0 commit comments

Comments
 (0)