❯ gpg --version gpg (GnuPG) 2.4.5 libgcrypt 1.10.3 Copyright (C) 2024 g10 Code GmbH License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
❯ gpg --full-generate-key gpg (GnuPG) 2.4.5; Copyright (C) 2024 g10 Code GmbH This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want: (1) RSA and RSA (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) (9) ECC (sign and encrypt) *default* (10) ECC (sign only) (14) Existing key from card Your selection? # 加密方式,选择默认的 ECC 即可 Please select which elliptic curve you want: (1) Curve 25519 *default* (4) NIST P-384 (6) Brainpool P-256 Your selection? # 椭圆曲线,默认即可 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) # 密钥有效期,选择 0,永不过期 Key does not expire at all Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: cui # 名称 Email address: admin@cui.cc # 邮箱地址,加密文件时需要指定这个邮箱地址 Comment: macbook # 备注 You selected this USER-ID: "cui (macbook) <admin@cui.cc>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
提示输入私钥密码,建议使用包含大小写字母、数字和特殊符号的组合密码,长度不少于 8 位。
随后提示生成密钥成功:
1 2 3 4 5 6 7 8
gpg: directory '/Users/yourname/.gnupg/openpgp-revocs.d' created gpg: revocation certificate stored as '/Users/yourname/.gnupg/openpgp-revocs.d/B7A537251A427A4829CA1842CB8EC26394392290.rev' public and secret key created and signed.
pub ed25519 2024-09-29 [SC] B7A537251A427A4829CA1842CB8EC26394392290 uid cui (macbook) <admin@cui.cc> sub cv25519 2024-09-29 [E]