Buscar este blog

domingo, 3 de mayo de 2015

org.apache.ws.security.WSSecurityException: General security error (WSSecurityEngine: No crypto property file supplied to verify signature)

This exception may happens due to you are using "SignaturePropRefId" instead of "signaturePropRefId" with wss4j version 1.6.X +.

In wss4j versions prior 1.6, constant value to refrerence "signaturePropRefId" was in uppercase, but this changed sinces 1.6.

<bean id="wsss4JOutInterceptor" class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor">
 <constructor-arg>
  <map>
   <entry key="action" value="Signature"/>
   <entry key="user" value="xxxxx"/> <!--  This is a bug in CXF 2.7.6. It was solved in laters versions -->
  
   <entry key="signaturePropRefId" value="signaturePropertiesBean" />
   <entry key="signaturePropertiesBean" value-ref="signatureProperties" />
   
   <entry key="signatureUser" value="myclientkey" />
   <entry key="passwordCallbackRef" value-ref="clientCallback" />
   
   <entry key="signatureKeyIdentifier" value="DirectReference" />
   <entry key="signatureParts" value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body" />
   <entry key="addInclusivePrefixes" value="false" />
   <entry key="includeSignatureToken" value="true" />
   <entry key="mustUnderstand" value="false" />
  </map>
 </constructor-arg>
</bean>


<util:properties id="signatureProperties">      
 <prop key="org.apache.ws.security.crypto.provider">org.apache.ws.security.components.crypto.Merlin</prop>      
 <prop key="org.apache.ws.security.crypto.merlin.keystore.file">D:/temp/certificates/client-IdentityStore(1234).jks</prop>      
 <prop key="org.apache.ws.security.crypto.merlin.keystore.type">jks</prop>
 <prop key="org.apache.ws.security.crypto.merlin.keystore.provider">SUN</prop>
 <prop key="org.apache.ws.security.crypto.merlin.keystore.password">1234</prop>
 <prop key="org.apache.ws.security.crypto.merlin.load.cacerts">false</prop>
</util:properties>

You can check all available constant values in the class org.apache.ws.security.handler.WSHandlerConstants.
Using eclipse is just Ctrl + T.

No hay comentarios:

Publicar un comentario