Test encryption and decryption

Bharath Thippireddy
A free video tutorial from Bharath Thippireddy
IT Architect and Best Selling Instructor- 450000+ students
4.5 instructor rating • 35 courses • 463,322 students

Learn more from the full course

Java Web Services Part 2 - SOAP and REST Security

Master advanced web services concepts and implement them in easy steps

04:22:27 of on-demand video • Updated October 2021

  • Develop a simple SOAP service and client
  • Learn what WS Security is
  • Master the four security concepts - Authentication Confidentiality Integrity and Non Repudiation
  • Implement SOAP Web Services security using Apache CXF and WSS4J
  • Implement Username Token Profile authentication on client and the provider
  • Understand Encryption and Decryption
  • Learn how to use the java keytool
  • Generate and use keys/certificates
  • Implement Encryption and Decryption
  • Sign the SOAP messages and ensure message integrity
  • Enable Timestamps to prevent replay attacks
  • And much more in the future on this agile style and incremental course
English In this lecture you will see encryption in action will first build the server-side application run it on the server and then we will build and run the client test right click run as maven clean that will clean up the target directory run as maven install and once that successfully completes we can do a run as run on server so right click on the project run as run on server that should deploy our application along with a decryption support on the server side once it's up it should launch the default page in the web browser let's copy that link go back to chrome paste the link in the browser click on the available services click on the wsdl link and we are good on the server side go back to the client side right click on the sum ws client do a run as maven clean right click maven install once that successfully completes we'll go to the test class that we have written earlier the J unit test which is under SRC test Java and open up the some WS tests now when we run this test the client should include the username token profile information as well as the encryption data or it should encrypt the body of the soap message let's see if it does that right click run as J unit test we should see that our test should be green which it is so we have successfully sent a request which is encrypted and got an expected response which is 30 otherwise our test would have failed so the encryption and decryption should have happened to make sure go to the console scroll it up go to the tomcat console if you are on the client console you can switch it here go to tomcat console check out the inbound message right here copy this message and in Eclipse you have created a result dot XML earlier on the client project so go to that result dot xml do a ctrl a ctrl V and ctrl shift F to format and you will see that the entire soap body is now encrypted you dont see 10 and 20 here but it's all encrypted you will also see the algorithm that is used the key information etc so our request got encrypted on the server side it decrypted the request calculated the result or invoked the endpoint and then send back the unencrypted result back if you go back to the console we have only used encryption and decryption one way if you see the response copy it go back to the result paste the response do a ctrl shift F this here is not encrypted yet we are going to do that next.