<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:mule="http://www.mulesoft.org/schema/mule/core" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.mulesoft.org/schema/mule/xmlsecurity">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace"></xs:import>
  <xs:import schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" namespace="http://www.springframework.org/schema/beans"></xs:import>
  <xs:import schemaLocation="http://www.mulesoft.org/schema/mule/core/current/mule.xsd" namespace="http://www.mulesoft.org/schema/mule/core"></xs:import>
  <xs:import schemaLocation="http://www.mulesoft.org/schema/mule/devkit/current/mule-devkit.xsd" namespace="http://www.mulesoft.org/schema/mule/devkit"></xs:import>
  <xs:simpleType name="integerType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="decimalType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:decimal"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="floatType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:float"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="doubleType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:double"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="dateTimeType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:dateTime"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="longType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:long"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="byteType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:byte"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="booleanType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:boolean"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="anyUriType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:anyURI"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="charType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="1"></xs:minLength>
          <xs:maxLength value="1"></xs:maxLength>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:complexType name="XmlType">
    <xs:sequence>
      <xs:any maxOccurs="unbounded" minOccurs="0" processContents="lax"></xs:any>
    </xs:sequence>
    <xs:attribute name="ref" use="optional" type="xs:string">
      <xs:annotation>
        <xs:documentation>The reference object for this parameter</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>
  <xs:element xmlns:devkit="http://www.mulesoft.org/schema/mule/devkit" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="config" substitutionGroup="mule:abstract-extension" devkit:javaClass="org.mule.module.xmlsecurity.config.XmlSecurityModuleLifecycleAdapter">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="mule:abstractExtensionType">
          <xs:annotation>
            <xs:documentation>Generic module</xs:documentation>
          </xs:annotation>
          <xs:attribute name="name" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Give a name to this configuration so it can be later referenced by config-ref.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/xmlsecurity" name="signatureType" use="required" type="SignatureTypeEnumType">
            <xs:annotation>
              <xs:documentation>The signature type
ACCEPTED VALUES: DETACHED, ENVELOPED, ENVELOPING</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="password" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Private Key, if you shared a private key use it. Otherwise the document will be signed with DSA512 algorithm, and
sign information will be in the signature tag.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="keystore" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Keystore path</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="keystoreKey" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Keystore key</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="secretKeyAlgorithm" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>The Algorithm which is used to encrypt the private key
For example: HmacSHA256</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="referenceURI" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Reference URI, if you wish to use an external reference URI for Detached signatures.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="keyPairAlgorithm" default="DSA" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Algorithm used to generate a key Pair.
ACCEPTED VALUES: DSA, RSA</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/xmlsecurity" name="digestMethodAlgorithm" default="SHA256" use="optional" type="DigestMethodAlgorithmEnumType">
            <xs:annotation>
              <xs:documentation>Digest Method Algorithm
For a reference on the Digest Method Algorithms see @see{http://www.w3.org/TR/2009/WD-xmlsec-algorithms-20090226/#digest-method-uris
ACCEPTED VALUES:  RIPEMD160, SHA1, SHA256, SHA512</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/xmlsecurity" name="canonicalizationAlgorithm" default="EXCLUSIVE" use="optional" type="CanonicalizationAlgorithmEnumType">
            <xs:annotation>
              <xs:documentation>Canonicalization Method
For a canonicalization specification see @see{http://www.w3.org/TR/2009/WD-xmlsec-algorithms-20090226/#canonicalization-uris
Accepted Values: EXCLUSIVE, EXCLUSIVE_WITH_COMMENTS, INCLUSIVE, INCLUSE_WITH_COMMENTS,</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/xmlsecurity" name="signatureMethodAlgorithm" default="RSA_SHA1" use="optional" type="SignatureMethodAlgorithmEnumType">
            <xs:annotation>
              <xs:documentation>Signature Method Algorithm
For Signature Method Algorithms specification see @see{http://www.w3.org/TR/2009/WD-xmlsec-algorithms-20090226/#signature-method-uris
Accepted Values: RSA_SHA1, DSA_SHA1, HMAC_SHA1</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/xmlsecurity" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="sign" substitutionGroup="mule:abstract-message-processor" type="SignType">
    <xs:annotation>
      <xs:documentation>Custom processor</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="SignType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/xmlsecurity" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="validate" substitutionGroup="mule:abstract-message-processor" type="ValidateType">
    <xs:annotation>
      <xs:documentation>Custom processor</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="ValidateType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="SignatureTypeEnumType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="DETACHED"></xs:enumeration>
          <xs:enumeration value="ENVELOPED"></xs:enumeration>
          <xs:enumeration value="ENVELOPING"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="DigestMethodAlgorithmEnumType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="RIPEMD160"></xs:enumeration>
          <xs:enumeration value="SHA1"></xs:enumeration>
          <xs:enumeration value="SHA256"></xs:enumeration>
          <xs:enumeration value="SHA512"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="CanonicalizationAlgorithmEnumType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="EXCLUSIVE"></xs:enumeration>
          <xs:enumeration value="EXCLUSIVE_WITH_COMMENTS"></xs:enumeration>
          <xs:enumeration value="INCLUSIVE"></xs:enumeration>
          <xs:enumeration value="INCLUSE_WITH_COMMENTS"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="SignatureMethodAlgorithmEnumType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="RSA_SHA1"></xs:enumeration>
          <xs:enumeration value="DSA_SHA1"></xs:enumeration>
          <xs:enumeration value="HMAC_SHA1"></xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="\#\[[^\]]+\]"></xs:pattern>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
</xs:schema>