cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1084160 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Date Tue, 22 Mar 2011 13:14:39 GMT
Author: coheigea
Date: Tue Mar 22 13:14:39 2011
New Revision: 1084160

URL: http://svn.apache.org/viewvc?rev=1084160&view=rev
Log:
[CXF-3224] - Add a boolean parameter to the STSClient to disable sending a default KeyType.

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=1084160&r1=1084159&r2=1084160&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Tue Mar 22 13:14:39 2011
@@ -148,6 +148,7 @@ public class STSClient implements Config
     
     Object actAs;
     String tokenType;
+    boolean sendKeyType = true;
 
     Map<String, Object> ctx = new HashMap<String, Object>();
     
@@ -308,6 +309,10 @@ public class STSClient implements Config
     public void setTokenType(String tokenType) {
         this.tokenType = tokenType;
     }
+    
+    public void setSendKeyType(boolean sendKeyType) {
+        this.sendKeyType = sendKeyType;
+    }
 
     /**
      * Indicate whether to use the signer's public X509 certificate for the subject confirmation
key info 
@@ -479,9 +484,9 @@ public class STSClient implements Config
         if (keySize <= 0) {
             keySize = 256;
         }
-        if (keyType.endsWith("SymmetricKey")) {
+        if (keyType != null && keyType.endsWith("SymmetricKey")) {
             requestorEntropy = writeElementsForRSTSymmetricKey(writer, wroteKeySize);
-        } else if (keyType.endsWith("PublicKey")) {
+        } else if (keyType != null && keyType.endsWith("PublicKey")) {
             crypto = createCrypto(false);
             cert = getCert(crypto);
             writeElementsForRSTPublicKey(writer, cert);
@@ -801,7 +806,7 @@ public class STSClient implements Config
                 writer.writeEndElement();
                 keyType = namespace + "/SymmetricKey";
             }
-        } else if (keyType == null) {
+        } else if (keyType == null && sendKeyType) {
             writer.writeStartElement("wst", "KeyType", namespace);
             writer.writeCharacters(namespace + "/SymmetricKey");
             writer.writeEndElement();



Mime
View raw message