Uploaded image for project: 'WSS4J'
  1. WSS4J
  2. WSS-254

Encryption/signing of multiple message parts with same name not working



    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.6
    • 1.6
    • WSS4J Core
    • None
    • all. (found out an a windows vista machine with java 1.6)


      The current implementation of the class "WSSecEncypt" lookf in the document to encrypt for elements only by their name and namespace (this are the only informations provided by the class "WSEncryptionPart"). The search find the first element with this name and lets encrypt it. If there are other elements with the same name we wish to encrypt it cannot be done. But it is needed if one uses lists of elements
      Following example shows the issue:
      <!-- XML data-->
      <!-- XML data-->
      <!-- some data we don't wish to encrypt -->
      <!-- 1. binary data base64 encoded -->
      <!-- 2. binary data base64 encoded -->
      <!-- 3. binary data base64 encoded -->
      <!-- XML data-->
      <!-- XML data-->

      if we use the WSEncyrpionPart this way:
      WSEncryptionPart encryptionPart = new WSEncryptionPart("attachment", "myNS-URI", "Content");
      then only the element "Envelope/Header/Header2/attachment" will be encryptet. Thus the one we don't want to encrypt, but the other ones will not be encrypted.

      To solve this problem a XPath support in WSEncryptionPart and WSSecEncryption is to be implemented (and maybe more...)


        1. WSSecEncrypt.java
          34 kB
          Marcin Markiewicz
        2. patch.txt
          142 kB
          Marcin Markiewicz
        3. WSSecEncrypt.java
          26 kB
          Marcin Markiewicz
        4. WSSecEncrypt.java
          26 kB
          Marcin Markiewicz



            coheigea Colm O hEigeartaigh
            marcin.markiewicz Marcin Markiewicz
            0 Vote for this issue
            1 Start watching this issue