$ gpg --full-generate-key # 创建GPG 密钥 gpg (GnuPG) 2.2.25-unknown; Copyright (C) 2020 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: keybox '/c/Users/28673/.gnupg/pubring.kbx' created Please select what kind of key you want: # 请选择您需要的密钥类型,这里默认是RAS那么回车即可 (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) (14) Existing key from card Your selection? RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (3072) # RSA密钥长度,默认3072,直接回车或者输入4096 Requested keysize is 3072 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) 0 # 过期时间,0为永不过期,输入0回车 Key does not expire at all Is this correct? (y/N) y # 询问选择是否正确,输入Y确认
GnuPG needs to construct a user ID to identify your key.
Real name: CholeTK # 用户名 Email address: KlyinT@qq.com # 邮箱,注意这里必须和Github主邮箱一致 Comment: You selected this USER-ID: "CholeTK <KlyinT@qq.com>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O # 确认没问题后,输入O开始生成密钥 # ......生成过程已省略
⑤、列出所有 GPG 密钥 ID
列出所有 GPG 密钥 ID:gpg --list-secret-keys --keyid-format LONG