<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="http://www.itu.int/xml-namespace/itu-t/x.1341/x-cmail-notices"
	elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" 
        xmlns:tns="http://www.itu.int/xml-namespace/itu-t/x.1341/x-cmail-notices" 
        xmlns:ds="http://www.w3.org/2000/09/xmldsig#">

  <import namespace="http://www.w3.org/2009/xmldsig11#"
    schemaLocation="http://www.w3.org/TR/xmldsig-core1/xmldsig11-schema.xsd" />
  
  <import namespace="http://www.w3.org/2009/xmldsig-properties"
    schemaLocation="http://www.w3.org/TR/xmldsig-properties/xmldsig-properties.xsd" />

  <import namespace="http://www.w3.org/2000/09/xmldsig#"
          schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd">
    
  </import>

  <element name="DepositNotice" type="tns:DepositNoticeType"></element>
  <element name="SignedDepositNotice" type="tns:SignedDepositNoticeType"></element>
  <element name="TransitNotice" type="tns:TransitNoticeType"></element>
  <element name="SignedTransitNotice" type="tns:SignedTransitNoticeType"></element>
  <element name="ReceipNotice" type="tns:ReceiptNoticeType"></element>
  <element name="SignedReceiptNotice" type="tns:SignedReceiptNoticeType"></element>

  <complexType name="DigitalPostmarkType">
    <sequence>
      <element name="MimeMessageHash" type="tns:HashValueType"
        maxOccurs="unbounded" minOccurs="1">
      </element>
      <element name="Signature" type="ds:SignatureType"
        maxOccurs="unbounded" minOccurs="0">
      </element>
    </sequence>
    <attribute name="EnvelopeId" type="string" use="required"></attribute>
    <attribute name="DeliveryType" use="required">
      <simpleType>
        <restriction base="string">
          <enumeration value="CertifiedMail"></enumeration>
        </restriction>
      </simpleType>
    </attribute>
  </complexType>

  <complexType name="EnvelopeInformationType">
    <sequence>
      <element name="ContentEnvelopeInformation"
        type="tns:ContentEnvelopeInformationType" maxOccurs="1" minOccurs="1">
      </element>
      <element name="Entities" type="tns:EntitiesType"
        maxOccurs="1" minOccurs="1">
      </element>
      <element name="Signature" type="ds:SignatureType"
        maxOccurs="unbounded" minOccurs="0">
      </element>
    </sequence>
  </complexType>

  <complexType name="ContentEnvelopeInformationType">
    <sequence>
      <element name="UncipheredEnvelopeHash" type="tns:HashValueType"></element>
      <element name="CipheredEnvelopeHash" type="tns:HashValueType"></element>
    </sequence>
    <attribute name="MessageId" type="string"></attribute>
  </complexType>

  <complexType name="SecretQuestionType">
    <sequence>
      <element name="Request" type="tns:RequestType"></element>
      <element name="Response" type="tns:ResponseType"></element>
    </sequence>
  </complexType>

  <complexType name="EntityType">
    <sequence>
      <element name="SecretQuestion" type="tns:SecretQuestionType"></element>
      <element name="CipherEnvelopeKey"
        type="tns:CipherEnvelopeKeyType">
      </element>
      <element name="Certificate" type="tns:CertificateType"></element>
    </sequence>
    <attribute name="EmailAddress" type="string" use="required">
      <annotation>
        <documentation>Email address has to be in RFC 822format</documentation>
      </annotation></attribute>
    <attribute name="Type" use="required">
      <simpleType>
        <restriction base="string">
          <enumeration value="from"></enumeration>
          <enumeration value="to"></enumeration>
          <enumeration value="cc"></enumeration>
          <enumeration value="transit"></enumeration>
        </restriction>
      </simpleType>
    </attribute>
  </complexType>

  <complexType name="CipherEnvelopeKeyType">
    <attribute name="Algorithm" type="string"></attribute>
    <attribute name="CipheredKey" type="string"></attribute>
    <attribute name="Encoding" type="string"></attribute>
    <attribute name="KeySize" type="int"></attribute>
  </complexType>

  <complexType name="CertificateType">
    <attribute name="encoding" type="string"></attribute>
  </complexType>

  <complexType name="EntitiesType">
    <sequence>
      <element name="Entity" type="tns:EntityType"
        maxOccurs="unbounded" minOccurs="1">
      </element>
    </sequence>
  </complexType>

  <complexType name="SignedDepositNoticeType">
    <sequence>
      <element name="DigitalPostmark" type="tns:DigitalPostmarkType"
        maxOccurs="1" minOccurs="1">
      </element>
      <element name="EnvelopeInformation"
        type="tns:EnvelopeInformationType" maxOccurs="1" minOccurs="1">
      </element>
    </sequence>
  </complexType>

  <complexType name="DepositNoticeType">
    <sequence>
      <element name="DigitalPostmark" type="tns:DigitalPostmarkType"
        maxOccurs="1" minOccurs="1">
      </element>
    </sequence>
  </complexType>

  <complexType name="TransitNoticeType">
    <sequence>
      <element name="DigitalPostmark" type="tns:DigitalPostmarkType"
        maxOccurs="1" minOccurs="1">
      </element>
    </sequence>
  </complexType>

  <complexType name="SignedTransitNoticeType">
    <sequence>
      <element name="DigitalPostmark" type="tns:DigitalPostmarkType"
        maxOccurs="1" minOccurs="1">
      </element>
      <element name="EnvelopeInformation"
        type="tns:EnvelopeInformationType" maxOccurs="1" minOccurs="1">
      </element>
    </sequence>
  </complexType>

  <complexType name="ReceiptNoticeType">
    <sequence>
      <element name="DigitalPostmark"
        type="tns:DigitalPostmarkType">
      </element>
      <element name="EnvelopeInformation"
        type="tns:EntityEnvelopeInformationType">
      </element>
    </sequence>
  </complexType>

  <complexType name="SignedReceiptNoticeType">
    <sequence>
      <element name="DigitalPostmark"
        type="tns:DigitalPostmarkType">
      </element>
      <element name="EnvelopeInformation"
        type="tns:EntityEnvelopeInformationType">
      </element>
    </sequence>
  </complexType>

  <complexType name="HashValueType">
    <attribute name="AlgorithmOID">
      <simpleType>
        <restriction base="string">
          <enumeration value="1.3.14.3.2.26"></enumeration>
          <enumeration value="2.16.840.1.101.3.4.2.1"></enumeration>
        </restriction>
      </simpleType>
    </attribute>
  </complexType>

  <complexType name="EntityEnvelopeInformationType">
    <sequence>
      <element name="BodyEnvelopeInformation" type="tns:ContentEnvelopeInformationType">
      </element>
      <element name="Entity" type="tns:EntityType"></element>
      <element name="EntityChallenge" type="tns:EntityChallengeType"></element>
    </sequence>
  </complexType>

  <complexType name="EntityChallengeType">
    <sequence>
      <element name="SecretQuestion" type="tns:SecretQuestionType"></element>
      <element name="Signature" type="ds:SignatureType"></element>
    </sequence>
  </complexType>

  <complexType name="RequestType">
    <attribute name="RandomNumber" type="string"></attribute>
  </complexType>

  <complexType name="ResponseType">
    <attribute name="AlgorithmIdentifier" type="string"></attribute>
  </complexType>

</schema>
