Skip to content

Commit 03ccef3

Browse files
committed
GPG advanced key management
1 parent 5719f1a commit 03ccef3

11 files changed

+395
-209
lines changed

doc/README-GPG.md

+33-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Thanks!
1818
Run
1919

2020
```
21-
$ (trezor|keepkey|ledger|jade|onlykey)-gpg init "Roman Zeyde <roman.zeyde@gmail.com>"
21+
$ (trezor|keepkey|ledger|jade|onlykey)-gpg init
22+
$ (trezor|keepkey|ledger|jade|onlykey)-gpg add -d "Roman Zeyde <roman.zeyde@gmail.com>"
2223
```
2324
2425
Follow the instructions provided to complete the setup. Keep note of the timestamp value which you'll need if you want to regenerate the key later.
@@ -137,13 +138,14 @@ $ gpg2 --export 'john@doe.bit' | gpg2 --list-packets | grep created | head -n1
137138
138139
After your main identity is created, you can add new user IDs using the regular GnuPG commands:
139140
```
140-
$ trezor-gpg init "Foobar" -vv
141+
$ trezor-gpg init
142+
$ trezor-gpg add -d "Foobar" -vv
141143
$ export GNUPGHOME=${HOME}/.gnupg/trezor
142144
$ gpg2 -K
143145
------------------------------------------
144-
sec nistp256/6275E7DA 2017-12-05 [SC]
146+
sec nistp256/6275E7DA 1970-01-01 [SC]
145147
uid [ultimate] Foobar
146-
ssb nistp256/35F58F26 2017-12-05 [E]
148+
ssb nistp256/35F58F26 1970-01-01 [E]
147149

148150
$ gpg2 --edit Foobar
149151
gpg> adduid
@@ -159,10 +161,24 @@ gpg> save
159161

160162
$ gpg2 -K
161163
------------------------------------------
162-
sec nistp256/6275E7DA 2017-12-05 [SC]
164+
sec nistp256/6275E7DA 1970-01-01 [SC]
163165
uid [ultimate] Xyzzy
164166
uid [ultimate] Foobar
165-
ssb nistp256/35F58F26 2017-12-05 [E]
167+
ssb nistp256/35F58F26 1970-01-01 [E]
168+
```
169+
170+
This adds new user IDs to the same key. You can also add a new key using the `add` command:
171+
```
172+
$ trezor-gpg add "Xyzzy" -vv
173+
$ gpg2 -K
174+
------------------------------------------
175+
sec nistp256/6275E7DA 1970-01-01 [SC]
176+
uid [ultimate] Foobar
177+
ssb nistp256/35F58F26 1970-01-01 [E]
178+
179+
sec nistp256/BE61C208 1970-01-01 [SC]
180+
uid [ultimate] Xyzzy
181+
ssb nistp256/65088366 1970-01-01 [E]
166182
```
167183
168184
### Generate GnuPG subkeys
@@ -173,7 +189,17 @@ pub rsa2048/90C4064B 2017-10-10 [SC]
173189
uid [ultimate] foobar
174190
sub rsa2048/4DD05FF0 2017-10-10 [E]
175191

176-
$ trezor-gpg init "foobar" --subkey
192+
$ trezor-gpg add "foobar" --subkey
193+
```
194+
195+
If you have already set the new folder as your default profile, and you want to add the subkey to an existing GnuPG from a previous (e.g. non-hardware) profile, you can specify the previous profile location using `--primary-homedir`:
196+
```
197+
$ gpg2 -k foobar --homedir ~/.gnupg
198+
pub rsa2048/90C4064B 2017-10-10 [SC]
199+
uid [ultimate] foobar
200+
sub rsa2048/4DD05FF0 2017-10-10 [E]
201+
202+
$ trezor-gpg add "foobar" --subkey --primary-homedir ~/.gnupg
177203
```
178204
179205
[![asciicast](https://asciinema.org/a/Ick5G724zrZRFsGY7ZUdFSnV1.png)](https://asciinema.org/a/Ick5G724zrZRFsGY7ZUdFSnV1)

doc/README-Windows.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ git clone https://github.com/romanz/trezor-agent.git
5656

5757
Build and install the library:
5858
```
59+
pip install ./trezor-agent
60+
```
61+
If you want to be able to edit it without having to rebuild, use this command instead:
62+
```
5963
pip install -e trezor-agent
6064
```
6165

6266
Build and install the agent of your choice:
6367
```
68+
pip install ./trezor-agent/agents/<device>
69+
```
70+
If you want to be able to edit it without having to rebuild, use this command instead:
71+
```
6472
pip install -e trezor-agent/agents/<device>
6573
```
6674

@@ -166,7 +174,8 @@ choco install gpg4win
166174

167175
You must first create a signing identity:
168176
```
169-
<device>-gpg init -e ed25519 "My Full Name <myemail@mymailhost.com>"
177+
<device>-gpg init
178+
<device>-gpg add -d -e ed25519 "My Full Name <myemail@mymailhost.com>"
170179
```
171180
You will be asked for confirmation on your device **twice**.
172181

0 commit comments

Comments
 (0)