You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2011/01/06 14:36:22 UTC

svn commit: r1055869 - in /webservices/wss4j/trunk/src: main/java/org/apache/ws/security/action/ main/java/org/apache/ws/security/processor/ main/java/org/apache/ws/security/saml/ main/java/org/apache/ws/security/saml/ext/ main/java/org/apache/ws/secur...

Author: coheigea
Date: Thu Jan  6 13:36:21 2011
New Revision: 1055869

URL: http://svn.apache.org/viewvc?rev=1055869&view=rev
Log:
[WSS-146] - Fixed failing SAML HOK tests.

Added:
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKHandler.java
      - copied, changed from r1055820, webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnHolderOfKeyHandler.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKKeyValueHandler.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnSVHandler.java
      - copied, changed from r1055820, webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnSenderVouchesHandler.java
    webservices/wss4j/trunk/src/test/resources/saml_hok.properties
      - copied, changed from r1055820, webservices/wss4j/trunk/src/test/resources/saml4.properties
    webservices/wss4j/trunk/src/test/resources/saml_hok_keyvalue.properties
      - copied, changed from r1055820, webservices/wss4j/trunk/src/test/resources/saml4sendKeyValue.properties
    webservices/wss4j/trunk/src/test/resources/saml_sv.properties
      - copied, changed from r1055820, webservices/wss4j/trunk/src/test/resources/saml.properties
    webservices/wss4j/trunk/src/test/resources/saml_sv_noissuer.properties
      - copied, changed from r1055820, webservices/wss4j/trunk/src/test/resources/saml3.properties
Removed:
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnHolderOfKeyHandler.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnSenderVouchesHandler.java
    webservices/wss4j/trunk/src/test/resources/saml.properties
    webservices/wss4j/trunk/src/test/resources/saml3.properties
    webservices/wss4j/trunk/src/test/resources/saml4.properties
    webservices/wss4j/trunk/src/test/resources/saml4sendKeyValue.properties
Modified:
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/SAMLTokenSignedAction.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuer.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerImpl.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/bean/SubjectBean.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/message/SignaturePartsTest.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlReferenceTest.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlTokenTest.java
    webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SignedSamlTokenTest.java

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/SAMLTokenSignedAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/SAMLTokenSignedAction.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/SAMLTokenSignedAction.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/action/SAMLTokenSignedAction.java Thu Jan  6 13:36:21 2011
@@ -62,27 +62,18 @@ public class SAMLTokenSignedAction imple
         if (assertion == null) {
             throw new WSSecurityException("WSHandler: Signed SAML: no SAML token received");
         }
-        String issuerKeyName = null;
-        String issuerKeyPW = null;
-        Crypto issuerCrypto = null;
 
         WSSecSignatureSAML wsSign = new WSSecSignatureSAML();
         wsSign.setWsConfig(reqData.getWssConfig());
 
-        String password = null;
-        if (saml.isSenderVouches()) {
-            issuerKeyName = saml.getIssuerKeyName();
-            issuerKeyPW = saml.getIssuerKeyPassword();
-            issuerCrypto = saml.getIssuerCrypto();
-        } else {
-            password =
-                    handler.getPassword(reqData.getUsername(),
-                            actionToDo,
-                            WSHandlerConstants.PW_CALLBACK_CLASS,
-                            WSHandlerConstants.PW_CALLBACK_REF, reqData)
-                            .getPassword();
-            wsSign.setUserInfo(reqData.getUsername(), password);
-        }
+        String password =
+            handler.getPassword(reqData.getUsername(),
+                                actionToDo,
+                                WSHandlerConstants.PW_CALLBACK_CLASS,
+                                WSHandlerConstants.PW_CALLBACK_REF, reqData)
+                                .getPassword();
+        wsSign.setUserInfo(reqData.getUsername(), password);
+        
         if (reqData.getSigKeyId() != 0) {
             wsSign.setKeyIdentifierType(reqData.getSigKeyId());
         }
@@ -108,9 +99,9 @@ public class SAMLTokenSignedAction imple
                     doc,
                     crypto,
                     assertion,
-                    issuerCrypto,
-                    issuerKeyName,
-                    issuerKeyPW,
+                    saml.getIssuerCrypto(),
+                    saml.getIssuerKeyName(),
+                    saml.getIssuerKeyPassword(),
                     reqData.getSecHeader());
             reqData.getSignatureValues().add(wsSign.getSignatureValue());
         } catch (WSSecurityException e) {

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/processor/SAMLTokenProcessor.java Thu Jan  6 13:36:21 2011
@@ -28,8 +28,10 @@ import org.apache.ws.security.WSSecurity
 import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.saml.ext.AssertionWrapper;
+import org.apache.ws.security.util.DOM2Writer;
 
 import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.validation.ValidationException;
 
 import org.w3c.dom.Element;
 
@@ -65,14 +67,20 @@ public class SAMLTokenProcessor implemen
         AssertionWrapper assertion = null;
         try {
             assertion = new AssertionWrapper(token);
+            assertion.verify();
             result = true;
             if (log.isDebugEnabled()) {
                 log.debug("SAML Assertion issuer " + assertion.getIssuerString());
+                log.debug(DOM2Writer.nodeToString(token));
             }
         } catch (UnmarshallingException e) {
             throw new WSSecurityException(
                 WSSecurityException.FAILURE, "invalidSAMLsecurity", null, e
             );
+        } catch (ValidationException e) {
+            throw new WSSecurityException(
+                 WSSecurityException.FAILURE, "invalidSAMLsecurity", null, e
+            );
         }
         if (!result) {
             throw new WSSecurityException(WSSecurityException.FAILED_AUTHENTICATION);

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuer.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuer.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuer.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuer.java Thu Jan  6 13:36:21 2011
@@ -59,11 +59,6 @@ public interface SAMLIssuer {
     public String getIssuerKeyPassword();
 
     /**
-     * @return Returns the senderVouches.
-     */
-    public boolean isSenderVouches();
-
-    /**
      * @param instanceDoc The instanceDoc to set.
      */
     public void setInstanceDoc(Document instanceDoc);

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerImpl.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerImpl.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLIssuerImpl.java Thu Jan  6 13:36:21 2011
@@ -79,10 +79,6 @@ public class SAMLIssuerImpl implements S
     private String issuerKeyPassword = null;
     private String issuerKeyName = null;
 
-    private boolean senderVouches = true;
-
-    private String[] confirmationMethods = new String[1];
-    
     private WSSConfig wssConfig = WSSConfig.getNewInstance();
     
     private String samlVersion = null;
@@ -94,6 +90,11 @@ public class SAMLIssuerImpl implements S
      * is set to true, a ds:KeyValue is used instead with just the key material.
      */
     private boolean sendKeyValue = false;
+    
+    /**
+     * This boolean controls whether the assertion is to be signed or not
+     */
+    private boolean signAssertion = false;
 
     /**
      * Constructor.
@@ -128,35 +129,13 @@ public class SAMLIssuerImpl implements S
             sendKeyValue = Boolean.valueOf(sendKeyValueProp).booleanValue();
         }
         
-        samlVersion = properties.getProperty("org.apache.ws.security.saml.version");
-
-        String confMethod = properties.getProperty("org.apache.ws.security.saml.confirmationMethod");
-        if ("senderVouches".equals(confMethod)) {
-            if ("1.1".equalsIgnoreCase(samlVersion)) {
-                confirmationMethods[0] = SAML1Constants.CONF_SENDER_VOUCHES;
-            } else if ("2.0".equalsIgnoreCase(samlVersion)) {
-                confirmationMethods[0] = SAML2Constants.SBJ_CONFIRMATION_SENDER_VOUCHES;
-            } else {
-                // Default to SAML 1.1
-                confirmationMethods[0] = SAML1Constants.CONF_SENDER_VOUCHES;
-            }
-        } else if ("keyHolder".equals(confMethod)) {
-            if ("1.1".equalsIgnoreCase(samlVersion)) {
-                confirmationMethods[0] = SAML1Constants.CONF_HOLDER_KEY;
-                senderVouches = false;
-            } else if ("2.0".equalsIgnoreCase(samlVersion)) {
-                confirmationMethods[0] = SAML2Constants.SBJ_CONFIRMATION_HOLDER_OF_KEY;
-            } else {
-                // Default to SAML 1.1
-                confirmationMethods[0] = SAML1Constants.CONF_HOLDER_KEY;
-                senderVouches = false;
-            }
-        } else {
-            // throw something here - this is a mandatory property
-            throw new IllegalStateException(
-                "No value provided in saml configuration for confirmation method"
-            );
+        String signAssertionProp =
+            properties.getProperty("org.apache.ws.security.saml.issuer.signAssertion");
+        if (signAssertionProp != null) {
+            signAssertion = Boolean.valueOf(signAssertionProp).booleanValue();
         }
+        
+        samlVersion = properties.getProperty("org.apache.ws.security.saml.version");
     }
 
     /**
@@ -195,7 +174,7 @@ public class SAMLIssuerImpl implements S
 
         sa = new AssertionWrapper(samlParms);
         
-        if (!senderVouches) {
+        if (signAssertion) {
             //
             // Create the signature
             //
@@ -277,13 +256,6 @@ public class SAMLIssuerImpl implements S
     }
 
     /**
-     * @return Returns the senderVouches.
-     */
-    public boolean isSenderVouches() {
-        return senderVouches;
-    }
-
-    /**
      * @param instanceDoc The instanceDoc to set.
      */
     public void setInstanceDoc(Document instanceDoc) {

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/SAMLUtil.java Thu Jan  6 13:36:21 2011
@@ -145,10 +145,12 @@ public class SAMLUtil {
                                 "invalidSAMLToken", new Object[]{"for Signature (no Subject)"});
                     }
 
-                    Element e = samlSubj.getSubjectConfirmation().getKeyInfo().getDOM();
+                    Element sub = samlSubj.getSubjectConfirmation().getDOM();
+                    Element keyInfoElement = 
+                        WSSecurityUtil.getDirectChildElement(sub, "KeyInfo", WSConstants.SIG_NS);
                     X509Certificate[] certs = null;
                     KeyInfoFactory keyInfoFactory = KeyInfoFactory.getInstance("DOM");
-                    XMLStructure keyInfoStructure = new DOMStructure(e);
+                    XMLStructure keyInfoStructure = new DOMStructure(keyInfoElement);
                     
                     try {
                         KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure);

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/AssertionWrapper.java Thu Jan  6 13:36:21 2011
@@ -22,6 +22,7 @@ package org.apache.ws.security.saml.ext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.saml.ext.builder.SAML1ComponentBuilder;
 import org.apache.ws.security.saml.ext.builder.SAML2ComponentBuilder;
 import org.apache.ws.security.saml.ext.builder.SAML2Constants;
@@ -97,6 +98,11 @@ public class AssertionWrapper {
      * environment that should be included in the generated SAML statements.
      */
     private CallbackHandler samlCallbackHandler = null;
+    
+    /**
+     * The Assertion as a DOM element
+     */
+    private Element assertionElement;
 
     /**
      * Constructor AssertionWrapper creates a new AssertionWrapper instance.
@@ -106,6 +112,7 @@ public class AssertionWrapper {
      */
     public AssertionWrapper(Element element) throws UnmarshallingException {
         this(OpenSAMLUtil.fromDom(element));
+        assertionElement = element;
     }
 
     /**
@@ -158,7 +165,7 @@ public class AssertionWrapper {
      *
      * @param parms of type SAMLParms
      */
-    public AssertionWrapper(SAMLParms parms) {
+    public AssertionWrapper(SAMLParms parms) throws WSSecurityException {
         OpenSAMLUtil.initSamlEngine();
         // Set the SAML version
         if (parms.getSamlVersion().equalsIgnoreCase("1.1")) {
@@ -198,42 +205,48 @@ public class AssertionWrapper {
             // Build a SAML v1.1 assertion
             saml1 = SAML1ComponentBuilder.createSamlv1Assertion(parms.getIssuer());
 
-            // Process the SAML authentication statement(s)
-            List<AuthenticationStatement> authenticationStatements = 
-                SAML1ComponentBuilder.createSamlv1AuthenticationStatement(
-                    samlCallbacks[0].getAuthenticationStatementData()
-                );
-
-            // Process the SAML attribute statement(s)            
-            List<org.opensaml.saml1.core.AttributeStatement> attributeStatements =
-                    SAML1ComponentBuilder.createSamlv1AttributeStatement(
-                        samlCallbacks[0].getAttributeStatementData()
+            try {
+                // Process the SAML authentication statement(s)
+                List<AuthenticationStatement> authenticationStatements = 
+                    SAML1ComponentBuilder.createSamlv1AuthenticationStatement(
+                        samlCallbacks[0].getAuthenticationStatementData()
                     );
-
-            // Process the SAML authorization decision statement(s)
-            List<org.opensaml.saml1.core.AuthorizationDecisionStatement> authDecisionStatements =
-                    SAML1ComponentBuilder.createSamlv1AuthorizationDecisionStatement(
-                        samlCallbacks[0].getAuthDecisionStatementData()
-                    );
-
-            // Build the complete assertion
-            org.opensaml.saml1.core.Conditions conditions = 
-                SAML1ComponentBuilder.createSamlv1Conditions(samlCallbacks[0].getConditions());
-            saml1.setConditions(conditions);
-
-            // Add the SAML authentication statement(s) (if any)
-            for (AuthenticationStatement authnStatement : authenticationStatements) {
-                saml1.getAuthenticationStatements().add(authnStatement);
-            }
-
-            // Add the SAML attribute statement(s) (if any)
-            for (org.opensaml.saml1.core.AttributeStatement attrStatement : attributeStatements) {
-                saml1.getAttributeStatements().add(attrStatement);
-            }
-
-            // Add the SAML authorization decision statement(s) (if any)
-            for (AuthorizationDecisionStatement authzStatement : authDecisionStatements) {
-                saml1.getAuthorizationDecisionStatements().add(authzStatement);
+    
+                // Process the SAML attribute statement(s)            
+                List<org.opensaml.saml1.core.AttributeStatement> attributeStatements =
+                        SAML1ComponentBuilder.createSamlv1AttributeStatement(
+                            samlCallbacks[0].getAttributeStatementData()
+                        );
+    
+                // Process the SAML authorization decision statement(s)
+                List<org.opensaml.saml1.core.AuthorizationDecisionStatement> authDecisionStatements =
+                        SAML1ComponentBuilder.createSamlv1AuthorizationDecisionStatement(
+                            samlCallbacks[0].getAuthDecisionStatementData()
+                        );
+    
+                // Build the complete assertion
+                org.opensaml.saml1.core.Conditions conditions = 
+                    SAML1ComponentBuilder.createSamlv1Conditions(samlCallbacks[0].getConditions());
+                saml1.setConditions(conditions);
+    
+                // Add the SAML authentication statement(s) (if any)
+                for (AuthenticationStatement authnStatement : authenticationStatements) {
+                    saml1.getAuthenticationStatements().add(authnStatement);
+                }
+    
+                // Add the SAML attribute statement(s) (if any)
+                for (org.opensaml.saml1.core.AttributeStatement attrStatement : attributeStatements) {
+                    saml1.getAttributeStatements().add(attrStatement);
+                }
+    
+                // Add the SAML authorization decision statement(s) (if any)
+                for (AuthorizationDecisionStatement authzStatement : authDecisionStatements) {
+                    saml1.getAuthorizationDecisionStatements().add(authzStatement);
+                }
+            } catch (org.opensaml.xml.security.SecurityException ex) {
+                throw new WSSecurityException(
+                    "Error generating KeyInfo from signing credential", ex
+                );
             }
 
             // Set the OpenSaml2 XMLObject instance
@@ -539,5 +552,13 @@ public class AssertionWrapper {
     public void setSamlCallbackHandler(CallbackHandler samlCallbackHandler) {
         this.samlCallbackHandler = samlCallbackHandler;
     }
+    
+    /**
+     * Get the Assertion as a DOM Element.
+     * @return the assertion as a DOM Element
+     */
+    public Element getElement() {
+        return assertionElement;
+    }
 
 }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/bean/SubjectBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/bean/SubjectBean.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/bean/SubjectBean.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/bean/SubjectBean.java Thu Jan  6 13:36:21 2011
@@ -19,6 +19,8 @@
 
 package org.apache.ws.security.saml.ext.bean;
 
+import java.security.cert.X509Certificate;
+
 
 /**
  * Class SubjectBean represents a SAML subject (can be used to create
@@ -30,6 +32,8 @@ public class SubjectBean {
     private String subjectName;
     private String subjectNameQualifier;
     private String subjectConfirmationMethod;
+    private X509Certificate subjectCert;
+    private boolean useSendKeyValue;
 
     /**
      * Constructor SubjectBean creates a new SubjectBean instance.
@@ -110,6 +114,42 @@ public class SubjectBean {
     public void setSubjectConfirmationMethod(String subjectConfirmationMethod) {
         this.subjectConfirmationMethod = subjectConfirmationMethod;
     }
+    
+    /**
+     * Method getSubjectCert returns the subjectCert of this SubjectBean object.
+     *
+     * @return the subjectCert (type X509Certificate) of this SubjectBean object.
+     */
+    public X509Certificate getSubjectCert() {
+        return subjectCert;
+    }
+
+    /**
+     * Method setSubjectCert sets the subjectCert of this SubjectBean object.
+     *
+     * @param subjectCert the subjectCert of this SubjectBean object.
+     */
+    public void setSubjectCert(X509Certificate subjectCert) {
+        this.subjectCert = subjectCert;
+    }
+    
+    /**
+     * Method isUseSendKeyValue returns the useSendKeyValue of this SubjectBean object.
+     *
+     * @return the useSendKeyValue (type boolean) of this SubjectBean object.
+     */
+    public boolean isUseSendKeyValue() {
+        return useSendKeyValue;
+    }
+
+    /**
+     * Method setUseSendKeyValue sets the useSendKeyValue of this SubjectBean object.
+     *
+     * @param useSendKeyValue the useSendKeyValue of this SubjectBean object.
+     */
+    public void setUseSendKeyValue(boolean useSendKeyValue) {
+        this.useSendKeyValue = useSendKeyValue;
+    }
 
     /**
      * Method equals ...
@@ -126,7 +166,9 @@ public class SubjectBean {
 
         if (!subjectName.equals(that.subjectName)) return false;
         if (!subjectNameQualifier.equals(that.subjectNameQualifier)) return false;
-        if (!subjectConfirmationMethod.equals(that.subjectConfirmationMethod)) return false; 
+        if (!subjectConfirmationMethod.equals(that.subjectConfirmationMethod)) return false;
+        if (subjectCert != null && !subjectCert.equals(that.subjectCert)) return false;
+        if (useSendKeyValue != that.useSendKeyValue) return false;
 
         return true;
     }
@@ -140,6 +182,8 @@ public class SubjectBean {
         int result = subjectName.hashCode();
         result = 31 * result + subjectNameQualifier.hashCode();
         result = 31 * result + subjectConfirmationMethod.hashCode();
+        result = 31 * result + subjectCert.hashCode();
+        result = 31 * result + Boolean.valueOf(useSendKeyValue).hashCode();
         return result;
     }
 }

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/builder/SAML1ComponentBuilder.java Thu Jan  6 13:36:21 2011
@@ -51,7 +51,11 @@ import org.opensaml.saml1.core.SubjectCo
 import org.opensaml.xml.XMLObjectBuilderFactory;
 import org.opensaml.xml.schema.XSString;
 import org.opensaml.xml.schema.impl.XSStringBuilder;
+import org.opensaml.xml.security.x509.BasicX509Credential;
+import org.opensaml.xml.security.x509.X509KeyInfoGeneratorFactory;
+import org.opensaml.xml.signature.KeyInfo;
 
+import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -129,7 +133,8 @@ public class SAML1ComponentBuilder {
      * @param subjectBean A SubjectBean instance
      * @return A Saml 1.1 subject
      */
-    public static Subject createSaml1v1Subject(SubjectBean subjectBean) {
+    public static Subject createSaml1v1Subject(SubjectBean subjectBean) 
+        throws org.opensaml.xml.security.SecurityException {
         if (subjectV1Builder == null) {
             subjectV1Builder = (SAMLObjectBuilder<Subject>) 
                 builderFactory.getBuilder(Subject.DEFAULT_ELEMENT_NAME);
@@ -165,11 +170,35 @@ public class SAML1ComponentBuilder {
         
         confirmationMethod.setConfirmationMethod(confirmationMethodStr);
         subjectConfirmation.getConfirmationMethods().add(confirmationMethod);
+        KeyInfo keyInfo = 
+            createKeyInfo(subjectBean.getSubjectCert(), subjectBean.isUseSendKeyValue());
+        subjectConfirmation.setKeyInfo(keyInfo);
         subject.setNameIdentifier(nameIdentifier);
         subject.setSubjectConfirmation(subjectConfirmation);
         
         return subject;
     }
+    
+    /**
+     * Create an Opensaml KeyInfo object from the parameters
+     * @param cert the Certificate to insert in the KeyInfo object
+     * @param useSendKeyValue Whether to use a KeyValue or not
+     * @return the KeyInfo object
+     * @throws org.opensaml.xml.security.SecurityException
+     */
+    public static KeyInfo createKeyInfo(X509Certificate cert, boolean useSendKeyValue) 
+        throws org.opensaml.xml.security.SecurityException {
+        BasicX509Credential keyInfoCredential = new BasicX509Credential();
+        keyInfoCredential.setEntityCertificate(cert);
+
+        X509KeyInfoGeneratorFactory kiFactory = new X509KeyInfoGeneratorFactory();
+        if (useSendKeyValue) {
+            kiFactory.setEmitPublicKeyValue(true);
+        } else {
+            kiFactory.setEmitEntityCertificate(true);
+        }
+        return kiFactory.newInstance().generate(keyInfoCredential);
+    }
 
     /**
      * Create a Conditions object
@@ -216,7 +245,7 @@ public class SAML1ComponentBuilder {
      */
     public static List<AuthenticationStatement> createSamlv1AuthenticationStatement(
         List<AuthenticationStatementBean> authBeans
-    ) {
+    ) throws org.opensaml.xml.security.SecurityException {
         List<AuthenticationStatement> authenticationStatements = 
             new ArrayList<AuthenticationStatement>();
         
@@ -280,7 +309,7 @@ public class SAML1ComponentBuilder {
      */
     public static List<AttributeStatement> createSamlv1AttributeStatement(
         List<AttributeStatementBean> attributeData
-    ) {
+    ) throws org.opensaml.xml.security.SecurityException {
         if (attributeStatementV1Builder == null) {
             attributeStatementV1Builder = (SAMLObjectBuilder<AttributeStatement>) 
                 builderFactory.getBuilder(AttributeStatement.DEFAULT_ELEMENT_NAME);
@@ -356,7 +385,8 @@ public class SAML1ComponentBuilder {
      * @return a list of SAML 1.1 Authorization Decision Statement(s)
      */
     public static List<AuthorizationDecisionStatement> createSamlv1AuthorizationDecisionStatement(
-            List<AuthDecisionStatementBean> decisionData) {
+            List<AuthDecisionStatementBean> decisionData) 
+        throws org.opensaml.xml.security.SecurityException {
         List<AuthorizationDecisionStatement> authDecisionStatements = new ArrayList();
         if (authorizationDecisionStatementV1Builder == null) {
             authorizationDecisionStatementV1Builder = 

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/str/SignatureSTRParser.java Thu Jan  6 13:36:21 2011
@@ -187,9 +187,10 @@ public class SignatureSTRParser implemen
                                 WSSecurityException.FAILURE, "noSigCryptoFile"
                         );
                     }
-                    Element samlElement = wsDocInfo.getTokenElement(uri);
+                    AssertionWrapper assertion = 
+                        (AssertionWrapper)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
                     SAMLKeyInfo keyInfo = 
-                        SAMLUtil.getSAMLKeyInfo(samlElement, crypto, cb);
+                        SAMLUtil.getSAMLKeyInfo(assertion, crypto, cb);
                     X509Certificate[] foundCerts = keyInfo.getCerts();
                     if (foundCerts != null) {
                         certs = new X509Certificate[]{foundCerts[0]};

Copied: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKHandler.java (from r1055820, webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnHolderOfKeyHandler.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKHandler.java?p2=webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKHandler.java&p1=webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnHolderOfKeyHandler.java&r1=1055820&r2=1055869&rev=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnHolderOfKeyHandler.java (original)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKHandler.java Thu Jan  6 13:36:21 2011
@@ -19,6 +19,9 @@
 
 package org.apache.ws.security.common;
 
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.components.crypto.CryptoFactory;
 import org.apache.ws.security.saml.ext.SAMLCallback;
 import org.apache.ws.security.saml.ext.bean.AuthenticationStatementBean;
 import org.apache.ws.security.saml.ext.bean.SubjectBean;
@@ -28,18 +31,22 @@ import javax.security.auth.callback.Call
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 import java.io.IOException;
+import java.security.cert.X509Certificate;
 import java.util.Collections;
 
 /**
- * A Callback Handler implementation for the case of finding a password to access a 
- * cert/private key in a keystore.
+ * A Callback Handler implementation for a SAML 1.1 authentication assertion using
+ * Holder of Key.
  */
-public class SAMLAuthnHolderOfKeyHandler implements CallbackHandler {
+public class SAML1AuthnHOKHandler implements CallbackHandler {
     
     private String subjectName = "uid=joe,ou=people,ou=saml-demo,o=example.com";
     private String subjectQualifier = "www.example.com";
+    private X509Certificate[] certs;
     
-    public SAMLAuthnHolderOfKeyHandler() {
+    public SAML1AuthnHOKHandler() throws WSSecurityException {
+        Crypto crypto = CryptoFactory.getInstance("crypto.properties");
+        certs = crypto.getCertificates("16c73ab6-b892-458f-abf5-2f875f74882e");
     }
     
     public void handle(Callback[] callbacks)
@@ -51,6 +58,7 @@ public class SAMLAuthnHolderOfKeyHandler
                     new SubjectBean(
                         subjectName, subjectQualifier, SAML1Constants.CONF_HOLDER_KEY
                     );
+                subjectBean.setSubjectCert(certs[0]);
                 AuthenticationStatementBean authBean = new AuthenticationStatementBean();
                 authBean.setSubject(subjectBean);
                 authBean.setAuthenticationMethod("Password");

Added: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKKeyValueHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKKeyValueHandler.java?rev=1055869&view=auto
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKKeyValueHandler.java (added)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnHOKKeyValueHandler.java Thu Jan  6 13:36:21 2011
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ws.security.common;
+
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.components.crypto.CryptoFactory;
+import org.apache.ws.security.saml.ext.SAMLCallback;
+import org.apache.ws.security.saml.ext.bean.AuthenticationStatementBean;
+import org.apache.ws.security.saml.ext.bean.SubjectBean;
+import org.apache.ws.security.saml.ext.builder.SAML1Constants;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import java.io.IOException;
+import java.security.cert.X509Certificate;
+import java.util.Collections;
+
+/**
+ * A Callback Handler implementation for a SAML 1.1 authentication assertion using
+ * Holder of Key, and where the KeyInfo object in the subject uses KeyValue.
+ */
+public class SAML1AuthnHOKKeyValueHandler implements CallbackHandler {
+    
+    private String subjectName = "uid=joe,ou=people,ou=saml-demo,o=example.com";
+    private String subjectQualifier = "www.example.com";
+    private X509Certificate[] certs;
+    
+    public SAML1AuthnHOKKeyValueHandler() throws WSSecurityException {
+        Crypto crypto = CryptoFactory.getInstance("crypto.properties");
+        certs = crypto.getCertificates("16c73ab6-b892-458f-abf5-2f875f74882e");
+    }
+    
+    public void handle(Callback[] callbacks)
+        throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            if (callbacks[i] instanceof SAMLCallback) {
+                SAMLCallback callback = (SAMLCallback) callbacks[i];
+                SubjectBean subjectBean = 
+                    new SubjectBean(
+                        subjectName, subjectQualifier, SAML1Constants.CONF_HOLDER_KEY
+                    );
+                subjectBean.setSubjectCert(certs[0]);
+                subjectBean.setUseSendKeyValue(true);
+                AuthenticationStatementBean authBean = new AuthenticationStatementBean();
+                authBean.setSubject(subjectBean);
+                authBean.setAuthenticationMethod("Password");
+                callback.setAuthenticationStatementData(Collections.singletonList(authBean));
+            } else {
+                throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
+            }
+        }
+    }
+}

Copied: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnSVHandler.java (from r1055820, webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnSenderVouchesHandler.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnSVHandler.java?p2=webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnSVHandler.java&p1=webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnSenderVouchesHandler.java&r1=1055820&r2=1055869&rev=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAMLAuthnSenderVouchesHandler.java (original)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/common/SAML1AuthnSVHandler.java Thu Jan  6 13:36:21 2011
@@ -31,15 +31,15 @@ import java.io.IOException;
 import java.util.Collections;
 
 /**
- * A Callback Handler implementation for the case of finding a password to access a 
- * cert/private key in a keystore.
+ * A Callback Handler implementation for a SAML 1.1 authentication assertion using
+ * Sender Vouches.
  */
-public class SAMLAuthnSenderVouchesHandler implements CallbackHandler {
+public class SAML1AuthnSVHandler implements CallbackHandler {
     
     private String subjectName = "uid=joe,ou=people,ou=saml-demo,o=example.com";
     private String subjectQualifier = "www.example.com";
     
-    public SAMLAuthnSenderVouchesHandler() {
+    public SAML1AuthnSVHandler() {
     }
     
     public void handle(Callback[] callbacks)

Modified: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/message/SignaturePartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/message/SignaturePartsTest.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/message/SignaturePartsTest.java (original)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/message/SignaturePartsTest.java Thu Jan  6 13:36:21 2011
@@ -142,11 +142,10 @@ public class SignaturePartsTest extends 
      */
     @SuppressWarnings("unchecked")
     @org.junit.Test
-    @org.junit.Ignore
     public void testSOAPHeaderSTRTransform() throws Exception {
         Document doc = SOAPUtil.toSOAPPart(SOAPMSG);
         
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml4.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_hok.properties");
         // Provide info to SAML issuer that it can construct a Holder-of-key
         // SAML token.
         saml.setInstanceDoc(doc);
@@ -196,7 +195,7 @@ public class SignaturePartsTest extends 
         
         WSDataRef wsDataRef = (WSDataRef)refs.get(0);
         String xpath = wsDataRef.getXpath();
-        assertEquals("/soapenv:Envelope/soapenv:Header/wsse:Security/Assertion", xpath);
+        assertEquals("/soapenv:Envelope/soapenv:Header/wsse:Security/saml:Assertion", xpath);
     }
     
     /**

Modified: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlReferenceTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlReferenceTest.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlReferenceTest.java (original)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlReferenceTest.java Thu Jan  6 13:36:21 2011
@@ -59,10 +59,9 @@ public class SamlReferenceTest extends o
      * SAML tokens
      */
     @org.junit.Test
-    @org.junit.Ignore
     public void testSAMLEncryptedKey() throws Exception {
         // Create a SAML assertion
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml4.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_hok.properties");
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         saml.setInstanceDoc(doc);
         Crypto hokCrypto = CryptoFactory.getInstance("crypto.properties");
@@ -123,7 +122,7 @@ public class SamlReferenceTest extends o
         WSSecHeader secHeader = new WSSecHeader();
         secHeader.insertSecurityHeader(doc);
         
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_sv.properties");
         AssertionWrapper assertion = saml.newAssertion();
         String issuerKeyName = saml.getIssuerKeyName();
         String issuerKeyPW = saml.getIssuerKeyPassword();

Modified: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlTokenTest.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlTokenTest.java (original)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SamlTokenTest.java Thu Jan  6 13:36:21 2011
@@ -50,7 +50,7 @@ public class SamlTokenTest extends org.j
      */
     @org.junit.Test
     public void testSAMLUnsignedSenderVouches() throws Exception {
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_sv.properties");
 
         AssertionWrapper assertion = saml.newAssertion();
 

Modified: webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SignedSamlTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SignedSamlTokenTest.java?rev=1055869&r1=1055868&r2=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SignedSamlTokenTest.java (original)
+++ webservices/wss4j/trunk/src/test/java/org/apache/ws/security/saml/SignedSamlTokenTest.java Thu Jan  6 13:36:21 2011
@@ -59,7 +59,7 @@ public class SignedSamlTokenTest extends
      */
     @org.junit.Test
     public void testSAMLSignedSenderVouches() throws Exception {
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_sv.properties");
 
         AssertionWrapper assertion = saml.newAssertion();
 
@@ -102,7 +102,7 @@ public class SignedSamlTokenTest extends
      */
     @org.junit.Test
     public void testSAMLSignedSenderVouchesKeyIdentifier() throws Exception {
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_sv.properties");
 
         AssertionWrapper assertion = saml.newAssertion();
 
@@ -141,13 +141,13 @@ public class SignedSamlTokenTest extends
     
     /**
      * Test the default issuer class as specified in SAMLIssuerFactory. The configuration
-     * file "saml3.properties" has no "org.apache.ws.security.saml.issuerClass" property,
-     * and so the default value is used (A bad value was previously used for the default
-     * value).
+     * file "saml3.saml_sv_noissuer.properties" has no "org.apache.ws.security.saml.issuerClass"
+     * property, and so the default value is used (A bad value was previously used for the
+     * default value).
      */
     @org.junit.Test
     public void testDefaultIssuerClass() throws Exception {
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml3.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_sv_noissuer.properties");
 
         AssertionWrapper assertion = saml.newAssertion();
 
@@ -191,7 +191,7 @@ public class SignedSamlTokenTest extends
      */
     @org.junit.Test
     public void testWSS62() throws Exception {
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_sv.properties");
 
         AssertionWrapper assertion = saml.newAssertion();
 
@@ -245,11 +245,10 @@ public class SignedSamlTokenTest extends
      * Test that creates, sends and processes an signed SAML assertion.
      */
     @org.junit.Test
-    @org.junit.Ignore
     public void testSAMLSignedKeyHolder() throws Exception {
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml4.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_hok.properties");
         // Provide info to SAML issuer that it can construct a Holder-of-key
         // SAML token.
         saml.setInstanceDoc(doc);
@@ -294,11 +293,10 @@ public class SignedSamlTokenTest extends
      * only key material and not an entire X509Certificate.
      */
     @org.junit.Test
-    @org.junit.Ignore
     public void testSAMLSignedKeyHolderSendKeyValue() throws Exception {
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml4sendKeyValue.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_hok_keyvalue.properties");
         // Provide info to SAML issuer that it can construct a Holder-of-key
         // SAML token.
         saml.setInstanceDoc(doc);
@@ -329,6 +327,8 @@ public class SignedSamlTokenTest extends
         }
         assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmlenc#sha256") != -1);
         assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256") != -1);
+        assertTrue(outputString.indexOf("KeyValue") != -1);
+        assertTrue(outputString.indexOf("X509Certificate") == -1);
         
         List<WSSecurityEngineResult> results = verify(signedDoc);
         WSSecurityEngineResult actionResult =
@@ -344,11 +344,10 @@ public class SignedSamlTokenTest extends
      * instead of direct reference.
      */
     @org.junit.Test
-    @org.junit.Ignore
     public void testSAMLSignedKeyHolderKeyIdentifier() throws Exception {
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         
-        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml4.properties");
+        SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml_hok.properties");
         // Provide info to SAML issuer that it can construct a Holder-of-key
         // SAML token.
         saml.setInstanceDoc(doc);

Copied: webservices/wss4j/trunk/src/test/resources/saml_hok.properties (from r1055820, webservices/wss4j/trunk/src/test/resources/saml4.properties)
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/resources/saml_hok.properties?p2=webservices/wss4j/trunk/src/test/resources/saml_hok.properties&p1=webservices/wss4j/trunk/src/test/resources/saml4.properties&r1=1055820&r2=1055869&rev=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/resources/saml4.properties (original)
+++ webservices/wss4j/trunk/src/test/resources/saml_hok.properties Thu Jan  6 13:36:21 2011
@@ -4,7 +4,7 @@ org.apache.ws.security.saml.issuer.key.n
 org.apache.ws.security.saml.issuer.key.password=security
 org.apache.ws.security.saml.issuer=www.example.com
 org.apache.ws.security.saml.issuer.sendKeyValue=false
-org.apache.ws.security.saml.confirmationMethod=keyHolder
+org.apache.ws.security.saml.issuer.signAssertion=true
 org.apache.ws.security.saml.version=1.1
-org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAMLAuthnHolderOfKeyHandler
+org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAML1AuthnHOKHandler
 

Copied: webservices/wss4j/trunk/src/test/resources/saml_hok_keyvalue.properties (from r1055820, webservices/wss4j/trunk/src/test/resources/saml4sendKeyValue.properties)
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/resources/saml_hok_keyvalue.properties?p2=webservices/wss4j/trunk/src/test/resources/saml_hok_keyvalue.properties&p1=webservices/wss4j/trunk/src/test/resources/saml4sendKeyValue.properties&r1=1055820&r2=1055869&rev=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/resources/saml4sendKeyValue.properties (original)
+++ webservices/wss4j/trunk/src/test/resources/saml_hok_keyvalue.properties Thu Jan  6 13:36:21 2011
@@ -4,7 +4,7 @@ org.apache.ws.security.saml.issuer.key.n
 org.apache.ws.security.saml.issuer.key.password=security
 org.apache.ws.security.saml.issuer=www.example.com
 org.apache.ws.security.saml.issuer.sendKeyValue=true
-org.apache.ws.security.saml.confirmationMethod=keyHolder
+org.apache.ws.security.saml.issuer.signAssertion=true
 org.apache.ws.security.saml.version=1.1
-org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAMLAuthnHolderOfKeyHandler
+org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAML1AuthnHOKKeyValueHandler
 

Copied: webservices/wss4j/trunk/src/test/resources/saml_sv.properties (from r1055820, webservices/wss4j/trunk/src/test/resources/saml.properties)
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/resources/saml_sv.properties?p2=webservices/wss4j/trunk/src/test/resources/saml_sv.properties&p1=webservices/wss4j/trunk/src/test/resources/saml.properties&r1=1055820&r2=1055869&rev=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/resources/saml.properties (original)
+++ webservices/wss4j/trunk/src/test/resources/saml_sv.properties Thu Jan  6 13:36:21 2011
@@ -3,6 +3,5 @@ org.apache.ws.security.saml.issuer.crypt
 org.apache.ws.security.saml.issuer.key.name=16c73ab6-b892-458f-abf5-2f875f74882e
 org.apache.ws.security.saml.issuer.key.password=security
 org.apache.ws.security.saml.issuer=www.example.com
-org.apache.ws.security.saml.confirmationMethod=senderVouches
 org.apache.ws.security.saml.version=1.1
-org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAMLAuthnSenderVouchesHandler
+org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAML1AuthnSVHandler

Copied: webservices/wss4j/trunk/src/test/resources/saml_sv_noissuer.properties (from r1055820, webservices/wss4j/trunk/src/test/resources/saml3.properties)
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/test/resources/saml_sv_noissuer.properties?p2=webservices/wss4j/trunk/src/test/resources/saml_sv_noissuer.properties&p1=webservices/wss4j/trunk/src/test/resources/saml3.properties&r1=1055820&r2=1055869&rev=1055869&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/test/resources/saml3.properties (original)
+++ webservices/wss4j/trunk/src/test/resources/saml_sv_noissuer.properties Thu Jan  6 13:36:21 2011
@@ -2,8 +2,5 @@ org.apache.ws.security.saml.issuer.crypt
 org.apache.ws.security.saml.issuer.key.name=16c73ab6-b892-458f-abf5-2f875f74882e
 org.apache.ws.security.saml.issuer.key.password=security
 org.apache.ws.security.saml.issuer=www.example.com
-org.apache.ws.security.saml.subjectNameId.name=uid=joe,ou=people,ou=saml-demo,o=example.com
-org.apache.ws.security.saml.subjectNameId.qualifier=www.example.com
-org.apache.ws.security.saml.confirmationMethod=senderVouches
 org.apache.ws.security.saml.version=1.1
-org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAMLAuthnSenderVouchesHandler
+org.apache.ws.security.saml.callback=org.apache.ws.security.common.SAML1AuthnSVHandler