Hi!

I am studying the various options for encryption and mi first test case is
to use a Encryption/Decryption using a shared symmetric key. I create the
keystore with that keytool command: 
keytool -genseckey -alias symmetric -keyalg DESede -keystore
symmetricStore.jks -storepass symmetricPassword -keypass keyPassword
-storetype JCEKS

And the spring config client file (only probe encryption/decryption):
####################
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:jaxws="http://cxf.apache.org/jaxws";
      xmlns:http="http://cxf.apache.org/transports/http/configuration";
       xsi:schemaLocation="http://www.springframework.org/schema/beans
          http://www.springframework.org/schema/beans/spring-beans.xsd
          http://cxf.apache.org/jaxws
          http://cxf.apache.org/schemas/jaxws.xsd";>

   <bean id="client" class="com.solnss.jaxws.PersonasService" 
        factory-bean="clientFactory" factory-method="create"/>
        
   <bean id="clientFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
     <property name="serviceClass"
value="com.solnss.jaxws.PersonasService"/>
     <property name="address"
value="http://localhost:8090/JAX-WSService-ENC/services/PersonasService"/>
       <property name="inInterceptors">
         <list>
            <ref bean="TimestampSignEncrypt_Response"/>
         </list>
       </property>
       <property name="outInterceptors">
         <list>
            <ref bean="TimestampSignEncrypt_Request"/>
         </list>
       </property>
   </bean>

    
    <bean 
        class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
        id="TimestampSignEncrypt_Request">
        <constructor-arg>
            <map>
                <entry key="action" value="Encrypt"/>
                <entry key="encryptionUser" value="symmetric"/>
                <entry key="encryptionPropFile"
value="SymetricKeystore.properties"/>
                <entry key="passwordCallbackClass"
value="com.solnss.jaxws.ClientKeystorePasswordCallback"/>
                <entry key="encryptionParts"
value="{Element}{Null}apellidos"/>
                <entry key="encryptionSymAlgorithm"
value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
            </map>
        </constructor-arg>
    </bean>
    
    
    <bean 
        class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
        id="TimestampSignEncrypt_Response">
        <constructor-arg>
            <map>
                <entry key="action" value="Encrypt"/>
                <entry key="decryptionPropFile"
value="SymetricKeystore.properties"/>
                <entry key="passwordCallbackClass"
value="com.solnss.jaxws.ClientKeystorePasswordCallback"/>
            </map>
        </constructor-arg>
    </bean>

</beans>


##############

when I run the client I get the following error:

##############
Caused by: org.apache.ws.security.WSSecurityException: General security
error (No certificates for user symmetric were found for encryption)
        at
org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:251)
        at 
org.apache.ws.security.message.WSSecEncrypt.build(WSSecEncrypt.java:293)
        at
org.apache.ws.security.action.EncryptionAction.execute(EncryptionAction.java:75)
        ... 13 more
##############

The certificate is on the keystore and the alias is correct, but i don´t
understand why don´t works...

Can you help me with this case?

Thanks for anticipate!

Carlos

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Encryption-Decryption-using-a-shared-symmetric-key-tp5710302.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to