ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1666424 - in /webservices/wss4j/trunk/ws-security-dom/src: main/java/org/apache/wss4j/dom/WSDataRef.java main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
Date Fri, 13 Mar 2015 12:39:32 GMT
Author: coheigea
Date: Fri Mar 13 12:39:31 2015
New Revision: 1666424

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

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

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java?rev=1666424&r1=1666423&r2=1666424&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSDataRef.java
Fri Mar 13 12:39:31 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/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java?rev=1666424&r1=1666423&r2=1666424&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
Fri Mar 13 12:39:31 2015
@@ -316,6 +316,7 @@ public class ReferenceListProcessor impl
     ) throws WSSecurityException {
 
         WSDataRef dataRef = new WSDataRef();
+        dataRef.setEncryptedElement(encData);
         dataRef.setWsuId(dataRefURI);
         dataRef.setAlgorithm(symEncAlgo);
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java?rev=1666424&r1=1666423&r2=1666424&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
Fri Mar 13 12:39:31 2015
@@ -132,6 +132,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