❯ gpg --expert --edit-key your_id ## 使用专家模式, 不然没有认证的选项 gpg (GnuPG) 2.2.12; Copyright (C) 2018 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
gpg> addkey Please select what kind of key you want: (3) DSA (sign only) (4) RSA (sign only) (5) Elgamal (encrypt only) (6) RSA (encrypt only) (7) DSA (set your own capabilities) (8) RSA (set your own capabilities) (10) ECC (sign only) (11) ECC (set your own capabilities) (12) ECC (encrypt only) (13) Existing key Your selection? 8 ## 选8, RSA, 自定义权限
Possible actions for a RSA key: Sign Encrypt Authenticate Current allowed actions: Sign Encrypt ## 这里显示默认有Sign和Encrypt两种权限
(S) Toggle the sign capability (E) Toggle the encrypt capability (A) Toggle the authenticate capability (Q) Finished
Your selection? S ## 关闭Sign
Possible actions for a RSA key: Sign Encrypt Authenticate Current allowed actions: Encrypt
(S) Toggle the sign capability (E) Toggle the encrypt capability (A) Toggle the authenticate capability (Q) Finished
Your selection? E ## 关闭Encrypt
Possible actions for a RSA key: Sign Encrypt Authenticate Current allowed actions:
(S) Toggle the sign capability (E) Toggle the encrypt capability (A) Toggle the authenticate capability (Q) Finished
Your selection? A ## 开启Authenticate
Possible actions for a RSA key: Sign Encrypt Authenticate Current allowed actions: Authenticate
(S) Toggle the sign capability (E) Toggle the encrypt capability (A) Toggle the authenticate capability (Q) Finished
Your selection? Q ## 退出 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) 4096 Requested keysize is 4096 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) 1y ## 有效期 Key expires at Tue Jan 7 11:33:54 2020 CST Is this correct? (y/N) y Really create? (y/N) y We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy.