createKeysAndCertificate method
Creates a 2048-bit RSA key pair and issues an X.509 certificate using the
issued public key. You can also call CreateKeysAndCertificate
over MQTT from a device, for more information, see Provisioning
MQTT API.
Note This is the only time AWS IoT issues the private key for this certificate, so it is important to keep it in a secure location.
May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.
Parameter setAsActive
:
Specifies whether the certificate is active.
Implementation
Future<CreateKeysAndCertificateResponse> createKeysAndCertificate({
bool? setAsActive,
}) async {
final $query = <String, List<String>>{
if (setAsActive != null) 'setAsActive': [setAsActive.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'POST',
requestUri: '/keys-and-certificate',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return CreateKeysAndCertificateResponse.fromJson(response);
}