Payload Level Security

  1. Import an “Existing Project into Workspace” contained in ~/FuseWorkshop/support/Lab12/Lab12.zip.
  2. Double-click on the camel-context.xml file.
  3. Add a Marshal component from the Transformation palette to the canvas.
  4. Create a link between the activeMQ component and the Marshal component.
  5. Create a link between the Marshal component and the Log component.

  1. Click on the Marshal component and click on the Properties tab.
  2. Click on the Crypto data format.

  3. Enter “DES” as Algorithm

  4. Enter “secretKey” as Key Ref

  5. Save the file (Ctrl+S).

  1. Click on the Source tab.
  2. Locate the <camelContext> element and paste before it the following code:
<crypt:keystore id="keyStore"
general_info_polished.png The KeyStore bean defines the location and characteristics of the key store, while the secretKey bean defines the reference id and characteristics of the key used to encrypt the message payload.
  1. Save the file (Ctrl+S).
  2. Double-click on the pom.xml file and click on the Dependencies tab.
  3. Click on the Add button.
  4. Complete the following values:

  5. Group Id: org.apache.camel

  6. Artifact Id: camel-crypto
  7. Version: ${camel-version}

  8. Click OK.

  9. Click on the “pom.xml” tab.
  10. Locate the fabic8 plugin configuration by the end of the file.
  11. Delete the “features” line and replace it with:
<features>mq-fabric-camel camel-crypto</features> <bundles>wrap:mvn:com.google.code.spring-crypto-utils/spring-crypto-utils/1.3.0</bundles>

  1. Save the file (Ctrl+S).
  2. Open a terminal window
  3. CD to home and execute the following command:
keytool -genseckey -alias shared -keystore keystore.jceks -storepass secret -storetype JCEKS -keyalg DES
general_info_polished.png Keytool is a key and certificate management utility. It allows users to administer their own public/private key pairs and associated certificates for use in self-authentication or data integrity and authentication services, using digital signature
  1. Press enter to accept the password.
  2. Go back to JBDS.
  3. Right-click on the Lab12 project, “Run As” -> “Maven build”
  4. In the Goals field enter “fabric8:deploy”.
  5. Click Apply and click Run.
  6. When the profile is deployed to Fuse, switch to the web browser.
  7. Click on the Containers tab.
  8. Click on the root container name.
  9. Select the 3 insight profiles, and click Remove.

  1. Click on the Add button.
  2. Enter “lab12” in the profile filter text box.
  3. Select lab12profile and click Add.
  4. Click on the Open icon.

  1. In the root web browser tab, click on the ActiveMQ tab.
  2. Click on the lab9 queue under root/Queue
  3. Click on the Send tab.
  4. Select “Plain text” as the Payload format.
  5. Enter any text in the payload field.
  6. Click on the Send Message button.

  1. Click on the Logs tab.
  2. You should see a new log message with the encrypted text:

  1. Close the root web browser tab.
  2. Click on the Containers tab again.
  3. Click on the root container name.
  4. Select the lab12Profile and click the Remove button.

results matching ""

    No results matching ""