calculateSessionKey method

  1. @override
BigInt? calculateSessionKey()
override

Computes the final session key as a result of the SRP successful mutual authentication To be called after verifying the server evidence message M2. returns Key: the mutually authenticated symmetric session key throws Exception

Implementation

@override
BigInt? calculateSessionKey() {
  // Verify pre-requirements (here we enforce a previous calculation of M1 and M2)
  if (S == null || M1 == null || M2 == null) {
    throw Exception(
        'Impossible to compute Key: some data are missing from the previous operations (S,M1,M2)');
  }
  Key = SRP6Util.calculateKey(digest, N, S!);
  return Key;
}