2

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?

Jonathan
  • 20,053
  • 6
  • 63
  • 70
Ashish Kataria
  • 520
  • 3
  • 11
  • 31

1 Answers1

0

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 (e.g. 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.
Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263