ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1666425 - in /webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src: main/java/org/apache/wss4j/dom/ main/java/org/apache/wss4j/dom/processor/ test/java/org/apache/wss4j/dom/message/
Date Fri, 13 Mar 2015 12:42:24 GMT
Author: coheigea
Date: Fri Mar 13 12:42:23 2015
New Revision: 1666425

URL: http://svn.apache.org/r1666425
Log:
Also store the encrypted element in the WSDataRef for encryption

Modified:
    webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
    webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
    webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java

Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java?rev=1666425&r1=1666424&r2=1666425&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
(original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
Fri Mar 13 12:42:23 2015
@@ -82,6 +82,11 @@ public class WSDataRef {
      * Whether the protected Reference is an Attachment or not
      */
     private boolean attachment;
+    
+    /**
+     * If this reference represents encrypted content, then this is the EncryptedData Element
+     */
+    private Element encryptedElement;
 
     /**
      * @return Id of the protected element
@@ -225,4 +230,11 @@ public class WSDataRef {
         this.digestValue = digestValue;
     }
 
+    public Element getEncryptedElement() {
+        return encryptedElement;
+    }
+
+    public void setEncryptedElement(Element encryptedElement) {
+        this.encryptedElement = encryptedElement;
+    }
 }

Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java?rev=1666425&r1=1666424&r2=1666425&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
(original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
Fri Mar 13 12:42:23 2015
@@ -317,6 +317,7 @@ public class ReferenceListProcessor impl
     ) throws WSSecurityException {
 
         WSDataRef dataRef = new WSDataRef();
+        dataRef.setEncryptedElement(encData);
         dataRef.setWsuId(dataRefURI);
         dataRef.setAlgorithm(symEncAlgo);
 

Modified: webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java?rev=1666425&r1=1666424&r2=1666425&view=diff
==============================================================================
--- webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
(original)
+++ webservices/wss4j/branches/2_0_x-fixes/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
Fri Mar 13 12:42:23 2015
@@ -135,6 +135,10 @@ public class EncryptionPartsTest extends
         assertEquals(WSConstants.AES_128, wsDataRef.getAlgorithm());
         QName expectedQName = new QName("urn:foo.bar", "foobar");
         assertEquals(expectedQName, wsDataRef.getName());
+        
+        Element encryptedElement = wsDataRef.getEncryptedElement();
+        assertNotNull(encryptedElement);
+        assertEquals(WSConstants.ENC_NS, encryptedElement.getNamespaceURI());
     }
     
     @org.junit.Test



Mime
View raw message