stopKeyUsage method
Disables an Amazon Web Services Payment Cryptography key, which makes it inactive within Amazon Web Services Payment Cryptography.
You can use this operation instead of DeleteKey to deactivate a key. You can enable the key in the future by calling StartKeyUsage.
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 ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw ValidationException.
Parameter keyIdentifier :
The KeyArn of the key.
Implementation
Future<StopKeyUsageOutput> stopKeyUsage({
required String keyIdentifier,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PaymentCryptographyControlPlane.StopKeyUsage'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'KeyIdentifier': keyIdentifier,
},
);
return StopKeyUsageOutput.fromJson(jsonResponse.body);
}