isOnboarded method

  1. @override
Future<bool> isOnboarded(
  1. String atSign
)
override

Checks whether the atSign has been onboarded. Queries the keychain for the encryption public key. If the key is found, the atSign is considered onboarded, and true is returned. Otherwise, false is returned.

Implementation

@override
Future<bool> isOnboarded(String atSign) async {
  AtsignKey? atsignKey = await _keyChainManager.readAtsign(name: atSign);
  if (atsignKey == null) {
    return false;
  }
  if (atsignKey.encryptionPublicKey == null ||
      atsignKey.encryptionPublicKey!.isEmpty) {
    return false;
  }
  return true;
}