createEcdsaM2MSession function
Implementation
Future<EcdsaM2MSession> createEcdsaM2MSession({
required CloudClient cloudClient,
StorageClientInterface? storageClient,
dkls.DklsMessageSignerBase? signer,
Protocol protocol = Protocol.duo,
}) async {
final signingKey = signer != null
? await dkls.DklsSigningKey.create(signer)
: await dkls.DklsSigningKey.createInMemory();
final ecdsaSessionConfig = EcdsaM2MSessionConfig(
cloudClient: cloudClient,
storageClient: storageClient ?? SimpleStorageClient(),
signingKey: signingKey,
protocol: protocol,
);
return EcdsaM2MSession.create(ecdsaSessionConfig);
}