createCertificateAuthorityAuditReport method
Creates an audit report that lists every time that your CA private key is used to issue a certificate. The IssueCertificate and RevokeCertificate actions use the private key.
To save the audit report to your designated Amazon S3 bucket, you must create a bucket policy that grants Amazon Web Services Private CA permission to access and write to it. For an example policy, see Prepare an Amazon S3 bucket for audit reports.
Amazon Web Services Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see Encrypting Your Audit Reports.
May throw InvalidArgsException.
May throw InvalidArnException.
May throw InvalidStateException.
May throw RequestFailedException.
May throw RequestInProgressException.
May throw ResourceNotFoundException.
Parameter auditReportResponseFormat :
The format in which to create the report. This can be either JSON
or CSV.
Parameter certificateAuthorityArn :
The Amazon Resource Name (ARN) of the CA to be audited. This is of the
form:
arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
.
Parameter s3BucketName :
The name of the S3 bucket that will contain the audit report.
Implementation
Future<CreateCertificateAuthorityAuditReportResponse>
createCertificateAuthorityAuditReport({
required AuditReportResponseFormat auditReportResponseFormat,
required String certificateAuthorityArn,
required String s3BucketName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ACMPrivateCA.CreateCertificateAuthorityAuditReport'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AuditReportResponseFormat': auditReportResponseFormat.value,
'CertificateAuthorityArn': certificateAuthorityArn,
'S3BucketName': s3BucketName,
},
);
return CreateCertificateAuthorityAuditReportResponse.fromJson(
jsonResponse.body);
}