Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.security > #144

Re: Loading keystores fro

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Dave Miller" <dave.miller@THRWHITE.remove-dii-this>
Subject Re: Loading keystores fro
Message-ID <OFakk.477$Ht4.473@trnddc01> (permalink)
X-Comment-To comp.lang.java.security
Newsgroups comp.lang.java.security
In-Reply-To <5bea81f5-d7db-4990-86ea-00b74857dbda@p25g2000hsf.googlegroups.com>
References <5bea81f5-d7db-4990-86ea-00b74857dbda@p25g2000hsf.googlegroups.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 49
Date Wed, 27 Apr 2011 16:08:24 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303920504 96.60.20.240 (Wed, 27 Apr 2011 11:08:24 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 11:08:24 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.security:144

Show key headers only | View raw


  To: comp.lang.java.security
Thomaspantalacci311@hotmail.com wrote:
> I had an other question, but i couldn't found any response. I have two
> certificates in my smartcard. How can i load the both certificates.
> I tryed this code
> 
> char[] pin = smartCardPIN.toCharArray();
> KeyStore keyStore = null;
> try{
>      keyStore = KeyStore.getInstance("PKCS11");//
> }catch(Exception e){
>      e.printStackTrace();
> }
> keyStore.load(null, pin);
> Enumeration aliases = keyStore.aliases();
> if (aliases.hasMoreElements()) {
>      String alias = (String)aliases.nextElement();
>      System.out.println("alias:"+alias);
>      //getting the certificate chain and the private key
>      Certificate[] certificationChain =
> keyStore.getCertificateChain(alias);
>      PrivateKey privateKey = (PrivateKey) keyStore.getKey(alias,
> null);
>      ....
> 
> }
> 
> ...
> 
> 
> But aliases enumeration has only one element, since it prints

You've created a keystore and placed one element into it. When you say 
"show me elements" it... shows you the one that you've entered.

I've never tried to manipulate the keystore on the client's machine so I 
won't be any help there. My sense is that doing so would take a bit of a 
hack (or crack). As the keystore holds the keys (literally) to the 
client's security, the JVM probably tries to keep it pretty well locked up.

-- 
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.security | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Loading keystores fro "Dave Miller" <dave.miller@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
  Re: Loading keystores fro "Thomaspantalacci311" <thomaspantalacci311@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
    Re: Loading keystores fro "Dave Miller" <dave.miller@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000
      Re: Loading keystores fro "Thomaspantalacci311" <thomaspantalacci311@THRWHITE.remove-dii-this> - 2011-04-27 16:08 +0000

csiph-web