[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[iaik-jce] Importing a PFX file from IE 5.5
I've tried to use the following code to import a certificate exported from
IE 5.5 :
X509Certificate userCert = null;
try {
PKCS12 mp12 = new PKCS12(new FileInputStream(cert));
char[] passphrase = password.toCharArray();
mp12.decrypt(passphrase);
// extract the cert chain from the pfx file
CertificateBag[] certBag = mp12.getCertificateBags();
if (certBag != null) {
System.out.println("CertificateBag :" + certBag.toString());
X509Certificate[] certs =
CertificateBag.getCertificates(certBag);
userCert = certs[certs.length - 1];
}
} catch (Exception e) {
e.printStackTrace();
}
When I run the above code, I encounter the error
"iaik.pkcs.PKCSParsingException: ASN.1 creation error:Length: Too large
ASN.1 object: 113". I've tried to run the same program with PKCS#12 file
generated from a different CA and it works.
Any hint ? The version of IAIK I'm using is 2.61, does it support PFX file
exported from IE 5.5 ?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.230 / Virus Database: 111 - Release Date: 1/25/2001
--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html
To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce