• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2236
  • Last Modified:

How to load the crypto properties file [WSS4J related]

Hi, I am writing a WebService client which is signing the SOAP request using WSS4J api. In the WSDD file I have defined SIG_PROP_FILE which points to the crypto.properties which has keystore specific information.
I am loading the WSDD using:
EngineConfiguration config = new FileProvider("<pathname>/client_deploy.wsdd");

Now, when I send a request to the WebService, I got this error message:

Server.userException:java.lang.RuntimeException: CryptoFactory: Cannot load properties:<fname>
I added the properties file in the classpath, but still getting the same error. Any pointers how can I fix this issue?

Thanks a lot.
Leo
0
LeoKris
Asked:
LeoKris
  • 2
1 Solution
 
LeoKrisAuthor Commented:
Additional comment:

Entry in the WSDD file looks like:

<parameter name="SIG_PROP_FILE" value="<fpath>/crypto.properties"/>  

and, the crypto.properties looks like:

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=keyStorePassword
org.apache.ws.security.crypto.merlin.keystore.alias=myAlias
org.apache.ws.security.crypto.merlin.file=client_keystore.jks
0
 
objectsCommented:
> <parameter name="SIG_PROP_FILE" value="<fpath>/crypto.properties"/>  

that shouldn't be a filepath, try just:


<parameter name="SIG_PROP_FILE" value="crypto.properties"/>  

and put the properties file in the a directory that is in your classpath
0
 
LeoKrisAuthor Commented:
Hi Objects,
          thanks a lot for your help, it has fixed the issue with a minor change though.
After making the changes, I got this exception:

org.apache.ws.security.WSSecurityException: WSHandler: Signature: no crypto properties

I had to rename the parameter SIG_PROP_FILE to  signaturePropFile and it fixed the issue.

Thanks
Leo
0

Featured Post

Cyber Threats to Small Businesses (Part 2)

The evolving cybersecurity landscape presents SMBs with a host of new threats to their clients, their data, and their bottom line. In part 2 of this blog series, learn three quick processes Webroot’s CISO, Gary Hayslip, recommends to help small businesses beat modern threats.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now