blob: ca88f5b3b9325022cbc73c933238446a41bbdfc3 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">
<!-- START SNIPPET: e1 -->
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<crypto id="basic" algorithm="DES" keyRef="desKey" />
<!-- START SNIPPET: init-vector -->
<crypto id="initvector" algorithm="DES/CBC/PKCS5Padding" keyRef="desKey" initVectorRef="initializationVector" />
<!-- END SNIPPET: init-vector -->
<!-- START SNIPPET: inline -->
<crypto id="inline" algorithm="DES/CBC/PKCS5Padding" keyRef="desKey" initVectorRef="initializationVector"
inline="true" />
<crypto id="inline-decrypt" algorithm="DES/CBC/PKCS5Padding" keyRef="desKey" inline="true" />
<!-- END SNIPPET: inline -->
<!-- START SNIPPET: hmac -->
<crypto id="hmac" algorithm="DES" keyRef="desKey" shouldAppendHMAC="true" />
<!-- END SNIPPET: hmac -->
<!-- START SNIPPET: hmac-algorithm -->
<crypto id="hmac-algorithm" algorithm="DES" keyRef="desKey" macAlgorithm="HmacMD5" shouldAppendHMAC="true" />
<!-- END SNIPPET: hmac-algorithm -->
<!-- START SNIPPET: header-key -->
<crypto id="nokey" algorithm="DES" />
<!-- END SNIPPET: header-key -->
</dataFormats>
<route>
<from uri="direct:basic-encryption" />
<marshal ref="basic" />
<to uri="mock:encrypted" />
<unmarshal ref="basic" />
<to uri="mock:unencrypted" />
</route>
<route>
<from uri="direct:init-vector" />
<marshal ref="initvector" />
<to uri="mock:encrypted" />
<unmarshal ref="initvector" />
<to uri="mock:unencrypted" />
</route>
<route>
<from uri="direct:inline" />
<marshal ref="inline" />
<to uri="mock:encrypted" />
<unmarshal ref="inline-decrypt" />
<to uri="mock:unencrypted" />
</route>
<route>
<from uri="direct:hmac" />
<marshal ref="hmac" />
<to uri="mock:encrypted" />
<unmarshal ref="hmac" />
<to uri="mock:unencrypted" />
</route>
<route>
<from uri="direct:hmac-algorithm" />
<marshal ref="hmac-algorithm" />
<to uri="mock:encrypted" />
<unmarshal ref="hmac-algorithm" />
<to uri="mock:unencrypted" />
</route>
<route>
<from uri="direct:key-in-header-encrypt" />
<marshal ref="nokey" />
<setHeader headerName="CamelCryptoKey">
<constant />
</setHeader>
<to uri="mock:encrypted" />
</route>
<route>
<from uri="direct:key-in-header-decrypt" />
<unmarshal ref="nokey" />
<setHeader headerName="CamelCryptoKey">
<constant />
</setHeader>
<to uri="mock:unencrypted" />
</route>
</camelContext>
<bean id="desKey" class="org.apache.camel.converter.crypto.SpringCryptoDataFormatTest" factory-method="getDesKey" />
<bean id="initializationVector" class="org.apache.camel.converter.crypto.SpringCryptoDataFormatTest" factory-method="getIV" />
</beans>