RsaHelperDecrypt 方法

使用私钥解密字符串。

Definition

命名空间: Suresking.Utility
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
C#
public static string Decrypt(
	string encryptText,
	string privateKey
)

参数

encryptText  String
密文的 Base64 字符串(由 Encrypt(String, String) 生成)。
privateKey  String
私钥(CSP Blob 的 Base64 字符串,通常由 GetKey 获取)。

返回值

String
解密后的明文。

备注

使用与 Encrypt(String, String) 对应的 PKCS#1 v1.5 填充进行解密。

异常

FormatException密文或私钥不是有效的 Base64 字符串。
CryptographicException密钥导入或解密失败(如私钥与加密公钥不匹配、密文被篡改)。

参见