<?xml version='1.0'?> 
<!DOCTYPE schema 
   SYSTEM 'http://www.w3.org/1999/XMLSchema.dtd' 
  [ 
   <!ENTITY dsig 'http://www.w3.org/2000/09/xmldsig#'> 
  ]> 


<schema targetNamespace='&dsig;' 
   version='0.1' 
   xmlns='http://www.w3.org/1999/XMLSchema'
   xmlns:ds='&dsig;'
   elementFormDefault='qualified'> 

<!-- Basic Types Defined for Signatures -->

<simpleType name='CryptoBinary' base='binary'>
    <encoding value='base64'/>
</simpleType>

<!-- Start Signature -->

<element name='Signature'> 
  <complexType content='elementOnly'>
    <sequence minOccurs='1' maxOccurs='1'> 
      <element ref='ds:SignedInfo' minOccurs='1' maxOccurs='1'/> 
      <element ref='ds:SignatureValue' minOccurs='1' maxOccurs='1'/> 
      <element ref='ds:KeyInfo' minOccurs='0' maxOccurs='1'/> 
      <element ref='ds:Object' minOccurs='0' maxOccurs='unbounded'/> 
    </sequence>  
    <attribute name='Id' type='ID' use='optional'/> 
  </complexType>
</element> 

<!-- Start SignedInfo -->

<element name='SignedInfo'> 
  <complexType content='elementOnly'>
    <sequence minOccurs='1' maxOccurs='1'> 
      <element ref='ds:CanonicalizationMethod' minOccurs='1' maxOccurs='1'/> 
      <element ref='ds:SignatureMethod' minOccurs='1' maxOccurs='1'/> 
      <element ref='ds:Reference' minOccurs='1' maxOccurs='unbounded'/> 
    </sequence>  
  <attribute name='Id' type='ID' use='optional'/> 
  </complexType>
</element> 

<element name='CanonicalizationMethod'> 
  <complexType content='elementOnly'>
    <any  minOccurs='0' maxOccurs='unbounded'/>
    <attribute name='Algorithm' type='uriReference' use='required'/> 
  </complexType>
</element> 

<element name='SignatureMethod'> 
  <complexType content='elementOnly'> 
    <any minOccurs='0' maxOccurs='unbounded'/>
    <attribute name='Algorithm' type='uriReference' use='required'/> 
   </complexType>
</element> 

<element name='SignatureValue' type='ds:CryptoBinary'/> 

<!-- Start Reference -->

<element name='Reference'> 
  <complexType content='elementOnly'>
    <sequence minOccurs='1' maxOccurs='1'> 
      <element ref='ds:Transforms' minOccurs='0' maxOccurs='1'/> 
      <element ref='ds:DigestMethod' minOccurs='1' maxOccurs='1'/> 
      <element ref='ds:DigestValue' minOccurs='1' maxOccurs='1'/> 
    </sequence>
    <attribute name='Id' type='ID' use='optional'/> 
    <attribute name='URI' type='uriReference' use='optional'/> 
    <attribute name='Type' type='uriReference' use='optional'/> 
  </complexType>
</element> 

<element name='Transforms' > 
  <complexType content='elementOnly'> 
    <element ref='ds:Transform' minOccurs='1' maxOccurs='unbounded'/>  
  </complexType>
</element> 

  <element name='Transform'> 
  <complexType content='elementOnly'>
    <choice minOccurs='1' maxOccurs='unbounded'> 
      <any namespace='##other' processContents='lax' minOccurs='0' 
           maxOccurs='unbounded'/>
      <element name='XSLT' type='string'/> 
      <!-- must be an xsl:stylesheet element -->
      <element name='XPath' type='string'/> 
    </choice>
    <attribute name='Algorithm' type='uriReference' use='required'/> 
  </complexType>
</element>


<!-- End Reference -->

<element name='DigestMethod'> 
  <complexType content='elementOnly'> 
    <any processContents='lax' minOccurs='0' maxOccurs='unbounded'/>
    <attribute name='Algorithm' type='uriReference' use='required'/> 
  </complexType>
</element> 

<element name='DigestValue' type='ds:CryptoBinary'/> 


<!-- End SignedInfo -->

<!-- Start KeyInfo -->

<element name='KeyInfo'> 
  <complexType content='elementOnly'>
    <choice minOccurs='1' maxOccurs='unbounded'>     
      <any processContents='lax' namespace='##other' minOccurs='0' maxOccurs='unbounded'/> 
      <element name='KeyName' type='string'/> 
      <element ref='ds:KeyValue'/> 
      <element ref='ds:RetrievalMethod'/> 
      <element ref='ds:X509Data'/> 
      <element ref='ds:PGPData'/> 
      <element ref='ds:SPKIData'/>
      <element name='MgmtData' type='string'/>
    </choice>
    <attribute name='Id' type='ID' use='optional'/> 
  </complexType>
</element> 

<element name='KeyValue'>
  <complexType content='mixed'>
    <choice minOccurs='1' maxOccurs='1'>
      <any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded'/>
      <element ref='ds:DSAKeyValue'/>
      <element ref='ds:RSAKeyValue'/>
    </choice>
  </complexType >
</element>

<element name='RetrievalMethod'>
  <complexType content='elementOnly'>
     <element ref='ds:Transforms' minOccurs='0' maxOccurs='1'/>
     <attribute name='URI' type='uriReference'/>
     <attribute name='Type' type='uriReference'/>
  </complexType>
</element> 

<element name='Type'>
  <complexType content='mixed'>
    <any namespace='##any' minOccurs='1' maxOccurs='unbounded'/>
    <attribute name='Encoding' type='uriReference' use='optional'/>
  </complexType>
</element>

<!-- Start X509Data -->

<element name='X509Data'> 
   <complexType content='elementOnly'> 
    <choice minOccurs='1' maxOccurs='1'>
      <sequence minOccurs='1' maxOccurs='unbounded'> 
        <choice minOccurs='1' maxOccurs='1'> 
          <element ref='ds:X509IssuerSerial'/>
          <element name='X509SKI' type='ds:CryptoBinary'/>
          <element name='X509SubjectName' type='string'/> 
          <element name='X509Certificate' type='ds:CryptoBinary'/>
        </choice>  
      </sequence>
      <element name='X509CRL' type='ds:CryptoBinary'/>
    </choice>
  </complexType>
</element>

<element name='X509IssuerSerial'> 
   <complexType content='elementOnly'> 
    <sequence minOccurs='1' maxOccurs='1'> 
      <element name='X509IssuerName' type='string' minOccurs='1' maxOccurs='1'/> 
      <element name='X509SerialNumber' type='integer' minOccurs='1' maxOccurs='1'/> 
    </sequence>
   </complexType>
</element>

<!-- End X509Data -->

<!-- Begin PGPData -->

<element name='PGPData'> 
  <complexType content='elementOnly'> 
    <choice minOccurs='1' maxOccurs='1'>
      <any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded'/>
      <sequence minOccurs='1' maxOccurs='1'>
        <element name='PGPKeyID' type='string' minOccurs='1' maxOccurs='1'/> 
        <element name='PGPKeyPacket' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
      </sequence>  
    </choice>
  </complexType>
</element>

<!-- End PGPData -->

<!-- Begin SPKIData -->

<element name='SPKIData'> 
  <complexType content='elementOnly'> 
    <any namespace='##other' processContents='lax' minOccurs='1' maxOccurs='unbounded'/>
  </complexType>
</element> 
  
<!-- End SPKIData -->

<!-- End KeyInfo -->

<!-- Start Object (Manifest, SignatureProperty) -->

<element name='Object' > 
  <complexType content='mixed'>
    <sequence minOccurs='1' maxOccurs='unbounded'>
      <any namespace='##any' processContents='lax' minOccurs='1' maxOccurs='1'/>
    </sequence>
    <attribute name='Id' type='ID' use='optional'/> 
    <attribute name='MimeType' type='string' use='optional'/> <!-- add a grep facet -->
    <attribute name='Encoding' type='uriReference' use='optional'/> 
  </complexType>
</element> 

<element name='Manifest'> 
  <complexType content='elementOnly'>
    <sequence minOccurs='1' maxOccurs='1'>
      <element ref='ds:Reference' minOccurs='1' maxOccurs='unbounded'/> 
    </sequence>  
    <attribute name='Id' type='ID' use='optional'/> 
  </complexType>
</element> 

<element name='SignatureProperties'> 
  <complexType content='elementOnly'> 
    <element ref='ds:SignatureProperty' minOccurs='1' maxOccurs='unbounded'/> 
    <attribute name='Id' type='ID' use='optional'/> 
  </complexType>
</element> 

<element name='SignatureProperty'> 
  <complexType content='mixed'> 
    <any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded'/>
    <attribute name='Target' type='uriReference' use='required'/> 
    <attribute name='Id' type='ID' use='optional'/> 
    </complexType>
</element> 

<!-- End Object (Manifest, SignatureProperty) -->

<!-- Start Algorithm Parameters -->

<element name='HMACOutputLength' type='integer'/>

<!-- Start KeyValue Element-types -->

<element name='DSAKeyValue'> 
  <complexType content='elementOnly'> 
    <sequence minOccurs='1' maxOccurs='1'>
      <element name='P' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
      <element name='Q' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
      <element name='G' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
      <element name='Y' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
      <element name='J' type='ds:CryptoBinary' minOccurs='0' maxOccurs='1'/> 
    </sequence>
    <sequence minOccurs='0' maxOccurs='1'>
      <element name='Seed' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
      <element name='PgenCounterQ' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
    </sequence>
  </complexType>
</element>

<element name='RSAKeyValue'> 
  <complexType content='elementOnly'> 
    <element name='Modulus' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
    <element name='Exponent' type='ds:CryptoBinary' minOccurs='1' maxOccurs='1'/> 
  </complexType> 
</element>

<!-- End KeyValue Element-types -->

<!-- End Signature -->

</schema>


