1 Star 1 Fork 11

guoGuangJie/FinanceSdkDemo

forked from Yohao丶/FinanceSdkDemo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
RSAHelper.cs 806 Bytes
一键复制 编辑 原始数据 按行查看 历史
Yohao.Chou 提交于 2020-09-26 23:53 . init demo
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace FinanceSdkDemo
{
public class RSAHelper
{
/// <summary>
/// RAS 私钥解密
/// </summary>
/// <param name="privateKey"></param>
/// <param name="text"></param>
/// <returns></returns>
public static string Decrypt(string privateKey, string text)
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
byte[] byteKeys = Convert.FromBase64String(text);
rsa.FromXmlString(privateKey);
var cByte = rsa.Decrypt(byteKeys, false);
return System.Text.Encoding.UTF8.GetString(cByte);
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/guojazz/finance-sdk-demo.git
git@gitee.com:guojazz/finance-sdk-demo.git
guojazz
finance-sdk-demo
FinanceSdkDemo
master

搜索帮助