GPG使用智能卡的问题

重复贴和参考价值不大的帖子,版主维护
回复
feisuzhu
帖子: 31
注册时间: 2008-02-06 13:24
送出感谢: 0
接收感谢: 0
联系:

GPG使用智能卡的问题

#1

帖子 feisuzhu » 2009-02-05 21:45

我的机器是Dell Latitude D630 ,上面带着一个O2Micro CCID SmartCard Reader

学习了一会GPG,发现他能使用智能卡

现在我有一个神州行的手机卡,一个工行的U盾
手机卡在Windows上插入的时候没有提示错误(以前试过IC电话卡、倒着插(没有芯片的一端),错误提示是一样的,在事件查看器里)

但是在Linux上SmartCard Reader 和 U盾 都没有驱动程序(usbview查看的时候是红字)

usbview里面的信息:

代码: 全选

O2Micro CCID SC Reader
Manufacturer: O2
Speed: 12Mb/s (full)
USB Version:  1.10
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 64
Number of Configurations: 1
Vendor Id: 0b97
Product Id: 7772
Revision Number:  1.10

Config Number: 1
	Number of Interfaces: 1
	Attributes: e0
	MaxPower Needed:   0mA

	Interface Number: 0
		Name: (none)
		Alternate Number: 0
		Class: 0b(scard) 
		Sub Class: 00
		Protocol: 00
		Number of Endpoints: 3

			Endpoint Address: 03
			Direction: out
			Attribute: 2
			Type: Bulk
			Max Packet Size: 64
			Interval: 0ms

			Endpoint Address: 82
			Direction: in
			Attribute: 2
			Type: Bulk
			Max Packet Size: 64
			Interval: 0ms

			Endpoint Address: 81
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 3
			Interval: 255ms

代码: 全选

Giesecke & Devrient StarKey
Manufacturer: STMicroelectronic
Speed: 1.5Mb/s (low)
USB Version:  1.10
Device Class: ff(vend.)
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 8
Number of Configurations: 1
Vendor Id: 096e
Product Id: 0010
Revision Number:  0.01

Config Number: 1
	Number of Interfaces: 1
	Attributes: 80
	MaxPower Needed:  30mA

	Interface Number: 0
		Name: (none)
		Alternate Number: 0
		Class: ff(vend.) 
		Sub Class: 00
		Protocol: 00
		Number of Endpoints: 0
发现U盾的Class为 ff ,但是 O2Micro的是 0b(scard) 。

这是命令行下的提示信息:

代码: 全选

proton@Proton:~$ gpg --card-status
gpg: pcsc_establish_context failed: no service (0x8010001d)
gpg: 读卡器不可用
gpg: OpenPGP 卡不可用:常规错误
proton@Proton:~$ su
口令: 
root@Proton:/home/proton# gpg --card-status
gpg: selecting openpgp failed: unknown command
gpg: OpenPGP 卡不可用:常规错误
root@Proton:/home/proton# 
之前运行过:

代码: 全选

root@Proton:/home/proton# mount -t usbfs usbfs /proc/bus/usb
问题是:
1 神州行的手机卡能不能做OpenPGP卡来用呢?
2 U盾呢? 如果可以,Class=ff 的问题怎么解决?
3 如果可以,应该怎么使用?(不是说GPG的使用方法,只要GPG能支持他们就可以)
3 为什么一般用户和root返回的错误信息不一样?

Thx in advance.
feisuzhu
帖子: 31
注册时间: 2008-02-06 13:24
送出感谢: 0
接收感谢: 0
联系:

Re: GPG使用智能卡的问题

#2

帖子 feisuzhu » 2009-02-06 18:25

啊,没人看么……
自己顶……
feisuzhu
帖子: 31
注册时间: 2008-02-06 13:24
送出感谢: 0
接收感谢: 0
联系:

Re: GPG使用智能卡的问题

#3

帖子 feisuzhu » 2009-02-07 15:38

唉……还是自己来把

神州行的卡貌似是不能用

安装了一个pcscd

pcscd的log

代码: 全选

00000000 pcscdaemon.c:280:main() pcscd set to foreground with debug send to stderr
00000794 pcscdaemon.c:498:main() pcsc-lite 1.4.102 daemon ready.
00148538 hotplug_libhal.c:342:HPAddDevice() Adding USB device: usb_device_b97_7772_noserial_if0
01001208 readerfactory.c:1082:RFInitializeReader() Attempting startup of O2 Micro Oz776 00 00 using /usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00000550 readerfactory.c:949:RFBindFunctions() Loading IFD Handler 3.0
00000087 ifdhandler.c:1323:init_driver() Driver version: 1.3.8
00000551 ifdhandler.c:1336:init_driver() LogLevel: 0x0003
00000462 ifdhandler.c:1356:init_driver() DriverOptions: 0x0000
00000030 ifdhandler.c:81:IFDHCreateChannelByName() lun: 0, device: usb:0b97/7772:libhal:/org/freedesktop/Hal/devices/usb_device_b97_7772_noserial_if0
00232084 ccid_usb.c:236:OpenUSBByName() Manufacturer: Ludovic Rousseau (ludovic.rousseau@free.fr)
00000473 ccid_usb.c:246:OpenUSBByName() ProductString: Generic CCID driver
00000453 ccid_usb.c:252:OpenUSBByName() Copyright: This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.
00073734 ccid_usb.c:408:OpenUSBByName() Found Vendor/Product: 0B97/7772 (O2 Micro Oz776)
00000042 ccid_usb.c:410:OpenUSBByName() Using USB bus/device: 007/003
00002612 ccid_usb.c:816:get_data_rates() declared: 9600 bps
00002002 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFB0
00000029 readerfactory.c:267:RFAddReader() Using the pcscd polling thread
00005975 ifdhandler.c:307:IFDHGetCapabilities() lun: 0, tag: 0xFAE
00000038 ifdhandler.c:353:IFDHGetCapabilities() Reader supports 1 slot(s)
09680064 ifdhandler.c:924:IFDHPowerICC() lun: 0, action: PowerUp
00996945 eventhandler.c:451:EHStatusHandlerThread() Card inserted into O2 Micro Oz776 00 00
00000055 Card ATR: 3B 3F 94 00 80 69 06 0B D0 00 32 00 00 06 0E 83 3E 9F 16 
15877702 prothandler.c:128:PHSetProtocol() Attempting PTS to T=0
00000016 ifdhandler.c:488:IFDHSetProtocolParameters() lun: 0, protocol T=0
00000017 towitoko/atr.c:351:ATR_GetDefaultProtocol() no default protocol found in ATR. Using T=0
00002304 ifdhandler.c:1035:IFDHTransmitToICC() lun: 0
00846378 ifdhandler.c:1035:IFDHTransmitToICC() lun: 0
00477672 ifdhandler.c:1035:IFDHTransmitToICC() lun: 0
00193640 ifdhandler.c:1035:IFDHTransmitToICC() lun: 0
00147987 ifdhandler.c:1035:IFDHTransmitToICC() lun: 0
00608178 ifdhandler.c:924:IFDHPowerICC() lun: 0, action: Reset
gpg的提示信息:

代码: 全选

proton@Proton:~$ gpg --card-status
gpg: detected reader `O2 Micro Oz776 00 00'
请插入智能卡并回车,或输入‘c’来取消: 
请插入智能卡并回车,或输入‘c’来取消: 
请插入智能卡并回车,或输入‘c’来取消: 
请插入智能卡并回车,或输入‘c’来取消: 
请插入智能卡并回车,或输入‘c’来取消: c
gpg: 选择 openpgp 时失败:常规错误
gpg: OpenPGP 卡不可用:常规错误
proton@Proton:~$ 
所以,神州行的手机卡应该是不能用了……

调查U盾中……
回复

回到 “归档贴”