CrossSigning constructor

CrossSigning(
  1. Encryption encryption
)

Implementation

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