canokeys / canokey-core

Core implementations of an open-source secure key
https://canokeys.org/
Apache License 2.0
326 stars 37 forks source link

请问用 OpenPGP 智能卡签名加密 gpg-agent 是不能缓存 pin 吗? #96

Closed raven15 closed 1 month ago

raven15 commented 3 months ago

我的操作系统是 Windows,用智能卡里的密钥来登录 ssh 服务器gpg-agent能缓存下 pin,用本地的 gpg 密钥签名和加密也能缓存下来 pin,但是用智能卡内的密钥来签名和加密都不能缓存 pin 每次都要输入,请问是我配置的不正确吗?我的环境如下:

 # systeminfo                                                                                                         ─╯
OS 名称:          Microsoft Windows 11 专业版
OS 版本:          10.0.22631 暂缺 Build 22631
OS 制造商:        Microsoft Corporation
OS 配置:          独立工作站
OS 构建类型:      Multiprocessor Free

# gpg --version 
gpg (GnuPG) 2.4.5-unknown

# cat ~\.gnupg\gpg.conf | grep -v "^#"
keyid-format 0xlong
with-fingerprint
use-agent
keyserver hkps://keyserver.ubuntu.com

# cat ~\.gnupg\gpg-agent.conf | grep -v "^#" 
default-cache-ttl-ssh 7200
max-cache-ttl-ssh 7200
pinentry-program /usr/bin/pinentry
enable-ssh-support
enable-putty-support
enable-win32-openssh-support
default-cache-ttl-ssh 7200
max-cache-ttl-ssh 18000
dangfan commented 2 months ago

Please refer to this settings: https://unix.stackexchange.com/questions/141569/how-to-configure-gpg2-to-pass-smartcard-pin-unless-pinentry-programm

raven15 commented 1 week ago

谢谢,完美解决了我的问题