deserializePrivateKey function
Deserializes the private key from a JSON file The file should contain a JSON object with the key 's'.
Implementation
ASEPrivateKey deserializePrivateKey(String path) {
if (!isPathSafe(path)) {
throw ArgumentError('Unsafe file path');
}
final file = File(path);
if (!file.existsSync()) {
throw FileSystemException('File not found', path);
}
if (file.lengthSync() > 1024 * 1024) {
throw FileSystemException('File too large', path);
}
var m = jsonDecode(file.readAsStringSync());
return deserializePrivateKeyFromJson(m);
}