santigimeno / node-pcsclite

Bindings over pcsclite to access Smart Cards
ISC License
171 stars 127 forks source link

Simplify APDU's commands? #58

Closed jarodium closed 8 years ago

jarodium commented 8 years ago

Hello there

Is there any way we can simplify APDU sending and retrieving? Working with the buffers seems to have quite a steep learning curve for folks who don't understand very much of the subject.

Hopefully a higher level API would be enough and more time saving for those who want this library to work.

The attached file below is an eID Belgian SDK doc, for example on how the APi could be structured

UPD_Developers_Guide.pdf

Below is an APDU.js file taken from the Open Smart Card Development Platform ( http://www.openscdp.org/index.html)

apdu.txt

Best regards Pedro

santigimeno commented 8 years ago

Hi!

Thanks for the comments. Answers inline

Is there any way we can simplify APDU sending and retrieving? Working with the buffers seems to have quite a steep learning curve for folks who don't understand very much of the subject.

What's the difficulty when using Buffer? Can you more specific?. You can always initialize the Buffer with an Array, which looks quite simple to me.

Hopefully a higher level API would be enough and more time saving for those who want this library to work.

If you could outline an specific API we could discuss it. By skimming through the document I'm not sure what you're exactly proposing. On the other hand, I would argue that having a Sync API would help: https://github.com/santigimeno/node-pcsclite/issues/20. At the moment, I'm not in the need of a Sync API, but would certainly entertain a PR with that functionality.

Best regards.

jarodium commented 8 years ago

Hello @santigimeno

Thank you for your reply.

Using buffer, may look simple, but from a first timer's pov, when using this lib and using APDU, I had a hard time figuring where the parameters for APDU should be entered, and I am still battling to figure out how to use all the cases in the spec.

About the API, I figure a Sync API would help, but I really don't mind like it is up untill now. I can describe a small API specifically for general use.

Do you mind if I put the proposal in another issue?

Best regards Pedro

santigimeno commented 8 years ago

Do you mind if I put the proposal in another issue?

Please do! Looking forward to reading it.

santigimeno commented 8 years ago

Closing. Feel free to reopen if you think it should be.