C# RSA私钥解密问题
发布网友
发布时间:2022-04-18 06:34
我来回答
共1个回答
热心网友
时间:2022-04-18 08:04
RSAPKCS1SignatureFormatter signe = new RSAPKCS1SignatureFormatter();
signe.SetKey(cer.PrivateKey);
signe.SetHashAlgorithm("SHA1");
byte[] reslut = signe.CreateSignature(hashbytes);
RSACryptoServiceProvider rsa1 = new RSACryptoServiceProvider();
rsa1.FromXmlString(key.ToXmlString(false)); //导入公钥
RSAPKCS1SignatureDeformatter RSADeformatter = new RSAPKCS1SignatureDeformatter(rsa1);
RSADeformatter.SetHashAlgorithm("SHA1");
RSACryptoServiceProvider oRSA1 = new RSACryptoServiceProvider();
oRSA1.FromXmlString(publickey);
主要还没不懂你什么意思,我也做过这个,就加解密和签名和验签。也用USBKEY!