aspose file tools*
The moose likes Web Services and the fly likes IOException: Keystore was tampered with, or password was incorrect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "IOException: Keystore was tampered with, or password was incorrect" Watch "IOException: Keystore was tampered with, or password was incorrect" New topic
Author

IOException: Keystore was tampered with, or password was incorrect

Neha Gap
Greenhorn

Joined: May 30, 2007
Posts: 29
Hi,

I have created a key pair each for the client and the server side. I then imported the client's public key into the server's keystore. Now, my client-deploy.wsdd looks like this

<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<transport name="http" pivot="java rg.apache.axis.transport.http.HTTPSender"/>
<globalConfiguration >
<requestFlow >
<handler type="java rg.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="UsernameToken Encrypt"/>
<parameter name="user" value="wss4j"/>
<parameter name="passwordCallbackClass" value="com.comp.webservice.PWCallback"/>
<parameter name="passwordType" value="PasswordDigest"/>
<parameter name="addUTElement" value="Nonce Created" />
<parameter name="encryptionPropFile" value="client_crypto.properties" />
<parameter name="encryptionKeyIdentifier" value="X509KeyIdentifier" />
<parameter name="encryptionUser" value="privkey" />
<parameter name="encryptionParts"
value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}UsernameToken" />
</handler>
</requestFlow >
</globalConfiguration >
</deployment>

and my server-deploy.wsdd looks like this

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

<service name="SayHelloService" provider="java:RPC">
<requestFlow>
<handler type="java rg.apache.ws.axis.security.WSDoAllReceiver">
<parameter name="passwordCallbackClass" value="PWCallback"/>
<parameter name="action" value="UsernameToken Encrypt"/>
<parameter name="decryptionPropFile" value="server_crypto.properties" />
</handler>
</requestFlow>
<parameter name="className" value="com.comp.webservice.SayHelloService"/>
<parameter name="allowedMethods" value="*"/>
</service>

</deployment>


Everything seems to be right, yet when I run the client, it says

IOException: Keystore was tampered with, or password was incorrect

What am I doing wrong... I'm guessing its a very fundamental mistake that I'm not able to notice. Please help me if you have any clues of how to go about solving this one.

Thanks in advance.
- Neha.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

It's either you provided the wrong keystore password or you didn't provide any password at all and your keystore requires a password.

You can try to go to the path where that keystore is located and issue this command.


Hope this helps.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Neha Gap
Greenhorn

Joined: May 30, 2007
Posts: 29
Thanks for the reply.

I generated the keystores and then used them in the crypto.properties file. I'm sure the password is correct, I even checked using the method you just mentioned. Yet i continue to get the same exception.

- Neha.
Neha Gap
Greenhorn

Joined: May 30, 2007
Posts: 29
Anybody seen a similar error? Please let me know.

Thanks
- Neha.
Neha Gap
Greenhorn

Joined: May 30, 2007
Posts: 29
Ok the deal is that the keystore is not created correctly. I'm surprised this is so because I created the keys using the keytool as explained in the keytool manual. Even checked using keytool -list on the console, it gave me the expected results.

Anyway, if anyone is facing a similar problem while running a sample app using wss4j, you can try using the .keystore file provided in wss4j/keys

Also, if someone is aware of why I the keys I created using keytool are not being read, please let me know.

Thank you
- Neha.
 
 
subject: IOException: Keystore was tampered with, or password was incorrect