<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
        xmlns:dsig11="http://www.w3.org/2009/xmldsig11#"
        targetNamespace="http://www.w3.org/2009/xmldsig11#"
        version="0.1" elementFormDefault="qualified">

  <import namespace="http://www.w3.org/2000/09/xmldsig#"/>

  <element name="ECKeyValue" type="dsig11:ECKeyValueType"/>
  <complexType name="ECKeyValueType">
    <sequence>
      <choice>
        <element name="ECParameters" type="dsig11:ECParametersType"/>
        <element name="NamedCurve" type="dsig11:NamedCurveType"/>
      </choice>
      <element name="PublicKey" type="dsig11:ECPointType"/>
    </sequence>
  </complexType>

  <complexType name="NamedCurveType">
    <attribute name="URI" type="anyURI"/>
  </complexType>
  
  <simpleType name="ECPointType">
    <restriction base="ds:CryptoBinary"/>
  </simpleType>

  <complexType name="ECParametersType">
    <sequence>
      <element name="FieldID" type="dsig11:FieldIDType"/>
      <element name="Curve" type="dsig11:CurveType"/>
      <element name="Base" type="dsig11:ECPointType"/>
      <element name="Order" type="ds:CryptoBinary"/>
      <element name="CoFactor" type="integer" minOccurs="0"/>
      <element name="Hash" type="anyURI" minOccurs="0"/>
    </sequence>
  </complexType>
  
  <complexType name="FieldIDType">
    <choice>
      <element ref="dsig11:Prime"/>
      <element ref="dsig11:GnB"/>
      <element ref="dsig11:TnB"/>
      <element ref="dsig11:PnB"/>
      <any namespace="##other" processContents="lax"/>
    </choice>
  </complexType>

  <complexType name="CurveType">
    <sequence>
      <element name="A" type="ds:CryptoBinary"/>
      <element name="B" type="ds:CryptoBinary"/>
      <element name="Seed" type="ds:CryptoBinary" minOccurs="0"/>
    </sequence>
  </complexType>

  <element name="Prime" type="dsig11:PrimeFieldParamsType"/>
  <complexType name="PrimeFieldParamsType">
    <sequence>
      <element name="P" type="ds:CryptoBinary"/>
    </sequence>
  </complexType>

  <element name="GnB" type="dsig11:CharTwoFieldParamsType"/>
  <complexType name="CharTwoFieldParamsType">
    <sequence>
      <element name="M" type="positiveInteger"/>
      <element name="W" type="positiveInteger"/>
    </sequence>
  </complexType>
  
  <element name="TnB" type="dsig11:TnBFieldParamsType"/>
  <complexType name="TnBFieldParamsType">
    <complexContent>
      <extension base="dsig11:CharTwoFieldParamsType">
        <sequence>
          <element name="K" type="positiveInteger"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <element name="PnB" type="dsig11:PnBFieldParamsType"/>
  <complexType name="PnBFieldParamsType">
    <complexContent>
      <extension base="dsig11:CharTwoFieldParamsType">
        <sequence>
          <element name="K1" type="positiveInteger"/>
          <element name="K2" type="positiveInteger"/>
          <element name="K3" type="positiveInteger"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  
  <element name="OCSPResponse" type="base64binary"/>
</schema>
