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

RE: [iaik-jce] How can I import a certificate from IE



Give this a try:

    Certificate cert = null;
    InputStream fis = new FileInputStream("test.cer");
    String JCE_PROVIDER = "IAIK";
    String certType = "X.509";

    try
    {
      CertificateFactory cf = CertificateFactory.getInstance(certType,
JCE_PROVIDER);
      cert = cf.generateCertificate(is);
    }
    ...

________________________________________________________________
Nigel M. Lowe, B. Eng.
Senior Software Engineer
Delano Technology Corporation
Voice: (905) 947-2271
E-mail: nlowe@delanotech.com

Delano.  What Customer Relationships Should Be.
________________________________________________________________ 



-----Original Message-----
From: Ricky Wong [mailto:RickyWong@dahsing.com]
Sent: Thursday, February 08, 2001 3:07 AM
To: 'iaik-jce@iaik.tu-graz.ac.at'
Subject: [iaik-jce] How can I import a certificate from IE


I've generate a certificate with W2k's Certificate Server and it is
installed in the IE browser keystore. I then export the certificate with DER
format and attempt to read the certificate with the following code :

	InputStream fis = new FileInputStream("test.cer");
	recipientCertificate = new X509Certificate(fis);
	encryptionCertOfSigner = new X509Certificate(fis);

When I run the program, I got the error
"java.security.cert.CertificateException: Cannot parse an ASN1 object from a
null object.". What's wrong ? Can I do something like this ?

Regards,

Ricky
---
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
 
--
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