<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://www.mulesource.org/schema/mule/pgp/2.0"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.0"
            targetNamespace="http://www.mulesource.org/schema/mule/pgp/2.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.0" 
                schemaLocation="http://www.mulesource.org/schema/mule/core/2.0/mule.xsd" />

    <xsd:element name="security-manager" type="securityManagerType" substitutionGroup="mule:abstract-security-manager"/>

    <xsd:complexType name="securityManagerType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractSecurityManagerType">
                <xsd:sequence>
                    <xsd:element ref="security-provider"/>
                    <xsd:element ref="keybased-encryption-strategy"/>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <!-- pgp provider -->
    <xsd:element name="security-provider" type="pgpSecurityProviderType">
        <xsd:annotation>
            <xsd:documentation>
                A security manager for PGP related functionality.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="pgpSecurityProviderType">
        <xsd:complexContent>
            <xsd:extension base="mule:securityProviderType">
                <xsd:attribute name="keyManager-ref" type="xsd:NMTOKEN" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    
    <!-- key based encryption strategy -->
    <xsd:element name="keybased-encryption-strategy" type="keyBasedEncryptionStrategyType">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>
	
    <xsd:complexType name="keyBasedEncryptionStrategyType">
        <xsd:complexContent>
            <xsd:extension base="mule:encryptionStrategyType">
                <xsd:attribute name="keyManager-ref" type="xsd:NMTOKEN" use="required"/>
                <xsd:attribute name="credentialsAccessor-ref" type="xsd:NMTOKEN"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
    
    <xsd:element name="security-filter" type="pgpSecurityFilterType" substitutionGroup="mule:abstract-security-filter">
        <xsd:annotation>
            <xsd:documentation>
                TODO
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="pgpSecurityFilterType">
        <xsd:complexContent>
            <xsd:extension base="mule:abstractSecurityFilterType">
                <xsd:attribute name="strategyName" type="xsd:string" use="required"/>
                <xsd:attribute name="signRequired" type="xsd:string" use="required"/>
                <xsd:attribute name="keyManager-ref" type="xsd:NMTOKEN" use="required"/>
                <xsd:attribute name="credentialsAccessor-ref" type="xsd:NMTOKEN" use="required"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

</xsd:schema>
