4
I have an ASP.NET MVC4 application and use the following code to read the A3 certificate (reader or USB stick) of the user:
var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.OpenExistingOnly | OpenFlags.MaxAllowed);
var collection = store.Certificates;
var fcollection = collection.Find(X509FindType.FindByTimeValid, DateTime.Now, true);
var scollection = X509Certificate2UI.SelectFromCollection(fcollection, "Certificados válidos:", "Selecione o certificado que deseja usar",
X509SelectionFlag.SingleSelection);
When I am debugging (using Iisexpress) the code works normal, but when I publish the application on IIS 7.5 (on my local machine) returns the following error:
Current session is not interactive.
Question: Is it possible to make OSI "respect" the code on top of it in the same way that Iisexpress does?
Gypsy, the Activex link (https://github.com/cardid/WebCard) you posted would be ideal for me, but I didn’t understand how I could pass an object like X509certificate2ui. You would have some example, if it’s not too much to ask.
– Alexander Leão dos Reis
Have you looked here?
– Leonel Sanches da Silva
Already yes, I installed the plugin, but nothing happens. But thanks for the tip, I’ll see the other option, inte!
– Alexander Leão dos Reis