java.security.InvalidKeyException: Public key presented not for certificate signature

After resolving the below mention problem, I start getting the exception given below.

Exception : [ERROR] Exception at line 122, column 68 of oxf:/ops/pfc/xforms-epilogue.xpl (re

ading processor output: name=’document’, id=’xhtml-data’)

java.security.InvalidKeyException: Public key presented not for certificate sign

ature

        at org.bouncycastle.jce.provider.X509CertificateObject.checkSignature(Un

known Source)

        at org.bouncycastle.jce.provider.X509CertificateObject.verify(Unknown So

urce)

        at javax.crypto.SunJCE_b.d(DashoA12275)

        at javax.crypto.SunJCE_b.c(DashoA12275)

        at javax.crypto.SunJCE_r.run(DashoA12275)

        at java.security.AccessController.doPrivileged(Native Method)

        at javax.crypto.SunJCE_b.<clinit>(DashoA12275)

        at javax.crypto.Cipher.getInstance(DashoA12275)

        at org.orbeon.oxf.util.SecureUtils.encrypt(SecureUtils.java:135)

        at org.orbeon.oxf.xforms.XFormsUtils.encodeBytes(XFormsUtils.java:184)

        at org.orbeon.oxf.xforms.XFormsUtils.encodeXML(XFormsUtils.java:157)

        at org.orbeon.oxf.xforms.XFormsStaticState.getEncodedStaticState(XFormsS

taticState.java:220)

The resolution to this problem was probably the last nail in the coffin of my problems which I was facing since last 13-14 days. I have found the resolution on this link. Though you can find the steps of resolution of this problem on the link (And infect they are original) I am writing them again (copying infect) in case this link stop working tomorrow.

1. Suppose you are using jdk15. Go to http://java.sun.com/javase/downloads/index_jdk5.jsp

2. Go to the Other Downloads section and click on download link next to “Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 5.0”

3. Download jce_policy-1_5_0.zip and extract it in to a directory.

4. You will find local_policy.jar and US_export_policy.jar files there in the extracted directory. Copy these two files to $JAVA_HOME/jre/lib/security directory. (These files will already be there. you may replace them)

5. Restart WSO2 WSAS and invoke your secured service again. You will not encounter the “invalidkeyException” any more.

I would like to say thanks to Charitha to help me out in resolving this issue in the same way as Yuvi is doing to Kumar Sangakara and M. Jaya to help him in winning a match or two for KIP.

Advertisements

5 Comments

Filed under WebLogic

5 responses to “java.security.InvalidKeyException: Public key presented not for certificate signature

  1. Joshua

    Is there any security issues/concerns with have an unlimited strenght?

  2. Great post. I was checking continuously this blog and I’m impressed! Very helpful info specifically the final section 🙂 I care for such information much. I used to be looking for this particular info for a very lengthy time. Thanks and good luck.

  3. Terrific paintings! This is the kind of info that are supposed to be shared across the internet. Shame on Google for now not positioning this submit upper! Come on over and discuss with my site . Thanks =)

  4. Hello there! This post couldn’t be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this article to him. Fairly certain he will have a good read. Thanks for sharing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s