axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r448438 - in /webservices/axis2/trunk/java/modules/security/src/org/apache/rampart: builder/AsymmetricBindingBuilder.java util/RampartUtil.java
Date Thu, 21 Sep 2006 02:42:56 GMT
Author: ruchithf
Date: Wed Sep 20 19:42:55 2006
New Revision: 448438

URL: http://svn.apache.org/viewvc?view=rev&rev=448438
Log:
Use receipientToken for encryption in AsymmBinding and getting encryption working in the asymm
case


Modified:
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java?view=diff&rev=448438&r1=448437&r2=448438
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/builder/AsymmetricBindingBuilder.java
Wed Sep 20 19:42:55 2006
@@ -331,7 +331,7 @@
         }
         
         //Do encryption
-        Token encrToken = rpd.getEncryptionToken();
+        Token encrToken = rpd.getRecipientToken();
         if(encrToken != null) {
             Element refList = null;
             Vector encrParts = RampartUtil.getEncryptedParts(rmd);
@@ -372,22 +372,32 @@
                     encr.setWsConfig(rmd.getConfig());
                     
                     encr.setDocument(doc);
+                    encr.setUserInfo(rpd.getRampartConfig().getEncryptionUser());
                     encr.prepare(doc, RampartUtil.getEncryptionCrypto(rpd
                             .getRampartConfig()));
                     
+                    this.setInsertionLocation(this.timestampElement);
                     if(encr.getBSTTokenId() != null) {
                         this.setInsertionLocation(RampartUtil
-                                .insertSiblingBefore(rmd,
-                                        this.timestampElement,
+                                .insertSiblingAfter(rmd,
+                                        this.getInsertionLocation(),
                                         encr.getBinarySecurityTokenElement()));
                     }
                     
+                    Element encryptedKeyElement = encr.getEncryptedKeyElement();
+                    this.setInsertionLocation(RampartUtil
+                            .insertSiblingAfter(rmd,
+                                    this.getInsertionLocation(),
+                                    encryptedKeyElement));
+                    
                     //Encrypt, get hold of the ref list and add it
-                    refList = encr.encryptForExternalRef(null, encrParts);
+                    refList = encr.encryptForInternalRef(null, encrParts);
     
-                    RampartUtil.insertSiblingAfter(rmd,
-                                                    this.getInsertionLocation(),
-                                                    refList);
+                    //Add internal refs
+                    encryptedKeyElement.appendChild(refList);
+//                    RampartUtil.insertSiblingAfter(rmd,
+//                                                    this.getInsertionLocation(),
+//                                                    refList);
                 } catch (WSSecurityException e) {
                     throw new RampartException("errorInEncryption", e);
                 }    

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java?view=diff&rev=448438&r1=448437&r2=448438
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/RampartUtil.java
Wed Sep 20 19:42:55 2006
@@ -485,10 +485,8 @@
     public static Vector getEncryptedParts(RampartMessageData rmd) {
         RampartPolicyData rpd =  rmd.getPolicyData();
         Vector parts = rpd.getEncryptedParts();
-        if(rpd.isEncryptBody()) {
-            parts.add(new WSEncryptionPart(addWsuIdToElement(rmd
+        parts.add(new WSEncryptionPart(addWsuIdToElement(rmd
                     .getMsgContext().getEnvelope().getBody()), "Content"));
-        }
         
         return parts;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message