How to start for a prototype driver

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to start for a prototype driver

Erik Schick
Hello everyone,

sorry for my English. I’m a unexperienced student in an internship at
the moment. My task here is to make a prototype driver for OpenSC.
The driver should be minimal for the start. Only display device
information and store a private key. I haven't a real hardware device
here, so i need a kind of virtual device. I combed through the source
code, but it's hard to get an overview about what is important. I don't
want that someone program the driver, but a path to how to make it. The
following things have I found out. All driver have

- atr table (don't understand fully the purpose)
- match function (card atr's match with one driver, but how?)
- init function (don't know what must be done here)
- something with card operations (available card operation will allacote
to the driver function)

So what have to be in a driver for my prototype and where can I find the
information how to make it?

Greetings Erik

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to start for a prototype driver

Douglas E Engert


On 6/3/2014 7:10 AM, Erik Schick wrote:

> Hello everyone,
>
> sorry for my English. I’m a unexperienced student in an internship at
> the moment. My task here is to make a prototype driver for OpenSC.
> The driver should be minimal for the start. Only display device
> information and store a private key. I haven't a real hardware device
> here, so i need a kind of virtual device. I combed through the source
> code, but it's hard to get an overview about what is important. I don't
> want that someone program the driver, but a path to how to make it. The
> following things have I found out. All driver have
>
> - atr table (don't understand fully the purpose)

Google for ATR smart card

> - match function (card atr's match with one driver, but how?)

Given the ATR from the card, figure out which OpenSC driver to use.

> - init function (don't know what must be done here)

Depends on the card, basicaly allocate structures and override the
the ISO7816-4 standard operations with card specific operations.

> - something with card operations (available card operation will allacote
> to the driver function)
>
> So what have to be in a driver for my prototype and where can I find the
> information how to make it?

Google for ISO 7816-4. This defines the standard card interface. See the
OpenSC src/libopensc/iso7816.c which implements this.

Most cards have vendor extensions/exceptions to these commands, and these are
implemented in the src/libopensc/card-*.c modules

OpenSC implements the PKCS#11 API and PKCS#15 card file structures from RSA
now with EMC.

http://www.emc.com/emc-plus/rsa-labs/standards-initiatives/pkcs-11-cryptographic-token-interface-standard.htm
http://www.emc.com/emc-plus/rsa-labs/standards-initiatives/pkcs-15-cryptographic-token-information-format.htm

Note some cards supported by OpenSC are not PKCS#15, but the software in the
The pkcs15-*.c and card-*.c modules help with emulation.




>
> Greetings Erik
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> Opensc-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/opensc-devel
>

--

  Douglas E. Engert  <[hidden email]>


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Opensc-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opensc-devel