Skip to content

Commit bcb39c2

Browse files
author
awstools
committed
feat(client-payment-cryptography): Add support for certificates to be signed by 3rd party certificate authorities. New API GetCertificateSigningRequest API and support for providing certificates at run-time for tr-34 import/export
1 parent ad2b2ef commit bcb39c2

File tree

10 files changed

+593
-11
lines changed

10 files changed

+593
-11
lines changed

clients/client-payment-cryptography/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,14 @@ GetAlias
274274

275275
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/payment-cryptography/command/GetAliasCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-payment-cryptography/Interface/GetAliasCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-payment-cryptography/Interface/GetAliasCommandOutput/)
276276

277+
</details>
278+
<details>
279+
<summary>
280+
GetCertificateSigningRequest
281+
</summary>
282+
283+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/payment-cryptography/command/GetCertificateSigningRequestCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-payment-cryptography/Interface/GetCertificateSigningRequestCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-payment-cryptography/Interface/GetCertificateSigningRequestCommandOutput/)
284+
277285
</details>
278286
<details>
279287
<summary>

clients/client-payment-cryptography/src/PaymentCryptography.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ import {
2323
} from "./commands/EnableDefaultKeyReplicationRegionsCommand";
2424
import { ExportKeyCommand, ExportKeyCommandInput, ExportKeyCommandOutput } from "./commands/ExportKeyCommand";
2525
import { GetAliasCommand, GetAliasCommandInput, GetAliasCommandOutput } from "./commands/GetAliasCommand";
26+
import {
27+
GetCertificateSigningRequestCommand,
28+
GetCertificateSigningRequestCommandInput,
29+
GetCertificateSigningRequestCommandOutput,
30+
} from "./commands/GetCertificateSigningRequestCommand";
2631
import {
2732
GetDefaultKeyReplicationRegionsCommand,
2833
GetDefaultKeyReplicationRegionsCommandInput,
@@ -87,6 +92,7 @@ const commands = {
8792
EnableDefaultKeyReplicationRegionsCommand,
8893
ExportKeyCommand,
8994
GetAliasCommand,
95+
GetCertificateSigningRequestCommand,
9096
GetDefaultKeyReplicationRegionsCommand,
9197
GetKeyCommand,
9298
GetParametersForExportCommand,
@@ -223,6 +229,23 @@ export interface PaymentCryptography {
223229
cb: (err: any, data?: GetAliasCommandOutput) => void
224230
): void;
225231

232+
/**
233+
* @see {@link GetCertificateSigningRequestCommand}
234+
*/
235+
getCertificateSigningRequest(
236+
args: GetCertificateSigningRequestCommandInput,
237+
options?: __HttpHandlerOptions
238+
): Promise<GetCertificateSigningRequestCommandOutput>;
239+
getCertificateSigningRequest(
240+
args: GetCertificateSigningRequestCommandInput,
241+
cb: (err: any, data?: GetCertificateSigningRequestCommandOutput) => void
242+
): void;
243+
getCertificateSigningRequest(
244+
args: GetCertificateSigningRequestCommandInput,
245+
options: __HttpHandlerOptions,
246+
cb: (err: any, data?: GetCertificateSigningRequestCommandOutput) => void
247+
): void;
248+
226249
/**
227250
* @see {@link GetDefaultKeyReplicationRegionsCommand}
228251
*/

clients/client-payment-cryptography/src/PaymentCryptographyClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ import {
7171
} from "./commands/EnableDefaultKeyReplicationRegionsCommand";
7272
import { ExportKeyCommandInput, ExportKeyCommandOutput } from "./commands/ExportKeyCommand";
7373
import { GetAliasCommandInput, GetAliasCommandOutput } from "./commands/GetAliasCommand";
74+
import {
75+
GetCertificateSigningRequestCommandInput,
76+
GetCertificateSigningRequestCommandOutput,
77+
} from "./commands/GetCertificateSigningRequestCommand";
7478
import {
7579
GetDefaultKeyReplicationRegionsCommandInput,
7680
GetDefaultKeyReplicationRegionsCommandOutput,
@@ -129,6 +133,7 @@ export type ServiceInputTypes =
129133
| EnableDefaultKeyReplicationRegionsCommandInput
130134
| ExportKeyCommandInput
131135
| GetAliasCommandInput
136+
| GetCertificateSigningRequestCommandInput
132137
| GetDefaultKeyReplicationRegionsCommandInput
133138
| GetKeyCommandInput
134139
| GetParametersForExportCommandInput
@@ -159,6 +164,7 @@ export type ServiceOutputTypes =
159164
| EnableDefaultKeyReplicationRegionsCommandOutput
160165
| ExportKeyCommandOutput
161166
| GetAliasCommandOutput
167+
| GetCertificateSigningRequestCommandOutput
162168
| GetDefaultKeyReplicationRegionsCommandOutput
163169
| GetKeyCommandOutput
164170
| GetParametersForExportCommandOutput

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ export interface ExportKeyCommandOutput extends ExportKeyOutput, __MetadataBeare
7070
* Tr34KeyBlock: { // ExportTr34KeyBlock
7171
* CertificateAuthorityPublicKeyIdentifier: "STRING_VALUE", // required
7272
* WrappingKeyCertificate: "STRING_VALUE", // required
73-
* ExportToken: "STRING_VALUE", // required
73+
* ExportToken: "STRING_VALUE",
74+
* SigningKeyIdentifier: "STRING_VALUE",
75+
* SigningKeyCertificate: "STRING_VALUE",
7476
* KeyBlockFormat: "STRING_VALUE", // required
7577
* RandomNonce: "STRING_VALUE",
7678
* KeyBlockHeaders: {
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import {
9+
GetCertificateSigningRequestInput,
10+
GetCertificateSigningRequestOutput,
11+
GetCertificateSigningRequestOutputFilterSensitiveLog,
12+
} from "../models/models_0";
13+
import {
14+
PaymentCryptographyClientResolvedConfig,
15+
ServiceInputTypes,
16+
ServiceOutputTypes,
17+
} from "../PaymentCryptographyClient";
18+
import {
19+
de_GetCertificateSigningRequestCommand,
20+
se_GetCertificateSigningRequestCommand,
21+
} from "../protocols/Aws_json1_0";
22+
23+
/**
24+
* @public
25+
*/
26+
export type { __MetadataBearer };
27+
export { $Command };
28+
/**
29+
* @public
30+
*
31+
* The input for {@link GetCertificateSigningRequestCommand}.
32+
*/
33+
export interface GetCertificateSigningRequestCommandInput extends GetCertificateSigningRequestInput {}
34+
/**
35+
* @public
36+
*
37+
* The output of {@link GetCertificateSigningRequestCommand}.
38+
*/
39+
export interface GetCertificateSigningRequestCommandOutput
40+
extends GetCertificateSigningRequestOutput,
41+
__MetadataBearer {}
42+
43+
/**
44+
* Used to retrieve the public key for a keypair.
45+
* @example
46+
* Use a bare-bones client and the command you need to make an API call.
47+
* ```javascript
48+
* import { PaymentCryptographyClient, GetCertificateSigningRequestCommand } from "@aws-sdk/client-payment-cryptography"; // ES Modules import
49+
* // const { PaymentCryptographyClient, GetCertificateSigningRequestCommand } = require("@aws-sdk/client-payment-cryptography"); // CommonJS import
50+
* const client = new PaymentCryptographyClient(config);
51+
* const input = { // GetCertificateSigningRequestInput
52+
* KeyIdentifier: "STRING_VALUE", // required
53+
* SigningAlgorithm: "STRING_VALUE", // required
54+
* CertificateSubject: { // CertificateSubjectType
55+
* CommonName: "STRING_VALUE", // required
56+
* OrganizationUnit: "STRING_VALUE",
57+
* Organization: "STRING_VALUE",
58+
* City: "STRING_VALUE",
59+
* Country: "STRING_VALUE",
60+
* StateOrProvince: "STRING_VALUE",
61+
* EmailAddress: "STRING_VALUE",
62+
* },
63+
* };
64+
* const command = new GetCertificateSigningRequestCommand(input);
65+
* const response = await client.send(command);
66+
* // { // GetCertificateSigningRequestOutput
67+
* // CertificateSigningRequest: "STRING_VALUE", // required
68+
* // };
69+
*
70+
* ```
71+
*
72+
* @param GetCertificateSigningRequestCommandInput - {@link GetCertificateSigningRequestCommandInput}
73+
* @returns {@link GetCertificateSigningRequestCommandOutput}
74+
* @see {@link GetCertificateSigningRequestCommandInput} for command's `input` shape.
75+
* @see {@link GetCertificateSigningRequestCommandOutput} for command's `response` shape.
76+
* @see {@link PaymentCryptographyClientResolvedConfig | config} for PaymentCryptographyClient's `config` shape.
77+
*
78+
* @throws {@link AccessDeniedException} (client fault)
79+
* <p>You do not have sufficient access to perform this action.</p> <p>This exception is thrown when the caller lacks the necessary IAM permissions to perform the requested operation. Verify that your IAM policy includes the required permissions for the specific Amazon Web Services Payment Cryptography action you're attempting.</p>
80+
*
81+
* @throws {@link InternalServerException} (server fault)
82+
* <p>The request processing has failed because of an unknown error, exception, or failure.</p> <p>This indicates a server-side error within the Amazon Web Services Payment Cryptography service. If this error persists, contact support for assistance.</p>
83+
*
84+
* @throws {@link ResourceNotFoundException} (client fault)
85+
* <p>The request was denied due to resource not found.</p> <p>The specified key, alias, or other resource does not exist in your account or region. Verify that the resource identifier is correct and that the resource exists in the expected region.</p>
86+
*
87+
* @throws {@link ServiceUnavailableException} (server fault)
88+
* <p>The service cannot complete the request.</p> <p>The Amazon Web Services Payment Cryptography service is temporarily unavailable. This is typically a temporary condition - retry your request after a brief delay.</p>
89+
*
90+
* @throws {@link ThrottlingException} (client fault)
91+
* <p>The request was denied due to request throttling.</p> <p>You have exceeded the rate limits for Amazon Web Services Payment Cryptography API calls. Implement exponential backoff and retry logic in your application to handle throttling gracefully.</p>
92+
*
93+
* @throws {@link ValidationException} (client fault)
94+
* <p>The request was denied due to an invalid request error.</p> <p>One or more parameters in your request are invalid. Check the parameter values, formats, and constraints specified in the API documentation.</p>
95+
*
96+
* @throws {@link PaymentCryptographyServiceException}
97+
* <p>Base exception class for all service exceptions from PaymentCryptography service.</p>
98+
*
99+
*
100+
* @public
101+
*/
102+
export class GetCertificateSigningRequestCommand extends $Command
103+
.classBuilder<
104+
GetCertificateSigningRequestCommandInput,
105+
GetCertificateSigningRequestCommandOutput,
106+
PaymentCryptographyClientResolvedConfig,
107+
ServiceInputTypes,
108+
ServiceOutputTypes
109+
>()
110+
.ep(commonParams)
111+
.m(function (this: any, Command: any, cs: any, config: PaymentCryptographyClientResolvedConfig, o: any) {
112+
return [
113+
getSerdePlugin(config, this.serialize, this.deserialize),
114+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
115+
];
116+
})
117+
.s("PaymentCryptographyControlPlane", "GetCertificateSigningRequest", {})
118+
.n("PaymentCryptographyClient", "GetCertificateSigningRequestCommand")
119+
.f(void 0, GetCertificateSigningRequestOutputFilterSensitiveLog)
120+
.ser(se_GetCertificateSigningRequestCommand)
121+
.de(de_GetCertificateSigningRequestCommand)
122+
.build() {
123+
/** @internal type navigation helper, not in runtime. */
124+
protected declare static __types: {
125+
api: {
126+
input: GetCertificateSigningRequestInput;
127+
output: GetCertificateSigningRequestOutput;
128+
};
129+
sdk: {
130+
input: GetCertificateSigningRequestCommandInput;
131+
output: GetCertificateSigningRequestCommandOutput;
132+
};
133+
};
134+
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ export interface ImportKeyCommandOutput extends ImportKeyOutput, __MetadataBeare
8787
* Tr34KeyBlock: { // ImportTr34KeyBlock
8888
* CertificateAuthorityPublicKeyIdentifier: "STRING_VALUE", // required
8989
* SigningKeyCertificate: "STRING_VALUE", // required
90-
* ImportToken: "STRING_VALUE", // required
90+
* ImportToken: "STRING_VALUE",
91+
* WrappingKeyIdentifier: "STRING_VALUE",
92+
* WrappingKeyCertificate: "STRING_VALUE",
9193
* WrappedKeyBlock: "STRING_VALUE", // required
9294
* KeyBlockFormat: "STRING_VALUE", // required
9395
* RandomNonce: "STRING_VALUE",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from "./DisableDefaultKeyReplicationRegionsCommand";
88
export * from "./EnableDefaultKeyReplicationRegionsCommand";
99
export * from "./ExportKeyCommand";
1010
export * from "./GetAliasCommand";
11+
export * from "./GetCertificateSigningRequestCommand";
1112
export * from "./GetDefaultKeyReplicationRegionsCommand";
1213
export * from "./GetKeyCommand";
1314
export * from "./GetParametersForExportCommand";

0 commit comments

Comments
 (0)