X509Certificate2Collection sel = X509Certificate2UI.SelectFromCollection(
Filteredcollection,
"Certificates",
"Select a Certificate to sign",
X509SelectionFlag.SingleSelection
);
X509Certificate2UI
此时在asp.net核心
答案 0 :(得分:1)
没有。 X509CertificateUI用于在Windows桌面上弹出选择UI。对于Web,选择过程由浏览器强制执行,而不是由服务器上的任何代码强制执行。
您必须将您的网站配置为仅接受证书,具体方式取决于托管软件。
对于Kestrel来说,它是代码;
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(options =>
{
options.Listen(IPAddress.Loopback, 5001, listenOptions =>
{
listenOptions.UseHttps(new HttpsConnectionAdapterOptions
{
ServerCertificate = /* Your HTTPS Certificate */,
ClientCertificateMode = ClientCertificateMode.RequireCertificate,
ClientCertificateValidation = /* Validator */
});
});
})
.Build();
对于IIS,它通过用户界面,