Encrypting and decrypting a message
Camel's Crypto Component is used when you need to encrypt and decrypt an entire message. It provides a Camel Data Format that allows you to marshal (encrypt) or unmarshal (decrypt) your data.
The Crypto Component supports both symmetric (using a shared password) and asymmetric (using public key of recipient) encryption—the latter through PGP.
This recipe will show you how to configure basic symmetric encryption. It will show both marshaling (encrypting) and unmarshaling (decrypting) data. These actions would normally be done in different Camel routes on different systems.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.security.encryption
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with encryption
.
To use Camel's Crypto Component, add the following to the dependencies
section of your Maven POM:
<dependency> <groupId>org.apache.camel</groupId...