grDecrypt64Fernet function
Implementation
String grDecrypt64Fernet(
{required String inputBase64,
required GRKey key,
GRIV? iv,
int repeat = 0}) {
if (repeat < 0) {
return "";
}
final b64key = GRKey.fromUtf8(base64Url.encode(key.bytes));
final fernet = Fernet(b64key);
final decryptor = Encrypter(fernet);
var decrypted = decryptor.decrypt64(inputBase64);
if (iv != null) {
decrypted = decryptor.decrypt64(inputBase64, iv: iv);
}
if (repeat == 0) {
return decrypted;
}
return grDecrypt64Fernet(
inputBase64: decrypted, key: key, iv: iv, repeat: repeat - 1);
}