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

[iaik-jce] NoClassDefFoundError is thrown in reading PKCS12 file



Hi !!

An applet is written to read PKCS12.

Unfortunately, error occurs:
java.lang.NoClassDefFoundError: iaik/pkcs/pkcs7/DataStream

	at TestPKCS12.readPKCS12(TestPKCS12.java:82)

	at TestPKCS12.jbInit(TestPKCS12.java:50)

	at TestPKCS12.init(TestPKCS12.java:34)

	at sun.applet.AppletPanel.run(Unknown Source)

	at java.lang.Thread.run(Unknown Source)

Please kindly tell me what is going wrong ?

Thanks in advanced.

Regards,
Joyce

---------------

readPKCS12() function is shown as follows:
77  public void readPKCS12() {
78    try {
79      IAIK.addAsProvider(true);
80 //   PKCS12 pk12 = new PKCS12(new FileInputStream(PFXFile));
81      InputStream is = new FileInputStream(PFXFile);
82      PKCS12 pk12 = (is != null) ? new PKCS12(is) : null;
83      if (pk12 != null) {
84        if (!pk12.verify(password))
85          this.textArea.append("PKCS12 Verification error");
86
87        pk12.decrypt(password);
88        CertificateBag[] certBags = pk12.getCertificateBags();
89        if (certBags != null) {
90          CertificateBag certBag = certBags[0];
91          if (certBag != null) {
92            iaik.x509.X509Certificate x509 = certBag.getCertificate();
93            System.out.println (x509);
94          } else
95            System.err.println("[readPKCS12] certBag is null");
96        } else
97          System.err.println("[readPKCS12] certBags are null");
98      } else
99        System.err.println("[readPKCS12] pk12 is null");
100    } catch (Exception ex) {
101      this.textArea.append("\n ** [readPKCS12] Error ** " +
ex.getMessage());
102    }
103  }
--
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