aboutsummaryrefslogtreecommitdiffstats
path: root/scd/NOTES-STATUSFD
blob: 543ee3d28aa0fe8df9b7aed2ef43d06bf84b40a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Description of the statusfd mechanism:

Applications can now ask scdaemon to be notified about certain events
(card inserted/removed) on a specified file descriptor.

This is how it works:

Run gpg-agent in daemon mode.
Figure out scdaemons socket:


moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ gpg-connect-agent 
SCD GETINFO socket_name
D /tmp/gpg-QZRVNr/S.scdaemon
OK

Connect to scdaemon and register a status file descriptor:

moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ gpg-connect-agent -S /tmp/gpg-QZRVNr/S.scdaemon
/sendfd /tmp/scd-events w
STATUSFD
OK
moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ 


Watch the log file as you remove/insert the smartcard:

moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ tail -f /tmp/scd-events 
CARD REMOVED
CARD INSERTED
CARD REMOVED
CARD INSERTED
^C
moritz@pink:~/g10/hacks/gnupg-mo/build/scd$ 

That's it for now.