简体   繁体   中英

Read Certificate from VPN Token/Smart card

I am trying to read VPN certificate from token device as below:

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.

Is it possible to load the same instance of keystroke one has already connected to VPN, avoiding PIN request?

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?

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;
  2. That a localized issue, it might be that another program has exclusive access (eg the VPN client still has access);
  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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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