NFe - private and public key reading applet

6

I need to develop a system for issuing electronic invoices. My big problem is that this system needs to meet the A3 certificate (card) and as far as I've been reading with php it's still not possible to capture the private key and publish the card. I thought then to make an applet just to read that data and put it in a session, so I could use it with php.

As I know little of Java, I would like to know if it is possible to do this, or it is crazy of me. And if it is possible if someone has to tell me a software where I can look in source OR readings so I can develop it.

If I succeed, I propose to post on the NfePHP project and contribute to the community!

    
asked by anonymous 07.08.2014 / 21:47

2 answers

2

I have already implemented NFSe issuance systems whose RPS needed the digital certificate signature and the client had exactly one of type A3.

Simple solution : create a Java program that runs on the terminal (task) to make the signature. It communicates with the API of my PHP application in search of unsigned lots, when it finds one, signs and sends the result back to API.

The API is very simple and requires only 2 access points:

  • one to get batches not yet signed;
  • other to submit the signed batch signature.

Follow this path as you get along (or let me know if you find a better solution):)

Another alternative, as they said earlier, is to use a certificate of type A1. I know a lot of people who went that way.

Embrace

    
31.05.2015 / 19:02
0

What would work in your case would be a webservice, which could be even simple in java that would allow you to enter a key and it would return a boolean or even an ok string and error, something like ... Java has many components which create WS simply as jaxws and springWS itself, and on the php side with some jsons the query would become transparent.  Another possibility would be to configure your tomcat to do the certificate validation and run your php application inside the HTTPS layer. This would delegate all incoming validation to the tomcat server.

    
13.04.2015 / 13:31