Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4061

Add asymmetric encryption support to the XMLSecurity component

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7.3, 2.8.0
    • None
    • None
    • Patch Available

    Description

      Enhance the camel-xmlsecurity data format to support asymmetric key encryption algorithms.

      This enhancement provides the following capabilities:

      1. Expands the xmlsecurity data format API with a public method that accepts a key transport algorithm and recipient key alias
      2. Supports the RSA 1.5 and RSA OAEP asymmetric key encryption algorithms
      3. Alternatively allows the recipient public key alias to be defined within a message exchange or in camel context
      4. Allows key store and trust store information to be defined in the camel context

      Example configuration:

      // context properties for encryption
      contextProps.put(XMLSecurityDataFormat.XML_ENC_TRUST_STORE_URL, getClass().getClassLoader().getResource("sender.ts").toString());
      contextProps.put(XMLSecurityDataFormat.XML_ENC_TRUST_STORE_PASSWORD, "password");
      contextProps.put(XMLSecurityDataFormat.XML_ENC_RECIPIENT_ALIAS, "recipient");
          	
      // context properties for decryption
      contextProps.put(XMLSecurityDataFormat.XML_ENC_KEY_STORE_URL, getClass().getClassLoader().getResource("recipient.ks").toString());
      contextProps.put(XMLSecurityDataFormat.XML_ENC_KEY_STORE_PASSWORD, "password");
      contextProps.put(XMLSecurityDataFormat.XML_ENC_KEY_STORE_ALIAS, "recipient");
          
      context.addRoutes(new RouteBuilder() {	  
        public void configure() {
          from("direct:start")
           .marshal().secureXML("//privatenode", true, "some-pub-key-alias", XMLCipher.AES_256, XMLCipher.RSA_v1dot5).to("mock:encrypted")
           .unmarshal().secureXML("//privatenode", true, "somet-pub-key-alias",XMLCipher.AES_256,XMLCipher.RSA_v1dot5).to("mock:decrypted")	            
        }
      });
      

      Attachments

        1. sender.ts
          0.7 kB
          Rich Newcomb
        2. recipient.ks
          1 kB
          Rich Newcomb
        3. 2011.06.06-CAMEL-4061-xmlsecurity-2.7.x.patch
          39 kB
          Rich Newcomb
        4. 2011.06.06-CAMEL-4061-camel-core-2.7.x.patch
          4 kB
          Rich Newcomb

        Activity

          People

            hadrian Hadrian Zbarcea
            rnewcomb Rich Newcomb
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: