|
| 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 | + TranslateKeyMaterialInput, |
| 10 | + TranslateKeyMaterialInputFilterSensitiveLog, |
| 11 | + TranslateKeyMaterialOutput, |
| 12 | + TranslateKeyMaterialOutputFilterSensitiveLog, |
| 13 | +} from "../models/models_0"; |
| 14 | +import { |
| 15 | + PaymentCryptographyDataClientResolvedConfig, |
| 16 | + ServiceInputTypes, |
| 17 | + ServiceOutputTypes, |
| 18 | +} from "../PaymentCryptographyDataClient"; |
| 19 | +import { de_TranslateKeyMaterialCommand, se_TranslateKeyMaterialCommand } from "../protocols/Aws_restJson1"; |
| 20 | + |
| 21 | +/** |
| 22 | + * @public |
| 23 | + */ |
| 24 | +export type { __MetadataBearer }; |
| 25 | +export { $Command }; |
| 26 | +/** |
| 27 | + * @public |
| 28 | + * |
| 29 | + * The input for {@link TranslateKeyMaterialCommand}. |
| 30 | + */ |
| 31 | +export interface TranslateKeyMaterialCommandInput extends TranslateKeyMaterialInput {} |
| 32 | +/** |
| 33 | + * @public |
| 34 | + * |
| 35 | + * The output of {@link TranslateKeyMaterialCommand}. |
| 36 | + */ |
| 37 | +export interface TranslateKeyMaterialCommandOutput extends TranslateKeyMaterialOutput, __MetadataBearer {} |
| 38 | + |
| 39 | +/** |
| 40 | + * <p>Translates an encryption key between different wrapping keys without importing the key into Amazon Web Services Payment Cryptography.</p> <p>This operation can be used when key material is frequently rotated, such as during every card transaction, and there is a need to avoid importing short-lived keys into Amazon Web Services Payment Cryptography. It translates short-lived transaction keys such as Pin Encryption Key (PEK) generated for each transaction and wrapped with an ECDH (Elliptic Curve Diffie-Hellman) derived wrapping key to another KEK (Key Encryption Key) wrapping key. </p> <p>Before using this operation, you must first request the public key certificate of the ECC key pair generated within Amazon Web Services Payment Cryptography to establish an ECDH key agreement. In <code>TranslateKeyData</code>, the service uses its own ECC key pair, public certificate of receiving ECC key pair, and the key derivation parameters to generate a derived key. The service uses this derived key to unwrap the incoming transaction key received as a TR31WrappedKeyBlock and re-wrap using a user provided KEK to generate an outgoing Tr31WrappedKeyBlock. For more information on establishing ECDH derived keys, see the <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html">Creating keys</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p> <p>For information about valid keys for this operation, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html">Understanding key attributes</a> and <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html">Key types for specific data operations</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>. </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_CreateKey.html">CreateKey</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html">GetPublicCertificate</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a> </p> </li> </ul> |
| 41 | + * @example |
| 42 | + * Use a bare-bones client and the command you need to make an API call. |
| 43 | + * ```javascript |
| 44 | + * import { PaymentCryptographyDataClient, TranslateKeyMaterialCommand } from "@aws-sdk/client-payment-cryptography-data"; // ES Modules import |
| 45 | + * // const { PaymentCryptographyDataClient, TranslateKeyMaterialCommand } = require("@aws-sdk/client-payment-cryptography-data"); // CommonJS import |
| 46 | + * // import type { PaymentCryptographyDataClientConfig } from "@aws-sdk/client-payment-cryptography-data"; |
| 47 | + * const config = {}; // type is PaymentCryptographyDataClientConfig |
| 48 | + * const client = new PaymentCryptographyDataClient(config); |
| 49 | + * const input = { // TranslateKeyMaterialInput |
| 50 | + * IncomingKeyMaterial: { // IncomingKeyMaterial Union: only one key present |
| 51 | + * DiffieHellmanTr31KeyBlock: { // IncomingDiffieHellmanTr31KeyBlock |
| 52 | + * PrivateKeyIdentifier: "STRING_VALUE", // required |
| 53 | + * CertificateAuthorityPublicKeyIdentifier: "STRING_VALUE", // required |
| 54 | + * PublicKeyCertificate: "STRING_VALUE", // required |
| 55 | + * DeriveKeyAlgorithm: "TDES_2KEY" || "TDES_3KEY" || "AES_128" || "AES_192" || "AES_256" || "HMAC_SHA256" || "HMAC_SHA384" || "HMAC_SHA512" || "HMAC_SHA224", // required |
| 56 | + * KeyDerivationFunction: "NIST_SP800" || "ANSI_X963", // required |
| 57 | + * KeyDerivationHashAlgorithm: "SHA_256" || "SHA_384" || "SHA_512", // required |
| 58 | + * DerivationData: { // DiffieHellmanDerivationData Union: only one key present |
| 59 | + * SharedInformation: "STRING_VALUE", |
| 60 | + * }, |
| 61 | + * WrappedKeyBlock: "STRING_VALUE", // required |
| 62 | + * }, |
| 63 | + * }, |
| 64 | + * OutgoingKeyMaterial: { // OutgoingKeyMaterial Union: only one key present |
| 65 | + * Tr31KeyBlock: { // OutgoingTr31KeyBlock |
| 66 | + * WrappingKeyIdentifier: "STRING_VALUE", // required |
| 67 | + * }, |
| 68 | + * }, |
| 69 | + * KeyCheckValueAlgorithm: "STRING_VALUE", |
| 70 | + * }; |
| 71 | + * const command = new TranslateKeyMaterialCommand(input); |
| 72 | + * const response = await client.send(command); |
| 73 | + * // { // TranslateKeyMaterialOutput |
| 74 | + * // WrappedKey: { // WrappedWorkingKey |
| 75 | + * // WrappedKeyMaterial: "STRING_VALUE", // required |
| 76 | + * // KeyCheckValue: "STRING_VALUE", // required |
| 77 | + * // WrappedKeyMaterialFormat: "STRING_VALUE", // required |
| 78 | + * // }, |
| 79 | + * // }; |
| 80 | + * |
| 81 | + * ``` |
| 82 | + * |
| 83 | + * @param TranslateKeyMaterialCommandInput - {@link TranslateKeyMaterialCommandInput} |
| 84 | + * @returns {@link TranslateKeyMaterialCommandOutput} |
| 85 | + * @see {@link TranslateKeyMaterialCommandInput} for command's `input` shape. |
| 86 | + * @see {@link TranslateKeyMaterialCommandOutput} for command's `response` shape. |
| 87 | + * @see {@link PaymentCryptographyDataClientResolvedConfig | config} for PaymentCryptographyDataClient's `config` shape. |
| 88 | + * |
| 89 | + * @throws {@link AccessDeniedException} (client fault) |
| 90 | + * <p>You do not have sufficient access to perform this action.</p> |
| 91 | + * |
| 92 | + * @throws {@link InternalServerException} (server fault) |
| 93 | + * <p>The request processing has failed because of an unknown error, exception, or failure.</p> |
| 94 | + * |
| 95 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 96 | + * <p>The request was denied due to an invalid resource error.</p> |
| 97 | + * |
| 98 | + * @throws {@link ThrottlingException} (client fault) |
| 99 | + * <p>The request was denied due to request throttling.</p> |
| 100 | + * |
| 101 | + * @throws {@link ValidationException} (client fault) |
| 102 | + * <p>The request was denied due to an invalid request error.</p> |
| 103 | + * |
| 104 | + * @throws {@link PaymentCryptographyDataServiceException} |
| 105 | + * <p>Base exception class for all service exceptions from PaymentCryptographyData service.</p> |
| 106 | + * |
| 107 | + * |
| 108 | + * @public |
| 109 | + */ |
| 110 | +export class TranslateKeyMaterialCommand extends $Command |
| 111 | + .classBuilder< |
| 112 | + TranslateKeyMaterialCommandInput, |
| 113 | + TranslateKeyMaterialCommandOutput, |
| 114 | + PaymentCryptographyDataClientResolvedConfig, |
| 115 | + ServiceInputTypes, |
| 116 | + ServiceOutputTypes |
| 117 | + >() |
| 118 | + .ep(commonParams) |
| 119 | + .m(function (this: any, Command: any, cs: any, config: PaymentCryptographyDataClientResolvedConfig, o: any) { |
| 120 | + return [ |
| 121 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 122 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 123 | + ]; |
| 124 | + }) |
| 125 | + .s("PaymentCryptographyDataPlane", "TranslateKeyMaterial", {}) |
| 126 | + .n("PaymentCryptographyDataClient", "TranslateKeyMaterialCommand") |
| 127 | + .f(TranslateKeyMaterialInputFilterSensitiveLog, TranslateKeyMaterialOutputFilterSensitiveLog) |
| 128 | + .ser(se_TranslateKeyMaterialCommand) |
| 129 | + .de(de_TranslateKeyMaterialCommand) |
| 130 | + .build() { |
| 131 | + /** @internal type navigation helper, not in runtime. */ |
| 132 | + protected declare static __types: { |
| 133 | + api: { |
| 134 | + input: TranslateKeyMaterialInput; |
| 135 | + output: TranslateKeyMaterialOutput; |
| 136 | + }; |
| 137 | + sdk: { |
| 138 | + input: TranslateKeyMaterialCommandInput; |
| 139 | + output: TranslateKeyMaterialCommandOutput; |
| 140 | + }; |
| 141 | + }; |
| 142 | +} |
0 commit comments