getDecryptData<T> method

T? getDecryptData<T>(
  1. String publicKey,
  2. OnFromJson<T> onFromJson
)

获取公钥解密之后的数据

Implementation

T? getDecryptData<T>(String publicKey, OnFromJson<T> onFromJson) {
  try {
    var decrypt = EncrypterUtil.aesRsaDecrypt(key, publicKey, data);
    if (decrypt == null) return null;
    return onFromJson.call(jsonDecode(decrypt));
  } catch (e) {
    return null;
  }
}