Java 使用AES加密的CXF-WS-Security
我可能会根据以下要求使用CXF框架实现Web服务:Java 使用AES加密的CXF-WS-Security,java,cxf,ws-security,Java,Cxf,Ws Security,我可能会根据以下要求使用CXF框架实现Web服务: 用户名令牌 AES加密 在调用密钥之前,系统可能会将密钥传递给WS。我试图配置如下,但不工作 <bean id="logInBound" class="org.apache.cxf.interceptor.LoggingInInterceptor" /> <bean id="logOutBound" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
- 用户名令牌
- AES加密
<bean id="logInBound" class="org.apache.cxf.interceptor.LoggingInInterceptor" />
<bean id="logOutBound" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
<jaxws:client id="helloClient" serviceClass="com.itiboss.facade.HelloWorld" address="http://localhost:18080/spring-jpa/ws/HelloWorld">
<jaxws:properties>
<entry key="mtom-enabled" value="true"/>
</jaxws:properties>
<jaxws:inInterceptors>
<ref bean="logInBound" />
</jaxws:inInterceptors>
<jaxws:outInterceptors>
<ref bean="logOutBound" />
<ref bean="outbound-security" />
</jaxws:outInterceptors>
</jaxws:client>
<!-- WSS4JOutInterceptor for incorporating a UsernameToken in a SOAP -->
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor" id="outbound-security">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken Encrypt"/>
<entry key="user" value="dummy"/>
<entry key="allowMTOM" value="true"/>
<entry key="encryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<!--entry key="passwordType" value="PasswordText"/-->
<entry key="passwordCallbackClass" value="com.itiboss.facade.ClientPasswordCallback"/>
</map>
</constructor-arg>
</bean>