pcsc-lite/doc
Ludovic Rousseau 2cb5c621b8 New upstream version 1.9.9 2022-09-11 16:21:29 +02:00
..
example New upstream version 1.9.6 2022-05-11 17:31:16 +02:00
Makefile.am New upstream version 1.9.1 2021-02-16 17:37:49 +01:00
Makefile.in New upstream version 1.9.6 2022-05-11 17:31:16 +02:00
README.polkit New upstream version 1.8.22 2017-12-09 18:15:20 +01:00
doxygen.conf.in New upstream version 1.8.26 2020-01-03 17:35:47 +01:00
formaticc.1 New upstream version 1.8.22 2017-12-09 18:15:20 +01:00
org.debian.pcsc-lite.policy New upstream version 1.8.24 2018-10-12 11:16:36 +02:00
pcscd.8.in New upstream version 1.9.9 2022-09-11 16:21:29 +02:00
reader.conf.5.in New upstream version 1.9.6 2022-05-11 17:31:16 +02:00

README.polkit

When pcsc-lite is compiled using the --enable-polkit option then
polkit will be used to control access to the pcsc-lite daemon.

That allows more fine grained access control to smart cards that
is tied to the system processes rather than solely depending on
the smart card controls (e.g., only console users can access the 
card and so on). 

Polkit is documented at:
http://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html

A default polkit policy is shipped with pcsc-lite in
org.debian.pcsc-lite.policy.  The policy file allows restricting access
to the daemon as well as access to smart cards.

Polkit allows for additional rules, e.g., restricting access to
particular smart cards. The rules are javascript files placed
in /usr/share/polkit-1/rules.d/. To make specific smart card 
reader accessible by the web server (run as www-data user) you 
may use the following rules:

polkit.addRule(function(action, subject) {
    if (action.id == "org.debian.pcsc-lite.access_card" &&
        action.lookup("reader") == 'name of reader' &&
        subject.user == "www-data") {
            return polkit.Result.YES;
    }
});

polkit.addRule(function(action, subject) {
    if (action.id == "org.debian.pcsc-lite.access_pcsc" &&
        subject.user == "www-data") {
            return polkit.Result.YES;
    }
});


Note that the name of the reader can be obtained using "opensc-tool -l"
or "pcsc_scan".