智能卡阅读器和ChromeApp [英] Smartcard Reader and ChromeApp

查看:146
本文介绍了智能卡阅读器和ChromeApp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个可以访问USB SmartCard读卡器(HID Global OmniKey 3121)的Chrome应用.

I want to make a Chrome App that can access a USB SmartCard Reader (HID Global OmniKey 3121).

有人成功做到了吗?

很遗憾,我无法使用usb.getDevices看到它.

Unfortunately, I cannot see it using usb.getDevices.

script.js (由 index.html 调用,其本身由 background.js onLaunched调用):

script.js (called by index.html which is itself called by background.js onLaunched):

//dom elements
var findBtn = document.querySelector( "button#find-btn" )
var deviceInfo = document.querySelector( "p#device-info" )

//{click}
findBtn.addEventListener( "click", findDevice )

/*
 * Try to find HID OmniKey 3x21
 */
function findDevice ()
{
  var options = {
    filters: [
      {
        vendorId: 1899,  //OmniKey AG
        productId: 12321  //CardMan 3121 but PID=0x3021
      }
    ]
  }

  chrome.usb.getDevices( options, function ( devices )
  {
    console.log( devices )
    deviceInfo.innerHTML = JSON.stringify( devices[0] )
  } )

}

该设备在清单中声明,并被Chrome在扩展程序"页面中识别.

The device is declared in the manifest and recognized by Chrome in the Extensions page.

预先感谢您的帮助.

编辑

这是我的 manifest.json :

{
  "manifest_version": 2,
  "name": "Card Reader",
  "description": "Smartcard reader",
  "version": "0.0.2",
  "minimum_chrome_version": "43",

  "app": {
    "background": {
      "scripts": [ "js/background.js" ]
    }
  },

  "permissions": [
    "usb",

    {
      "usbDevices": [
        {
          "vendorId": 1057,
          "productId": 1633
        },
        {
          "vendorId": 1133,
          "productId": 49271
        },
        {
          "vendorId": 1899,
          "productId": 12321
        }
      ]
    }
  ]
}

3个允许的设备是:

  1. 诺基亚Lumia 920
  2. 戴尔光电鼠标
  3. OmniKey智能卡读取器3121

仅鼠标可以被usb.getDevicesusb.findDevices识别. usb.getUserSelectedDevices仅列出鼠标.

Only the mouse is recognized by usb.getDevices or usb.findDevices. Only the mouse is listed by usb.getUserSelectedDevices.

推荐答案

使用HID Global的本机驱动程序时,Chrome无法识别该设备.

The device is not recognized by Chrome when the native driver from HID Global is used.

解决方法是使用备用USB驱动程序,例如Zadig安装程序从 zadig.akeo.ie :

The workaround is to use an alternate USB driver, for example one provided by the Zadig installer from zadig.akeo.ie:

  • WinUSB
  • libusb-win32
  • libusbK

我在HID Device处开了一个案子,但他们的技术支持尚未了解问题所在(他们不知道什么是Chrome平台...),然后将我重定向到Google.

I opened a case at HID Device but their technical support has not understood the problem yet (they don't know what is the Chrome Platform...) and redirected me to Google.

我在Google开了一个案子,但他们回答我应该在StackOverflow上发布!!他们似乎并不介意其平台无法识别标准USB SmartCard设备,尽管在Windows设备管理器中可以看到这些信息.

I opened a case at Google but they answered me I should post on StackOverflow!! They don't seem to mind if their Platform cannot recognize standard USB SmartCard devices, though visible in the Windows device manager...

更新

HID技术支持人员表示,他们的驱动程序将在2016年支持该平台. Goolge支持仍在...不可行.

HID technical support said their driver will support the platform by 2016. Goolge support is still... inapt.

Windows 7-10的更新

在Windows 7和10上,我不需要安装通用驱动程序.相反,我只是在 Windows设备管理器中编辑智能卡阅读器,然后选择以前的驱动程序.它将还原为Windows Generic USB CCID驱动程序,该驱动程序可与我的旧PC/SC Winscard应用程序和Chrome应用程序一起使用.

On Windows 7 and 10 I don't need to install a generic driver. Instead I just edit the Smartcard Reader in Windows Device Manager and select the Previous Driver. It will revert to the Windows Generic USB CCID driver, that works with both my legacy PC/SC Winscard application and my Chrome App.

这篇关于智能卡阅读器和ChromeApp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆