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 2018/05/01 12:37:04 UTC

svn commit: r1830674 - in /webservices/wss4j/trunk: bindings/src/main/java/org/apache/wss4j/binding/wss10/ ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/ ws-security-stax/src/main/resources/schemas/

Author: coheigea
Date: Tue May  1 12:37:04 2018
New Revision: 1830674

URL: http://svn.apache.org/viewvc?rev=1830674&view=rev
Log:
WSS-628 - Support xop:Include for BinarySecurityTokens as well

Modified:
    webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/BinarySecurityTokenType.java
    webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/ObjectFactory.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd

Modified: webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/BinarySecurityTokenType.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/BinarySecurityTokenType.java?rev=1830674&r1=1830673&r2=1830674&view=diff
==============================================================================
--- webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/BinarySecurityTokenType.java (original)
+++ webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/BinarySecurityTokenType.java Tue May  1 12:37:04 2018
@@ -17,20 +17,34 @@
  * under the License.
  */
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
 // Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2014.03.27 at 03:31:20 PM GMT
+// Generated on: 2018.05.01 at 12:07:44 PM IST
 //
 
 
 package org.apache.wss4j.binding.wss10;
 
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
 import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlID;
+import javax.xml.bind.annotation.XmlMixed;
 import javax.xml.bind.annotation.XmlSchemaType;
 import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+import org.apache.xml.security.binding.xop.Include;
 
 
 /**
@@ -41,27 +55,75 @@ import javax.xml.bind.annotation.XmlType
  * <p>The following schema fragment specifies the expected content contained within this class.
  *
  * <pre>
- * &lt;complexType name="BinarySecurityTokenType">
- *   &lt;simpleContent>
- *     &lt;extension base="&lt;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd>EncodedString">
- *       &lt;attribute name="ValueType" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       &lt;anyAttribute processContents='lax' namespace='##other'/>
- *     &lt;/extension>
- *   &lt;/simpleContent>
- * &lt;/complexType>
+ * &lt;complexType name="BinarySecurityTokenType"&gt;
+ *   &lt;complexContent&gt;
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
+ *       &lt;sequence&gt;
+ *         &lt;element ref="{http://www.w3.org/2004/08/xop/include}Include" minOccurs="0"/&gt;
+ *       &lt;/sequence&gt;
+ *       &lt;attribute name="ValueType" type="{http://www.w3.org/2001/XMLSchema}anyURI" /&gt;
+ *       &lt;attribute name="EncodingType" type="{http://www.w3.org/2001/XMLSchema}anyURI" /&gt;
+ *       &lt;attribute ref="{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id"/&gt;
+ *       &lt;anyAttribute processContents='lax' namespace='##other'/&gt;
+ *     &lt;/restriction&gt;
+ *   &lt;/complexContent&gt;
+ * &lt;/complexType&gt;
  * </pre>
  *
  *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "BinarySecurityTokenType")
-public class BinarySecurityTokenType
-    extends EncodedString
-{
-
+@XmlType(name = "BinarySecurityTokenType", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", propOrder = {
+    "content"
+})
+public class BinarySecurityTokenType {
+
+    @XmlElementRef(name = "Include", namespace = "http://www.w3.org/2004/08/xop/include", type = JAXBElement.class)
+    @XmlMixed
+    protected List<Serializable> content;
     @XmlAttribute(name = "ValueType")
     @XmlSchemaType(name = "anyURI")
-    private String valueType;
+    protected String valueType;
+    @XmlAttribute(name = "EncodingType")
+    @XmlSchemaType(name = "anyURI")
+    protected String encodingType;
+    @XmlAttribute(name = "Id", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")
+    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+    @XmlID
+    @XmlSchemaType(name = "ID")
+    protected String id;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * A security token that is encoded in binary Gets the value of the content property.
+     *
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the content property.
+     *
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getContent().add(newItem);
+     * </pre>
+     *
+     *
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link String }
+     * {@link JAXBElement }{@code <}{@link Include }{@code >}
+     *
+     *
+     */
+    public List<Serializable> getContent() {
+        if (content == null) {
+            content = new ArrayList<Serializable>();
+        }
+        return this.content;
+    }
 
     /**
      * Gets the value of the valueType property.
@@ -87,4 +149,70 @@ public class BinarySecurityTokenType
         this.valueType = value;
     }
 
+    /**
+     * Gets the value of the encodingType property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getEncodingType() {
+        return encodingType;
+    }
+
+    /**
+     * Sets the value of the encodingType property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setEncodingType(String value) {
+        this.encodingType = value;
+    }
+
+    /**
+     * Gets the value of the id property.
+     *
+     * @return
+     *     possible object is
+     *     {@link String }
+     *
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Sets the value of the id property.
+     *
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *
+     */
+    public void setId(String value) {
+        this.id = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     *
+     * <p>
+     * the map is keyed by the name of the attribute and
+     * the value is the string value of the attribute.
+     *
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     *
+     *
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
 }

Modified: webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/ObjectFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/ObjectFactory.java?rev=1830674&r1=1830673&r2=1830674&view=diff
==============================================================================
--- webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/ObjectFactory.java (original)
+++ webservices/wss4j/trunk/bindings/src/main/java/org/apache/wss4j/binding/wss10/ObjectFactory.java Tue May  1 12:37:04 2018
@@ -17,10 +17,10 @@
  * under the License.
  */
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
 // Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2014.03.27 at 03:31:20 PM GMT
+// Generated on: 2018.05.01 at 12:07:44 PM IST
 //
 
 
@@ -49,17 +49,16 @@ import javax.xml.namespace.QName;
 @XmlRegistry
 public class ObjectFactory {
 
-    private static final String WSSE_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
-    private static final QName _Nonce_QNAME = new QName(WSSE_NS, "Nonce");
-    private static final QName _Reference_QNAME = new QName(WSSE_NS, "Reference");
-    private static final QName _BinarySecurityToken_QNAME = new QName(WSSE_NS, "BinarySecurityToken");
-    private static final QName _UsernameToken_QNAME = new QName(WSSE_NS, "UsernameToken");
-    private static final QName _KeyIdentifier_QNAME = new QName(WSSE_NS, "KeyIdentifier");
-    private static final QName _Embedded_QNAME = new QName(WSSE_NS, "Embedded");
-    private static final QName _Security_QNAME = new QName(WSSE_NS, "Security");
-    private static final QName _SecurityTokenReference_QNAME = new QName(WSSE_NS, "SecurityTokenReference");
-    private static final QName _Password_QNAME = new QName(WSSE_NS, "Password");
-    private static final QName _TransformationParameters_QNAME = new QName(WSSE_NS, "TransformationParameters");
+    private final static QName _UsernameToken_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "UsernameToken");
+    private final static QName _BinarySecurityToken_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "BinarySecurityToken");
+    private final static QName _Reference_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Reference");
+    private final static QName _Embedded_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Embedded");
+    private final static QName _KeyIdentifier_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "KeyIdentifier");
+    private final static QName _SecurityTokenReference_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "SecurityTokenReference");
+    private final static QName _Security_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security");
+    private final static QName _TransformationParameters_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "TransformationParameters");
+    private final static QName _Password_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Password");
+    private final static QName _Nonce_QNAME = new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Nonce");
 
     /**
      * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.wss4j.binding.wss10
@@ -69,35 +68,43 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link SecurityHeaderType }
+     * Create an instance of {@link UsernameTokenType }
      *
      */
-    public SecurityHeaderType createSecurityHeaderType() {
-        return new SecurityHeaderType();
+    public UsernameTokenType createUsernameTokenType() {
+        return new UsernameTokenType();
     }
 
     /**
-     * Create an instance of {@link EmbeddedType }
+     * Create an instance of {@link BinarySecurityTokenType }
      *
      */
-    public EmbeddedType createEmbeddedType() {
-        return new EmbeddedType();
+    public BinarySecurityTokenType createBinarySecurityTokenType() {
+        return new BinarySecurityTokenType();
     }
 
     /**
-     * Create an instance of {@link TransformationParametersType }
+     * Create an instance of {@link ReferenceType }
      *
      */
-    public TransformationParametersType createTransformationParametersType() {
-        return new TransformationParametersType();
+    public ReferenceType createReferenceType() {
+        return new ReferenceType();
     }
 
     /**
-     * Create an instance of {@link PasswordString }
+     * Create an instance of {@link EmbeddedType }
      *
      */
-    public PasswordString createPasswordString() {
-        return new PasswordString();
+    public EmbeddedType createEmbeddedType() {
+        return new EmbeddedType();
+    }
+
+    /**
+     * Create an instance of {@link KeyIdentifierType }
+     *
+     */
+    public KeyIdentifierType createKeyIdentifierType() {
+        return new KeyIdentifierType();
     }
 
     /**
@@ -109,27 +116,27 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link UsernameTokenType }
+     * Create an instance of {@link SecurityHeaderType }
      *
      */
-    public UsernameTokenType createUsernameTokenType() {
-        return new UsernameTokenType();
+    public SecurityHeaderType createSecurityHeaderType() {
+        return new SecurityHeaderType();
     }
 
     /**
-     * Create an instance of {@link BinarySecurityTokenType }
+     * Create an instance of {@link TransformationParametersType }
      *
      */
-    public BinarySecurityTokenType createBinarySecurityTokenType() {
-        return new BinarySecurityTokenType();
+    public TransformationParametersType createTransformationParametersType() {
+        return new TransformationParametersType();
     }
 
     /**
-     * Create an instance of {@link ReferenceType }
+     * Create an instance of {@link PasswordString }
      *
      */
-    public ReferenceType createReferenceType() {
-        return new ReferenceType();
+    public PasswordString createPasswordString() {
+        return new PasswordString();
     }
 
     /**
@@ -141,14 +148,6 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link KeyIdentifierType }
-     *
-     */
-    public KeyIdentifierType createKeyIdentifierType() {
-        return new KeyIdentifierType();
-    }
-
-    /**
      * Create an instance of {@link AttributedString }
      *
      */
@@ -157,93 +156,93 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link EncodedString }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link UsernameTokenType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "Nonce")
-    public JAXBElement<EncodedString> createNonce(EncodedString value) {
-        return new JAXBElement<EncodedString>(_Nonce_QNAME, EncodedString.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "UsernameToken")
+    public JAXBElement<UsernameTokenType> createUsernameToken(UsernameTokenType value) {
+        return new JAXBElement<UsernameTokenType>(_UsernameToken_QNAME, UsernameTokenType.class, null, value);
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link ReferenceType }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link BinarySecurityTokenType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "Reference")
-    public JAXBElement<ReferenceType> createReference(ReferenceType value) {
-        return new JAXBElement<ReferenceType>(_Reference_QNAME, ReferenceType.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "BinarySecurityToken")
+    public JAXBElement<BinarySecurityTokenType> createBinarySecurityToken(BinarySecurityTokenType value) {
+        return new JAXBElement<BinarySecurityTokenType>(_BinarySecurityToken_QNAME, BinarySecurityTokenType.class, null, value);
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link BinarySecurityTokenType }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link ReferenceType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "BinarySecurityToken")
-    public JAXBElement<BinarySecurityTokenType> createBinarySecurityToken(BinarySecurityTokenType value) {
-        return new JAXBElement<BinarySecurityTokenType>(_BinarySecurityToken_QNAME, BinarySecurityTokenType.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Reference")
+    public JAXBElement<ReferenceType> createReference(ReferenceType value) {
+        return new JAXBElement<ReferenceType>(_Reference_QNAME, ReferenceType.class, null, value);
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link UsernameTokenType }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link EmbeddedType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "UsernameToken")
-    public JAXBElement<UsernameTokenType> createUsernameToken(UsernameTokenType value) {
-        return new JAXBElement<UsernameTokenType>(_UsernameToken_QNAME, UsernameTokenType.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Embedded")
+    public JAXBElement<EmbeddedType> createEmbedded(EmbeddedType value) {
+        return new JAXBElement<EmbeddedType>(_Embedded_QNAME, EmbeddedType.class, null, value);
     }
 
     /**
      * Create an instance of {@link JAXBElement }{@code <}{@link KeyIdentifierType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "KeyIdentifier")
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "KeyIdentifier")
     public JAXBElement<KeyIdentifierType> createKeyIdentifier(KeyIdentifierType value) {
         return new JAXBElement<KeyIdentifierType>(_KeyIdentifier_QNAME, KeyIdentifierType.class, null, value);
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link EmbeddedType }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link SecurityTokenReferenceType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "Embedded")
-    public JAXBElement<EmbeddedType> createEmbedded(EmbeddedType value) {
-        return new JAXBElement<EmbeddedType>(_Embedded_QNAME, EmbeddedType.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "SecurityTokenReference")
+    public JAXBElement<SecurityTokenReferenceType> createSecurityTokenReference(SecurityTokenReferenceType value) {
+        return new JAXBElement<SecurityTokenReferenceType>(_SecurityTokenReference_QNAME, SecurityTokenReferenceType.class, null, value);
     }
 
     /**
      * Create an instance of {@link JAXBElement }{@code <}{@link SecurityHeaderType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "Security")
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Security")
     public JAXBElement<SecurityHeaderType> createSecurity(SecurityHeaderType value) {
         return new JAXBElement<SecurityHeaderType>(_Security_QNAME, SecurityHeaderType.class, null, value);
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link SecurityTokenReferenceType }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link TransformationParametersType }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "SecurityTokenReference")
-    public JAXBElement<SecurityTokenReferenceType> createSecurityTokenReference(SecurityTokenReferenceType value) {
-        return new JAXBElement<SecurityTokenReferenceType>(_SecurityTokenReference_QNAME, SecurityTokenReferenceType.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "TransformationParameters")
+    public JAXBElement<TransformationParametersType> createTransformationParameters(TransformationParametersType value) {
+        return new JAXBElement<TransformationParametersType>(_TransformationParameters_QNAME, TransformationParametersType.class, null, value);
     }
 
     /**
      * Create an instance of {@link JAXBElement }{@code <}{@link PasswordString }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "Password")
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Password")
     public JAXBElement<PasswordString> createPassword(PasswordString value) {
         return new JAXBElement<PasswordString>(_Password_QNAME, PasswordString.class, null, value);
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link TransformationParametersType }{@code >}}
+     * Create an instance of {@link JAXBElement }{@code <}{@link EncodedString }{@code >}}
      *
      */
-    @XmlElementDecl(namespace = WSSE_NS, name = "TransformationParameters")
-    public JAXBElement<TransformationParametersType> createTransformationParameters(TransformationParametersType value) {
-        return new JAXBElement<TransformationParametersType>(_TransformationParameters_QNAME, TransformationParametersType.class, null, value);
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Nonce")
+    public JAXBElement<EncodedString> createNonce(EncodedString value) {
+        return new JAXBElement<EncodedString>(_Nonce_QNAME, EncodedString.class, null, value);
     }
 
 }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java?rev=1830674&r1=1830673&r2=1830674&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java Tue May  1 12:37:04 2018
@@ -18,9 +18,14 @@
  */
 package org.apache.wss4j.stax.validate;
 
+import java.util.Base64;
+
+import javax.xml.bind.JAXBElement;
+
 import org.apache.wss4j.binding.wss10.BinarySecurityTokenType;
 import org.apache.wss4j.common.crypto.Crypto;
 import org.apache.wss4j.common.ext.WSSecurityException;
+import org.apache.wss4j.common.util.AttachmentUtils;
 import org.apache.wss4j.stax.ext.WSSConfigurationException;
 import org.apache.wss4j.stax.ext.WSSConstants;
 import org.apache.wss4j.stax.ext.WSSSecurityProperties;
@@ -28,9 +33,10 @@ import org.apache.wss4j.stax.impl.securi
 import org.apache.wss4j.stax.securityToken.WSSecurityTokenConstants;
 import org.apache.wss4j.stax.impl.securityToken.KerberosServiceSecurityTokenImpl;
 import org.apache.wss4j.stax.impl.securityToken.X509PKIPathv1SecurityTokenImpl;
+import org.apache.xml.security.binding.xop.Include;
 import org.apache.xml.security.exceptions.XMLSecurityException;
+import org.apache.xml.security.stax.ext.XMLSecurityConstants;
 import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
-import org.apache.xml.security.utils.XMLUtils;
 
 public class BinarySecurityTokenValidatorImpl implements BinarySecurityTokenValidator {
 
@@ -49,9 +55,10 @@ public class BinarySecurityTokenValidato
                     new Object[] {binarySecurityTokenType.getEncodingType()});
         }
 
-        byte[] securityTokenData = XMLUtils.decode(binarySecurityTokenType.getValue());
-
         try {
+            byte[] securityTokenData =
+                getBinarySecurityTokenBytes(binarySecurityTokenType, tokenContext.getWssSecurityProperties());
+
             if (WSSConstants.NS_X509_V3_TYPE.equals(binarySecurityTokenType.getValueType())) {
                 Crypto crypto = getCrypto(tokenContext.getWssSecurityProperties());
                 X509V3SecurityTokenImpl x509V3SecurityToken = new X509V3SecurityTokenImpl(
@@ -98,6 +105,30 @@ public class BinarySecurityTokenValidato
         }
     }
 
+    private byte[] getBinarySecurityTokenBytes(BinarySecurityTokenType binarySecurityTokenType,
+                                               WSSSecurityProperties wssSecurityProperties) throws XMLSecurityException {
+
+        StringBuilder sb = new StringBuilder();
+
+        for (Object obj : binarySecurityTokenType.getContent()) {
+            if (obj instanceof String) {
+                sb.append((String)obj);
+            } else if (obj instanceof JAXBElement<?>) {
+                JAXBElement<?> element = (JAXBElement<?>)obj;
+                if (XMLSecurityConstants.TAG_XOP_INCLUDE.equals(element.getName())) {
+                    Include include = (Include)element.getValue();
+                    if (include != null && include.getHref() != null && include.getHref().startsWith("cid:")) {
+                        return AttachmentUtils.getBytesFromAttachment(include.getHref(),
+                                                                      wssSecurityProperties.getAttachmentCallbackHandler(),
+                                                                      true);
+                    }
+                }
+            }
+        }
+
+        return Base64.getMimeDecoder().decode(sb.toString());
+    }
+
     protected Crypto getCrypto(WSSSecurityProperties securityProperties) throws WSSConfigurationException {
         Crypto crypto = null;
         try {

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd?rev=1830674&r1=1830673&r2=1830674&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/resources/schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd Tue May  1 12:37:04 2018
@@ -7,10 +7,11 @@ This document and translations of it may
 The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
 This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 -->
-<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" attributeFormDefault="unqualified" blockDefault="#all" version="0.2">
+<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xop='http://www.w3.org/2004/08/xop/include' elementFormDefault="qualified" attributeFormDefault="unqualified" blockDefault="#all" version="0.2">
 	<xsd:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
 	<xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
 	<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
+	<xsd:import namespace="http://www.w3.org/2004/08/xop/include" schemaLocation='https://www.w3.org/2004/08/xop/include'/>
 	<xsd:complexType name="AttributedString">
 		<xsd:annotation>
 			<xsd:documentation>This type represents an element with arbitrary attributes.</xsd:documentation>
@@ -53,15 +54,18 @@ This document and the information contai
 		<xsd:attribute ref="wsu:Id"/>
 		<xsd:anyAttribute namespace="##other" processContents="lax"/>
 	</xsd:complexType>
-	<xsd:complexType name="BinarySecurityTokenType">
+	<!-- Modified portion here to allow xop:Include -->
+	<xsd:complexType name="BinarySecurityTokenType" mixed='true'>
 		<xsd:annotation>
 			<xsd:documentation>A security token that is encoded in binary</xsd:documentation>
 		</xsd:annotation>
-		<xsd:simpleContent>
-			<xsd:extension base="wsse:EncodedString">
-				<xsd:attribute name="ValueType" type="xsd:anyURI"/>
-			</xsd:extension>
-		</xsd:simpleContent>
+		<xsd:sequence>
+            <xsd:element ref='xop:Include' minOccurs='0'/>
+        </xsd:sequence>
+        <xsd:attribute name="ValueType" type="xsd:anyURI"/>
+        <xsd:attribute name="EncodingType" type="xsd:anyURI"/>
+        <xsd:attribute ref="wsu:Id"/>
+        <xsd:anyAttribute namespace="##other" processContents="lax"/>
 	</xsd:complexType>
 	<xsd:complexType name="KeyIdentifierType">
 		<xsd:annotation>