<?xml version="1.0" encoding="UTF-8"?>
<!--
  xmlsec-gh-schema.rnc
  
  xenc_EncryptionMethodOtherParams defined in xenc-schema.rnc
  is customized here.
  
  gh_KeyEncapsulationAlgorithms defines a list of algorithms, and 
  is used in xmlsec-gh-allowForeign.rnc.
-->
<grammar ns="http://www.w3.org/2009/xmlsec-gh#" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <define name="xenc_EncryptionMethodOtherParams" combine="choice">
    <attribute name="Algorithm">
      <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#generic-hybrid</value>
    </attribute>
    <ref name="dh_GenericHybridCipherMethod"/>
  </define>
  <define name="dh_GenericHybridCipherMethod">
    <element name="GenericHybridCipherMethod">
      <ref name="gh_GenericHybridCipherMethodType"/>
    </element>
  </define>
  <define name="gh_GenericHybridCipherMethodType">
    <element name="KeyEncapsulationMethod">
      <ref name="gh_KeyEncapsulationMethodType"/>
    </element>
    <element name="DataEncapsulationMethod">
      <ref name="xenc_EncryptionMethodType"/>
    </element>
  </define>
  <define name="gh_KeyEncapsulationMethodType">
    <ref name="xenc11_KeyDerivationMethod"/>
    <element name="KeyLen">
      <data type="positiveInteger"/>
    </element>
    <ref name="gh_KeyEncapsulationMethodParams"/>
  </define>
  <define name="gh_KeyEncapsulationMethodParams">
    <choice>
      <attribute name="Algorithm">
        <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#rsaes-kem</value>
      </attribute>
      <attribute name="Algorithm">
        <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#ecies-kem</value>
      </attribute>
    </choice>
  </define>
  <define name="gh_KeyEncapsulationAlgorithms">
    <choice>
      <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#rsaes-kem</value>
      <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#ecies-kem</value>
    </choice>
  </define>
</grammar>
