// 调用
string tmpPriKey, tmpPubKey;
RsaHelper.GetPriPubKey(out tmpPriKey, out tmpPubKey);
string content = "这是im 223~! #苛sdkfj23";
string inString = RsaHelper.RsaEncrypt(tmpPubKey, content);
string outString = RsaHelper.RsaDecrypt(tmpPriKey, inString);
var tmpBb = RsaHelper.RsaSignData(tmpPriKey, content);
var tmpResult = RsaHelper.RsaVerifyData(tmpPubKey, content, tmpBb);
/// <summary>
/// Rsa加解密/// </summary>
public class RsaHelper
{
/// <summary>
/// 获取私钥、公钥
/// </summary>
/// <param name="priKey"></param>
/// <param name="pubKey"></param>
public static void GetPriPubKey(out string priKey, out strin