getCertificate method

Future<GetCertificateResponse> getCertificate({
  1. required String certificateArn,
})

Retrieves an Amazon-issued certificate and its certificate chain. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use OpenSSL to decode the certificates and inspect individual fields.

May throw ResourceNotFoundException. May throw RequestInProgressException. May throw InvalidArnException.

Parameter certificateArn : String that contains a certificate ARN in the following format:

arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Implementation

Future<GetCertificateResponse> getCertificate({
  required String certificateArn,
}) async {
  ArgumentError.checkNotNull(certificateArn, 'certificateArn');
  _s.validateStringLength(
    'certificateArn',
    certificateArn,
    20,
    2048,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CertificateManager.GetCertificate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CertificateArn': certificateArn,
    },
  );

  return GetCertificateResponse.fromJson(jsonResponse.body);
}