using System; namespace PaySharp.Alipay.Util.Asymmetric { /// /// 非对称加密算法接口 /// public interface IAsymmetricEncryptor { /// /// 计算指定内容的签名 /// /// 待签名的原文 /// 待签名的原文的字符集编码 /// 私钥字符串 /// 签名字符串 string Sign(string content, string charset, string privateKey); /// /// 验证指定内容的签名是否正确 /// /// 待校验的原文 /// 待校验的原文的字符集编码 /// 公钥字符串 /// 签名字符串 /// true:验证通过;false:验证不通过 bool Verify(string content, string charset, string publicKey, string sign); /// /// 对明文进行非对称加密 /// /// 明文字符串 /// 明文的字符集编码 /// 公钥字符串 /// 密文的Base64编码字符串 string Encrypt(string plainText, string charset, string publicKey); /// /// 对密文进行非对称解密 /// /// 密文Base64编码字符串 /// 明文的字符集编码 /// 私钥字符串 /// 明文 string Decrypt(string cipherTextBase64, string charset, string privateKey); } }