Encryption

  1. Create the AESencrp class (use a better name) found here in your web app from last task
  2. Create so Junit tests to help convince you that you can encrypt and decrypt strings
  3. Create the EncryptionResource class found here in your web app from last task
  4. Don't forget to add the new EncryptionResource endpoint to your StartApplication.java
  5. Test your endpoint with

    http://localhost:8080/gettingstartedwithrest/encryption/encrypt?first=dog&second=cat
    and check that it returns the encrypted value of dog/cat, e.g. something like XI3CKRf2uFlyaBlpuxtIZg==

  6. Test your endpoint with

    http://localhost:8080/gettingstartedwithrest/encryption/decrypt?first=XI3CKRf2uFlyaBlpuxtIZg== and check that it returns the decrypted value, e.g. dog/cat.

  7. If you get a base64 error you may have update your encrypted string and replace the special characters, e.g. the + sign, with those characters found here here
  8. Write JUnit Jersey client side code to test your endpoints. Here is an example of test method one could write for the class task.