my school webpages have selftrusted certificate(you must install it manually) and I wanted create program that will install a certificate.cer (from visual studio resources) to Local user -"Trusted root certificate authority" after i click on a button.Do you know how to code it in Visual C#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
To add the certificate to the trusted root store for the current user programmatically, use the X509Store and X509Certificate2 classes. For example:
See also " How can I install a certificate into the local machine store programmatically using c#? ".
Another option is the Certificate Manager command line (certmgr.exe) tool, specifically:
where "cert.cer" is your certificate. This imports it into the trusted root store for the current user. However, certmgr.exe is part of Visual Studio and the Windows SDK and may not be freely distributable.