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

View: 2485|Reply: 0

Generate elements using PowerShell <machineKey>

[Copy link]
Posted on 8/15/2023 9:16:37 AM | | | |
Use PowerShell to generate <machineKey> elements<machineKey>, elements, configure keys for form authentication, encryption and decryption of cookie data and view state data, and validate out-of-process session state identities. This section can be declared at the machine, site, and application level, but not at the subdirectory level. And its default value is SHA1, which uses HMACSHA1 algorithm.


Encrypt data with ASP.NET machineKey
https://www.itsvse.com/thread-9535-1-1.html

ASP.NET The role of machineKey and how to use it
https://www.itsvse.com/thread-2705-1-1.html
Windows PowerShell script





ASP.NET 4.0

For ASP.NET 4.0 applications, simply call Generate-MachineKey without parameters to generate <machineKey> an element as follows:


ASP.NET 2.0 and 3.5

Once you have the <machineKey> element, you can put it in the Web.config file. <machineKey> Element.It only works in the Web.config file of the application root, and not at the subfolder level

(End)




Previous:.NET/C# implements the IEqualityComparer custom comparator
Next:ASP.NET Core (22) is based on IDataProtectionProvider data protection
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