getCertificate method
Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the IssueCertificate action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the GetCertificate action. You can retrieve the certificate if it is in the ISSUED state. You can call the CreateCertificateAuthorityAuditReport action to create a report that contains information about all of the certificates issued and revoked by your private CA.
May throw RequestInProgressException. May throw RequestFailedException. May throw ResourceNotFoundException. May throw InvalidArnException. May throw InvalidStateException.
Parameter certificateArn
:
The ARN of the issued certificate. The ARN contains the certificate serial
number and must be in the following form:
arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012/certificate/286535153982981100925020015808220737245
Parameter certificateAuthorityArn
:
The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority.
This must be of the form:
arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
.
Implementation
Future<GetCertificateResponse> getCertificate({
required String certificateArn,
required String certificateAuthorityArn,
}) async {
ArgumentError.checkNotNull(certificateArn, 'certificateArn');
_s.validateStringLength(
'certificateArn',
certificateArn,
5,
200,
isRequired: true,
);
ArgumentError.checkNotNull(
certificateAuthorityArn, 'certificateAuthorityArn');
_s.validateStringLength(
'certificateAuthorityArn',
certificateAuthorityArn,
5,
200,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ACMPrivateCA.GetCertificate'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'CertificateArn': certificateArn,
'CertificateAuthorityArn': certificateAuthorityArn,
},
);
return GetCertificateResponse.fromJson(jsonResponse.body);
}