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 IoT issues the private key for this certificate, so it is important to keep it in a secure location.
Requires permission to access the CreateKeysAndCertificate action.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
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);
}