This article is a mirror article of machine translation, please click here to jump to the original article.

View: 24651|Reply: 0

[.NET Core] .NET Core uses the RSA encryption algorithm for error reporting solutions

[Copy link]
Posted on 7/4/2018 4:26:53 PM | | |
The .NET Core 1.x version error is as follows:

Could not load type 'System.Security.Cryptography.RSACryptoServiceProvider' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

The .NET Core 2.x version error is as follows:

Operation is not supported on this platform.

   at System.Security.Cryptography.RSA.FromXmlString(String xmlString)
   at CodeSharing.Common.RSACryptoProvider.SectionDecrypt(String base64code, String privateKey) in xxx


This article uses version 2.x as an example to solve it!

The main reasons for the error areFromXmlStringThis method is wrong!

Redefine this method:

Put all code used in FromXmlString to RSA.FromXmlString(privateKey);  Replace with FromXmlString(RSA, privateKey); It can be solved!

Resources:https://github.com/ServiceStack/ ... lient/CryptUtils.cs




Previous:Ionic Development Android App Practice (4): Baidu Map API Positioning
Next:Each version of JD.com's purchasing product interface assistant is open source
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com