本文介绍了system.security.cryptography.rsa中的错误不包含encrypt的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试RSA加密代码,在线参考一些代码,我试过这个



I was trying out the RSA encryption code, referring to some of the codes online, and I tried this

var encryptedData = RSA.Encrypt(testDatabyte, publicKey)





但出现错误提到



but error came out mentioning that

System.Security.Cryptography.RSA does not contain definition for Encrypt





我正在使用.NET framework 4.5.1。我可以知道我该怎么办?



我尝试过:



-提供给msdn microsoft,并试图添加如

的程序集System.Security.Cryptography.AsymmetricAlgorithm

System.Security.Cryptography.RSA

System.Security.Cryptography.RSACryptoServiceProvider

但是所有这些都不是命名空间的类型

-检查msdn中的.Net框架版本,它确实提到了它支持



I am using .NET framework 4.5.1. Can i know how should I proceed?

What I have tried:

-referred to msdn microsoft and tried to add assemblies like
System.Security.Cryptography.AsymmetricAlgorithm
System.Security.Cryptography.RSA
System.Security.Cryptography.RSACryptoServiceProvider
but all of them is a type not a namespace
-have check the .Net framework version in msdn, and it did mention it is supported

推荐答案


这篇关于system.security.cryptography.rsa中的错误不包含encrypt的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 06:57