简体   繁体   English

从VPN令牌/智能卡读取证书

[英]Read Certificate from VPN Token/Smart card

I am trying to read VPN certificate from token device as below: 我正在尝试从令牌设备读取VPN证书,如下所示:

keystore = KeyStore.getInstance("Windows-MY","SunMSCAPI");  
keystore.load(null, null);
int i=0;

for(Enumeration oEnum = keystore.aliases(); oEnum.hasMoreElements();) 
{  
    sAlias = (String) oEnum.nextElement();
    TokenReader tr = new TokenReader();
    String id =  tr.readToken(sAlias, keystore);

    setFont(new Font("Helvetica", Font.BOLD, 36));    
    i++;  
}

It's asking for PIN again, where as when already I am connected to vpn, which affirmed already I provided PIN once. 再次要求输入PIN码,就像我已经连接到vpn的位置一样,这确认我已经提供了PIN码一次。

Is it possible to load the same instance of keystroke one has already connected to VPN, avoiding PIN request? 是否可以加载已经连接到VPN的同一击键实例,从而避免PIN请求?

Moreover on some machines, it's giving Please insert a smart card error box what could be the issue? 此外,在某些机器上,它会提示请插入智能卡错误框 ,可能是什么问题?

or any other, suggested way for reading certificate from Smart Card/VPN Token? 或从智能卡/ VPN令牌读取证书的任何其他建议方法?

That's three questions, but I'll try and answer. 这是三个问题,但我会尽力回答。

  1. Probably not, it's not a good idea if PIN entry boxes can be read out by other applications, and smart cards don't remember PIN's after a reset; 可能不是,如果其他应用程序可以读取PIN输入框,并且智能卡在重置后不记得PIN,那不是一个好主意。
  2. That a localized issue, it might be that another program has exclusive access (eg the VPN client still has access); 这是一个本地化的问题,可能是另一个程序具有独占访问权(例如VPN客户端仍然具有访问权);
  3. I don't think there are any other ways, if there are any they will probably require you to install additional software on the target machine. 我认为没有其他方法,如果有的话,它们可能会要求您在目标计算机上安装其他软件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM