[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iaik-jce] NetscapeP12.class & new JCE



It is possible with the PKCS12 class of JCE2.5, use something like:

char[] password = ...;
PKCS12 pkcs12 = new PKCS12(new FileInputStream(fileName));
if (!pkcs12.verify(password))

               ....
}
pkcs12.decrypt(password);
CertificateBag[] certBag = pkcs12.getCertificateBags();
 java.security.cert.Certificate[] certChain =
CertificateBag.getCertificates(certBag);

KeyBag keyBag = pkcs12.getKeyBag();
pk = keyBag.getPrivateKey();

int chainLen = certChain.length;
certChain = new X509Certificate[chainLen];
 for (int i = 0; i < chainLen; i++) {
     System.out.println(certChain[i].toString(true));
 }


Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: david.sanchez@catalanaocci.es <david.sanchez@catalanaocci.es>
An: iaik-jce@iaik.tu-graz.ac.at <iaik-jce@iaik.tu-graz.ac.at>
Datum: Dienstag, 18. Mai 1999 14:28
Betreff: [iaik-jce] NetscapeP12.class & new JCE


>
>
>     In the previous version of the JCE, the NetscapeP12 class allows to
extract
>the X509 Certificate of a .p12 file. In the new version, 2.5, this class do
not
>exist, is posible to extract the X509 certificates from a .p12 file without
this
>class?. I try to use the PKCS12 class but it seems that not is possible.
>
>     Somebody can help me?
>
>     Thanks
>
>     David
>
>
>--
>Mailinglist-archive at
http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html
>
>To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the
folowing content: UNSUBSCRIBE iaik-jce
>
>
>


smime.p7s