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 ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.