Re: How Java work with PKCS12?
From: Samui (samuicheng_at_yahoo.com.hk)
Date: 07/29/03
- Next message: Mike: "Re: [NEWS] Hacker code could unleash Windows worm"
- Previous message: Andrew: "Re: Please Help with WINCFG.SCR Infection !"
- In reply to: Didi: "Re: How Java work with PKCS12?"
- Next in thread: Roedy Green: "Re: How Java work with PKCS12?"
- Reply: Roedy Green: "Re: How Java work with PKCS12?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 29 Jul 2003 00:24:40 -0700
Hi,
I have tried your codes and add my own codes to get private key.
Is this a right approach?
And how can I get the public key ?
for(Enumeration enum=ks.aliases(); enum.hasMoreElements();){
String alias = (String)enum.nextElement();
System.out.println("@:" + alias);
if (ks.isKeyEntry(alias)){
System.out.println("return PrivateKey");
return (PrivateKey)ks.getKey(alias, password);
}
}
"Didi" <didi1976NO@SPAMgmx.net> wrote in message news:<bg3i4c$672$1@paperboy.Austria.EU.net>...
> Hi,
>
> you can access a PKCS12-File directly from Java.
>
> java.security.KeyStore ks = java.security.KeyStore.getInstance("PKCS12");
> ks.load(new
> java.io.FileInputStream("yourStore.p12"),"yourPassword".toCharArray());
>
> Didi
>
>
> "Samui" <samuicheng@yahoo.com.hk> schrieb im Newsbeitrag
> news:978c0c78.0307232208.a66f8f2@posting.google.com...
> > Hi,
> > I'm a beginner of Java security.
> > Is it possible to get Public Key and Private Key from a PKCS12
> > certificate by Java program?
> > How can I do it?
> > Is there any sample codes or tutorial?
> >
> > Thanks!
> >
> > Samui
- Next message: Mike: "Re: [NEWS] Hacker code could unleash Windows worm"
- Previous message: Andrew: "Re: Please Help with WINCFG.SCR Infection !"
- In reply to: Didi: "Re: How Java work with PKCS12?"
- Next in thread: Roedy Green: "Re: How Java work with PKCS12?"
- Reply: Roedy Green: "Re: How Java work with PKCS12?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|