Message body encryption

In the previous chapter, we saw how to encrypt a complete HTTP message using HTTPS. Now, we will explain how we can encrypt just the message body and the differences between each process. We start by constructing a simple example, and then, as we perform the respective tests of our implementation, we'll understand how it works.

In order not to spoil our previous project, we will build a new one. For this, we will execute the following commands in the terminal:

mvn archetype:generate -DgroupId=com.packtpub -DartifactId=encryption -DarchetypeArtifactId=webapp-javaee6 -DarchetypeGroupId=org.codehaus.mojo.archetypes

As seen earlier in this chapter, when you get asked for a version, change the default value of 1.0-SNAPSHOT to ...

Get RESTful Java Web Services Security now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.