You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by apdwivedi1208 <ap...@gmail.com> on 2013/09/27 09:05:29 UTC
XML DSL for Encrpt decrypt data
I am new to camel and was trying to encrypt/decrypt data using camel XML DSL.
<dataFormats>
<crypto id="initvector" algorithm="DES" keyRef="desKey" />
</dataFormats>
but it was unable to understand desKey So i have tried couple of thing to
define desKey as a bean using "SecretKeySpec" and "KeyGenerator" class but
noting is working. I am also not able to find any working example on it.
Please help to get an example on XML dsl for data encryption.
--
View this message in context: http://camel.465427.n5.nabble.com/XML-DSL-for-Encrpt-decrypt-data-tp5740281.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: XML DSL for Encrpt decrypt data
Posted by Colm O hEigeartaigh <co...@apache.org>.
"keyRef" is a reference to a java.security.Key Object in the Camel
Registry. To see how it works, take a look at one of the tests:
https://github.com/apache/camel/blob/master/components/camel-crypto/src/test/resources/org/apache/camel/component/crypto/SpringCryptoDataFormatTest.xml
<crypto id="initvector" algorithm="DES/CBC/PKCS5Padding" keyRef="desKey"
initVectorRef="initializationVector" />
<bean id="desKey"
class="org.apache.camel.converter.crypto.SpringCryptoDataFormatTest"
factory-method="getDesKey" />
The latter method is available here:
https://github.com/apache/camel/blob/master/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/SpringCryptoDataFormatTest.java
Colm.
On Fri, Sep 27, 2013 at 8:05 AM, apdwivedi1208 <ap...@gmail.com>wrote:
> I am new to camel and was trying to encrypt/decrypt data using camel XML
> DSL.
>
> <dataFormats>
> <crypto id="initvector" algorithm="DES" keyRef="desKey" />
> </dataFormats>
>
> but it was unable to understand desKey So i have tried couple of thing to
> define desKey as a bean using "SecretKeySpec" and "KeyGenerator" class but
> noting is working. I am also not able to find any working example on it.
> Please help to get an example on XML dsl for data encryption.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/XML-DSL-for-Encrpt-decrypt-data-tp5740281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com