static void Main(string[] args)
        {
            System.Security.Cryptography.CspParameters para = new System.Security.Cryptography.CspParameters();
            para.KeyContainerName = "g";
            para.KeyNumber = 2;

            System.Security.Cryptography.RSACryptoServiceProvider rs = new System.Security.Cryptography.RSACryptoServiceProvider(para);

            string data = "123456";

            byte[] old = Encoding.UTF8.GetBytes(data);

            byte[] singData = rs.SignData(old, new System.Security.Cryptography.SHA1CryptoServiceProvider());

            bool res = rs.VerifyData(Encoding.UTF8.GetBytes("123456"), new System.Security.Cryptography.SHA1CryptoServiceProvider(), singData);

            string sss = rs.ToXmlString(true);

        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-01-04
  • 2022-02-07
猜你喜欢
  • 2021-10-01
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
相关资源
相似解决方案