readKeyStore method

Future<KeyStore> readKeyStore(
  1. String password,
  2. File keyStoreFile
)

Implementation

Future<KeyStore> readKeyStore(String password, File keyStoreFile) async {
  if (!keyStoreFile.existsSync()) {
    throw InvalidKeyStorePath(
        'Given keyStore does not exist ($keyStoreFile)');
  }

  var content = await keyStoreFile.readAsString();
  return KeyFile.fromJson(json.decode(content)).decrypt(password);
}