Hi.

I use XMLCipher and i need to place some additional parameters into EncryptionMethod element. Here is the w3c schema definition (http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#sec-EncryptionMethod):

 <complexType name='EncryptionMethodType' mixed='true'>
   <sequence>
     <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/>
     <element name='OAEPparams' minOccurs='0' type='base64Binary'/>
     <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
   </sequence>
   <attribute name='Algorithm' type='anyURI' use='required'/>
 </complexType>

According to this schema the number of "##other" encryption method parameters is unbounded. Actually the permitted child elements of the |EncryptionMethod| are determined by the specific value of the |Algorithm| attribute URI.

While org.apache.xml.security.encryption.XMLCipher.Factory.EncryptionMethodImpl implementation places into Element only ONE parameter from the encryptionMethodInformation List.

org.apache.xml.security.encryption.XMLCipher.Factory.EncryptionMethodImpl {

           private List encryptionMethodInformation = null;
           ...
           Element toElement() {
           ...
               if (!encryptionMethodInformation.isEmpty()) {
                   Iterator itr = encryptionMethodInformation.iterator();
                   result.appendChild((Element) itr.next());
               }

               return (result);
           }
       }
}

Is this a bug?

Thanks a lot.

Reply via email to