I am trying to Encrypt User Name. I am getting Server Error with no details
Every thing is null. I am kind of struck. Please any help is very much
appreciated.

The message I get back is

"Server Error"

Tools using are : Tomcat 5, JDK 1.4, axis 1.4, wss4j 1.5
Below is some of my code. I am able to use wss4j with no encrption. But with
UsernameToken Encrypt I am getting error. Please shed any light. I am struck
as I am not geting a detailed error.

My server wssdd is

 <requestFlow>
  <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
   <parameter name="passwordCallbackClass"
     value="leo.webservices.PWCallback"/>
   <parameter name="action" value="UsernameToken Encrypt"/>
   <parameter name="decryptionPropFile" value="crypto1.properties" />
  </handler>
 </requestFlow>



Client WSDD is

<requestFlow>
  <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
   <parameter name="action" value="UsernameToken Encrypt"/>
   <parameter name="user" value="werner"/>
   <parameter name="passwordCallbackClass" value="client.PWCallback"/>
   <parameter name="passwordType" value="PasswordText" />
   <parameter name="addUTElement" value="Nonce Created" />
   <parameter name="encryptionPropFile" value="crypto1.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>



Crpto1.properties file is

org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=security
org.apache.ws.security.crypto.merlin.keystore.alias=privkey
org.apache.ws.security.crypto.merlin.alias.password=security
org.apache.ws.security.crypto.merlin.file=privkeystore

Commands to generate keys are

keytool -genkey -alias privkey -keystore privkeystore -keyalg RSA -dname
"cn=kanebo" -keypass security -storepass security

keytool -genkey -alias pubkey -keystore pubkeystore -keyalg RSA -dname
"cn=kanebo" -keypass security -storepass security

keytool -selfcert -alias privkey -keystore privkeystore -keypass security
-storepass security

keytool -selfcert -alias pubkey -keystore pubkeystore -keypass security
-storepass security


keytool -export -keystore pubkeystore -alias pubkey -storepass security
-file pubcert

keytool -import -alias pubkey -file pubcert -keystore privkeystore
-storepass security

Reply via email to