【发布时间】:2018-09-01 19:23:26
【问题描述】:
我有空的JavaCOS A40 智能卡,想将其设为 PKCS PKI 卡。
我将使用它作为 ssh 密钥和电子合同签署。俄罗斯不像欧盟国家那样为公民提供基于智能卡的电子身份证。商业电子签名提供商正在销售某种受密码保护的 USB 驱动器,使用起来不安全,因为您可以轻松导出私钥。他们也出售普通的智能卡,但它们真的很贵(比空的 javacard x10-x20)而且寿命很短(大约 1 年)。所以我想根据 javacard 的 RSA 算法制作我自己的 PKI 卡。
现在我的 javacard 处于OP_READY 状态,我没有更改它,因为更改是不可逆的。它使用默认密钥,任何人都可以上传任何内容。我在Ubuntu 上使用ACR38U 阅读器和pcsc linux 驱动程序,它按预期工作,所以我使用GlobalPlatformPro 默认上传PKI IsoApplet。所以GP的输出:
java -jar gp.jar -list
Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F
ISD: A000000003000000 (OP_READY)
Privs: SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement
APP: F276A288BCFBA69D34F31001 (SELECTABLE)
Privs: CardReset
PKG: F276A288BCFBA69D34F310 (LOADED)
Version: 1.0
Applet: F276A288BCFBA69D34F31001
但是当我尝试使用opensc 探测器连接到卡和小程序以查看应答请求(ATR)时,它失败了opensc-tool --reader 0 --atr。 See maximum debug info
缩短版:
opensc-tool --reader 0 --atr -vv
Connecting to card in reader ACS ACR 38U-CCID 00 00...
0x7fc849e7e740 22:17:14.634 [opensc-tool] card.c:200:sc_connect_card: called
0x7fc849e7e740 22:17:14.634 [opensc-tool] card-entersafe.c:138:entersafe_match_card: called
Failed to connect to card: Card command failed
0x7fc849e7e740 22:17:14.797 [opensc-tool] ctx.c:870:sc_release_context: called
根据制造商信息,卡支持T=0 over ISO7816,但opensc 尝试与T=1 通信。那么我该如何解决呢?
看来,opensc 工具是不可定制的。我需要使用pkcs15-crypt,但无法连接。我可以更改驱动程序、使用补丁重新编译 opensc 或使用其他实用程序吗?例如,我可以通过哪些其他方式来使用 OpenPGP?
【问题讨论】:
标签: cryptography smartcard javacard openpgp