listPublicKeys method

Future<ListPublicKeysResponse> listPublicKeys({
  1. DateTime? endTime,
  2. String? nextToken,
  3. DateTime? startTime,
})

Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.

May throw InvalidTimeRangeException. May throw UnsupportedOperationException. May throw OperationNotPermittedException. May throw InvalidTokenException.

Parameter endTime : Optionally specifies, in UTC, the end of the time range to look up public keys for CloudTrail digest files. If not specified, the current time is used.

Parameter nextToken : Reserved for future use.

Parameter startTime : Optionally specifies, in UTC, the start of the time range to look up public keys for CloudTrail digest files. If not specified, the current time is used, and the current public key is returned.

Implementation

Future<ListPublicKeysResponse> listPublicKeys({
  DateTime? endTime,
  String? nextToken,
  DateTime? startTime,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.ListPublicKeys'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (endTime != null) 'EndTime': unixTimestampToJson(endTime),
      if (nextToken != null) 'NextToken': nextToken,
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
    },
  );

  return ListPublicKeysResponse.fromJson(jsonResponse.body);
}