Revision 4a84ebe6
b/docs/libcacard.txt | ||
---|---|---|
10 | 10 |
cards which are shared with the client machine the emulator is running on, or |
11 | 11 |
the cards could be pure software constructs. |
12 | 12 |
|
13 |
The emulator is structured to allow multiple replacable or additional pieces, |
|
13 |
The emulator is structured to allow multiple replaceable or additional pieces,
|
|
14 | 14 |
so it can be easily modified for future requirements. The primary envisioned |
15 | 15 |
modifications are: |
16 | 16 |
|
... | ... | |
32 | 32 |
-------------------- |
33 | 33 |
Replacing the Socket Based Virtual Reader Interface. |
34 | 34 |
|
35 |
The current implementation contains a replacable module vscclient.c. The |
|
35 |
The current implementation contains a replaceable module vscclient.c. The
|
|
36 | 36 |
current vscclient.c implements a sockets interface to the virtual ccid reader |
37 | 37 |
on the guest. CCID commands that are pertinent to emulation are passed |
38 | 38 |
across the socket, and their responses are passed back along that same socket. |
... | ... | |
42 | 42 |
the emulator. |
43 | 43 |
|
44 | 44 |
An application that wants to use the virtual reader can replace vscclient.c |
45 |
with it's own implementation that connects to it's own CCID reader. The calls
|
|
45 |
with its own implementation that connects to its own CCID reader. The calls
|
|
46 | 46 |
that the CCID reader can call are: |
47 | 47 |
|
48 | 48 |
VReaderList * vreader_get_reader_list(); |
... | ... | |
72 | 72 |
VReader * vreader_list_get_reader(VReaderListEntry *) |
73 | 73 |
|
74 | 74 |
This function returns the reader stored in the reader List entry. Caller gets |
75 |
a new reference to a reader. The caller must free it's reference when it is
|
|
75 |
a new reference to a reader. The caller must free its reference when it is |
|
76 | 76 |
finished with vreader_free(). |
77 | 77 |
|
78 | 78 |
void vreader_free(VReader *reader); |
79 | 79 |
|
80 |
This function frees a reference to a reader. Reader's are reference counted
|
|
80 |
This function frees a reference to a reader. Readers are reference counted |
|
81 | 81 |
and are automatically deleted when the last reference is freed. |
82 | 82 |
|
83 | 83 |
void vreader_list_delete(VReaderList *list); |
... | ... | |
87 | 87 |
|
88 | 88 |
VReaderStatus vreader_power_on(VReader *reader, char *atr, int *len); |
89 | 89 |
|
90 |
This functions simulates a card power on. Virtual cards do not care about
|
|
90 |
This function simulates a card power on. A virtual card does not care about
|
|
91 | 91 |
the actual voltage and other physical parameters, but it does care that the |
92 | 92 |
card is actually on or off. Cycling the card causes the card to reset. If |
93 | 93 |
the caller provides enough space, vreader_power_on will return the ATR of |
... | ... | |
104 | 104 |
unsigned char *receive_buf, |
105 | 105 |
int receive_buf_len); |
106 | 106 |
|
107 |
This functions send a raw apdu to a card and returns the card's response.
|
|
107 |
This function sends a raw apdu to a card and returns the card's response.
|
|
108 | 108 |
The CCID front end should return the response back. Most of the emulation |
109 | 109 |
is driven from these APDUs. |
110 | 110 |
|
... | ... | |
217 | 217 |
VCardStatus vcard_add_applet(VCard *card, VCardApplet *applet); |
218 | 218 |
|
219 | 219 |
Add an applet onto the list of applets attached to the card. Once an applet |
220 |
has been added, it can be selected by it's aid, and then commands will be
|
|
221 |
routed to it VCardProcessAPDU function. This function adopts the applet the
|
|
222 |
passed int applet. Note: 2 applets with the same AID should not be added to
|
|
223 |
the same card. It's permissible to add more than one applet. Multiple applets
|
|
220 |
has been added, it can be selected by its AID, and then commands will be
|
|
221 |
routed to it VCardProcessAPDU function. This function adopts the applet that
|
|
222 |
is passed into it. Note: 2 applets with the same AID should not be added to
|
|
223 |
the same card. It is permissible to add more than one applet. Multiple applets
|
|
224 | 224 |
may have the same VCardPRocessAPDU entry point. |
225 | 225 |
|
226 | 226 |
The certs and keys should be attached to private data associated with one or |
... | ... | |
335 | 335 |
VCard7816Status vcard_emul_login(VCard *card, unsigned char *pin, |
336 | 336 |
int pin_len); |
337 | 337 |
|
338 |
This function logins into the card and return the standard 7816 status
|
|
338 |
This function logs into the card and returns the standard 7816 status
|
|
339 | 339 |
word depending on the success or failure of the call. |
340 | 340 |
|
341 | 341 |
void vcard_emul_delete_key(VCardKey *key); |
... | ... | |
424 | 424 |
cert_len, and keys are all arrays of length cert_count. These are the |
425 | 425 |
the same of the parameters xxxx_card_init() accepts. |
426 | 426 |
|
427 |
Finally the card is associated with it's reader by the call:
|
|
427 |
Finally the card is associated with its reader by the call: |
|
428 | 428 |
|
429 | 429 |
VReaderStatus vreader_insert_card(VReader *vreader, VCard *vcard); |
430 | 430 |
|
Also available in: Unified diff