Nfe - private and public key reading applet

Asked

Viewed 642 times

6

I need to develop a system to issue an electronic invoice. 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 is not yet possible to capture the card’s private and public key. I thought then of making an applet just to read this data and put in a session, so I could use with php.

Since I know little of Java, I would like to know if it is possible to do this, or is it madness of mine. And if it’s possible if someone has to point me to software where I can look at the source OR readings so I can develop this.

In case I succeed I propose to post on the project Nfephp and contribute to the community!

  • 2

    believe that one of these links can help http://www.javac.com.br/jc/posts/list/122-nfe-signature-dos-xmls-de-envio-de-lote-cancelament-e-inutilize-certificado-a3.page http://www.javac.com.br/jc/posts/lists/1220-duvidas-pega-certificado-digital-resolvidopagehttp://www.guj.com.br/java/110442-certified-A3---nfe/2

  • 1

    There’s a code there that looks promising Caputo, thank you very much

  • Did you find a solution? Poste as an answer to help other people.

  • 1

    @bigown after better understanding the problem I realized that it is extremely difficult to use A3 with php since it runs on server... I ended up choosing to create my own api, but use the A1 certificate

  • 2

    Look Neto, I’ve had this same question in the past, and I ended up using the A1 certificate itself.

2 answers

2

I have already implemented Nfse emission systems whose RPS required the signature with digital certificate and the customer had just one type A3.

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

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

  • one to catch lots not yet signed;
  • another to submit the signature of the batches processed.

Follow this path that you do well (or let me know if you find a better solution) :)

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

Hug

0

What would work in your case would be a webservice, which could be even simple in java that would enable Oce to inform a key and it returns a boolean or even a string ok and error, something like... Java has many components that create WS simply like 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 validate the certificate and run your php application within the HTTPS layer. This way I would delegate all input validation to the Tomcat server.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.