5
I am developing a project in ASP.NET MVC5 to make manifestation of electronic invoices.
During the process of searching notes, manifestation or download, I access the Internal Revenue Service and need to send the digital certificate for the CNPJ.
Everything works fine while I’m developing and testing things locally, but when the application is published and goes to the server I can no longer select the digital certificate I want to use.
I’m using the classes X509certificate2, X509store and X509certificate2collection
I would like to do something like this link: https://cav.receita.fazenda.gov.br/eCAC/publico/login.aspx
Clicking on the digital certificate image opens the Store containing the certificates, but I can only do this when I run the local application, after it goes to the server I can’t access the Store.
Has anyone ever worked with it or know how to solve the problem?
Man, I had a lot of trouble using A3 certificate, because IIS will not be allowed to access the certificates installed on the clients' computer, I suggest you use a A1 certificate. At the time I had started developing the NF module I even read about a CAPICOM API that would help to use A3, but for simplicity and practicality I chose to use A1,
– Pablo Tondolo de Vargas
I understand and I know that A3 is very problematic, but I cannot put this limitation to users. I have the 2 models for testing, and site everything works fine, but how do government websites manage to use the way they use the link I asked the question? There must be some way the Windows Certificate Store can be opened by web applications and select the certificate.
– Jefferson Pedro
Yes, I understand you, but I believe that you will have to study the CAPICOM API to open the windows certificate repository, I do not know any way to do direct by C#.
– Pablo Tondolo de Vargas
@Pablovargas, even if I use CAPICOM and run everything in javascript, for example... At some point I will need to send the certificate with the data required by the webservice, so I can only do it by C#. Is there any way to do it via javascript too?
– Jefferson Pedro
Jefferson Pedro, have you managed to find the solution to your problem? How have you solved?
– Claudio Maia