<?xml version="1.0" encoding="UTF-8"?>
<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="gh_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="xenc_EncryptionMethodOtherParams" combine="choice">
    <attribute name="Algorithm">
      <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#generic-hybrid</value>
    </attribute>
    <ref name="gh_GenericHybridCipherMethod"/>
  </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>
  <define name="xenc_EncryptionAlgorithms" combine="choice">
    <value type="anyURI">http://www.w3.org/2009/xmlsec-gh#generic-hybrid</value>
  </define>
</grammar>
