You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Use seperated applications on token for GnuPG and OpenSC
2
-
1
+
# GnuPG and OpenSC
2
+
3
+
## Use separated applications on token for GnuPG and OpenSC
4
+
3
5
Some Tokens like the Yubikey have support for multiple security applications and you may want to use all of them concurrently for different purposes.
4
6
5
7
OpenSC, by default, is configured to allow shared access by default. In particular, for `reader_driver pcsc``connect_exclusive` is set to `false` and `disconnect_action`/`transaction_end_action`/`reconnect_action` are set to `leave`. Additionally, you may want to restrict OpenSC to only use one particular application:
# Select the PKI applet to use ("PIV-II" or "openpgp")
11
-
driver = "PIV-II";
12
-
# Recover from other applications accessing a different applet
13
-
flags = "keep_alive";
14
-
}
15
-
```
19
+
16
20
In this case, only the PIV-II application is used for the Yubikey Neo and OpenSC explicitly checks for concurrent access to the token.
17
21
18
22
GnuPG on the other hand, supports shared access starting from version 2.2.28 LTS and 2.3.0, but you need to enable shared PC/SC access by modifying your `scdaemon.conf` file and adding the following lines:
19
-
```
23
+
24
+
```textile
20
25
pcsc-driver /usr/lib/libpcsclite.so
21
26
card-timeout 5
22
27
disable-ccid
@@ -25,24 +30,28 @@ pcsc-shared
25
30
26
31
More troubleshooting with GnuPG is available on [Yubico's Website](https://support.yubico.com/hc/en-us/articles/360013714479-Troubleshooting-Issues-with-GPG).
27
32
28
-
Alternatively, it is possible to avoid scdaemon and access the token exclusively via OpenSC (see next section).
33
+
Alternatively, it is possible to avoid `scdaemon` and access the token exclusively via OpenSC (see next section).
29
34
30
-
# Use one single application on token (GnuPG via OpenSC)
35
+
##Use one single application on token (GnuPG via OpenSC)
31
36
32
37
If your token doesn't support OpenPGP or you don't want to use multiple applications on your token (with different PINs), then you can configure GnuPG to use OpenSC for accessing the token.
33
38
34
39
Install [gnupg-pkcs11-scd](https://github.com/alonbl/gnupg-pkcs11-scd) and configure it for use of OpenSC by modifying `gnupg-pkcs11-scd.conf` with the following:
Now tell GnuPG to use `gnupg-pkcs11-scd` instead of its own implementation (`scdaemon`) by adding the following line to `gpg-agent.conf`:
41
-
```
47
+
48
+
```sh
42
49
scdaemon-program /usr/bin/gnupg-pkcs11-scd
43
50
```
51
+
44
52
Reload the gpg-agent by running the following in a terminal:
45
-
```
53
+
54
+
```sh
46
55
gpg-agent --server gpg-connect-agent <<EOF
47
56
RELOADAGENT
48
57
SCD LEARN
@@ -51,4 +60,4 @@ EOF
51
60
52
61
Now, `gpg --card-status` should show your token being accessed by OpenSC. The card application is not necessarily OpenPGP, but rather the type of application that is configured in OpenSC.
53
62
54
-
As last step, import the existing key(s) into your GnuPG keyring by running `gpg --expert --full-generate-key`. Additionally, you may do the same for the CMS encryption and signing tool (`gpgsm --learn-card`).
63
+
As last step, import the existing key(s) into your GnuPG keyring by running `gpg --expert --full-generate-key`. Additionally, you may do the same for the CMS encryption and signing tool (`gpgsm --learn-card`).
0 commit comments