translateKeyMaterial method
- required IncomingKeyMaterial incomingKeyMaterial,
- required OutgoingKeyMaterial outgoingKeyMaterial,
- KeyCheckValueAlgorithm? keyCheckValueAlgorithm,
Translates an cryptographic key between different wrapping keys without importing the key into Amazon Web Services Payment Cryptography.
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 PEK generated for each transaction and wrapped with an ECDH derived wrapping key to another KEK wrapping key.
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
TranslateKeyData, 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 information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.
Cross-account use: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see Resource-based policies.
Related operations:
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter incomingKeyMaterial :
Parameter information of the TR31WrappedKeyBlock containing the
transaction key.
Parameter outgoingKeyMaterial :
Parameter information of the wrapping key used to wrap the transaction key
in the outgoing TR31WrappedKeyBlock.
Parameter keyCheckValueAlgorithm :
The key check value (KCV) algorithm used for calculating the KCV of the
derived key.
Implementation
Future<TranslateKeyMaterialOutput> translateKeyMaterial({
required IncomingKeyMaterial incomingKeyMaterial,
required OutgoingKeyMaterial outgoingKeyMaterial,
KeyCheckValueAlgorithm? keyCheckValueAlgorithm,
}) async {
final $payload = <String, dynamic>{
'IncomingKeyMaterial': incomingKeyMaterial,
'OutgoingKeyMaterial': outgoingKeyMaterial,
if (keyCheckValueAlgorithm != null)
'KeyCheckValueAlgorithm': keyCheckValueAlgorithm.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/keymaterial/translate',
exceptionFnMap: _exceptionFns,
);
return TranslateKeyMaterialOutput.fromJson(response);
}