- 导入钥匙
导入钥匙
GPG 私钥可以被复制或者导入进 Yubikey,下面的例子是把私钥导入 Yubikey。
【译者注:私钥一旦被导入 Yubikey 即无法导出,建议冷备份】
❯ gpg --edit-key <keyId>gpg> togglegpg> key 1gpg> keytocardPlease select where to store the key:(1) Signature key(3) Authentication keyYour selection? 1gpg> key 1gpg> key 2gpg> keytocardPlease select where to store the key:(2) Encryption keyYour selection? 2gpg> key 2gpg> key 3gpg> keytocardPlease select where to store the key:(3) Authentication keyYour selection? 3gpg> quit
确保私钥已经被移动到 Yubikey 中:
❯ gpg --list-secret-keys
如果你看到 ssb>,它显示的的是 Yubikey 上私钥的存根,意味着导入已经成功。
然后检查一下设备状态:
❯ gpg --card-status
