createEcdsaM2MSession function

Future<EcdsaM2MSession> createEcdsaM2MSession({
  1. required CloudClient cloudClient,
  2. StorageClientInterface<StorageKeyshare>? storageClient,
  3. DklsMessageSignerBase? signer,
  4. Protocol protocol = Protocol.duo,
})

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);
}