CrossSigning constructor

CrossSigning(
  1. Encryption encryption
)

Implementation

CrossSigning(this.encryption) {
  encryption.ssss.setValidator(EventTypes.CrossSigningSelfSigning,
      (String secret) async {
    final keyObj = olm.PkSigning();
    try {
      return keyObj.init_with_seed(base64decodeUnpadded(secret)) ==
          client.userDeviceKeys[client.userID]!.selfSigningKey!.ed25519Key;
    } catch (_) {
      return false;
    } finally {
      keyObj.free();
    }
  });
  encryption.ssss.setValidator(EventTypes.CrossSigningUserSigning,
      (String secret) async {
    final keyObj = olm.PkSigning();
    try {
      return keyObj.init_with_seed(base64decodeUnpadded(secret)) ==
          client.userDeviceKeys[client.userID]!.userSigningKey!.ed25519Key;
    } catch (_) {
      return false;
    } finally {
      keyObj.free();
    }
  });
}