getDecryptDataByPrivate<T> method

T? getDecryptDataByPrivate<T>(
  1. String privateKey,
  2. OnFromJson<T> onFromJson
)

获取私钥解密之后的数据

Implementation

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