KDFParam.fromJson constructor
Implementation
factory KDFParam.fromJson(Map<String, dynamic> json) {
final kdf = json["kdf"];
final params = json["kdfparams"];
switch (kdf) {
case "scrypt":
return KDFScrypt.fromJson(params);
case "pbkdf2":
return KDF2.fromJson(params);
default:
throw Web3SecretStorageDefinationV3Exception("Invalid kdf.", details: {
"excepted": ["scrypt", "pbkdf2"].join(", "),
"kdf": kdf
});
}
}