<cards>
  <card name="egk" extends="ProcessorCard" type="processor" >
    <cardinfo>
      <name>eGK</name>
      <descr>
        Electronic health card
      </descr>
      <atrs>
       <atr>3b 9? ?? 81 b1 fe 45 1f *</atr>
      </atrs>
    </cardinfo>
    
    <commands>

    	<!-- Select DF by 16-bit-id -->
      <command name="SelectDFS" >
        <send>
	  			<APDU>
  	    		<ELEM type="dword">0x00a4000c</ELEM>
	  			</APDU>
	  			<DATA>
	    			<ELEM name="fileId" type="word" />
	  			</DATA>
				</send>
				<results>
      		<result sw1="0x6a" sw2="0x82" type="error">File not found</result>
				</results>
				<responses>
	  			<response type="success">
	    	 		<ELEM name="fileInfo" type="tlv" tlvtype="simple" minnum="0">
              <tlv id="0x6f">
                <ELEM name="fci" type="tlv" tlvtype="simple" 
                      maxnum="0">
                  <tlv id="0x81">
                    <ELEM name="space" type="word" />
                  </tlv>
                  <tlv id="0x82">
                    <ELEM name="fileDescr" type="bytes" />
                  </tlv>
                  <tlv id="0x83">
                    <ELEM name="shortFileId" type="word" />
                  </tlv>
                  <tlv id="0x84">
                    <ELEM name="fileName" type="bytes" />
                  </tlv>
                  <tlv id="0x85">
                    <ELEM name="sfi" type="byte" />
                    <ELEM name="filePath" type="bytes" />
                  </tlv>
                  <tlv id="0x86" name="AC" >
                    <ELEM name="AC_admin" type="word" />
                    <GROUP name="AC_cmd" minnum="0" maxnum="0" >
                      <ELEM name="cla" type="byte" />
                      <ELEM name="ins" type="byte" />
                      <ELEM name="ac" type="word" />
                    </GROUP>
                  </tlv>
                  <tlv id="0xa5">
                    <ELEM name="accessControl" type="tlv" tlvtype="simple"
                          maxnum="0">
                      <tlv id="0x86" name="AC" >
                        <ELEM name="sfi" type="byte" />
                        <ELEM name="AC_admin" type="word" />
                        <ELEM name="moreACs" type="bytes" minnum="0" />
                      </tlv>
                    </ELEM>
                  </tlv>
                </ELEM>
              </tlv>
            </ELEM>
	  			</response>
				</responses>
    	</command>

    	<!-- Select DF by application-id -->
      <command name="SelectDFL" >
        <send>
	  			<APDU>
  	    		<ELEM type="dword">0x00a4040c</ELEM>
	  			</APDU>
	  			<DATA>
	    			<ELEM name="fileId" type="bytes" />
	  			</DATA>
				</send>
				<results>
      		<result sw1="0x6a" sw2="0x82" type="error">File not found</result>
				</results>
				<responses>
	  			<response type="success">
	    	 		<ELEM name="fileInfo" type="tlv" tlvtype="simple" minnum="0">
              <tlv id="0x6f">
                <ELEM name="fci" type="tlv" tlvtype="simple" 
                      maxnum="0">
                  <tlv id="0x81">
                    <ELEM name="space" type="word" />
                  </tlv>
                  <tlv id="0x82">
                    <ELEM name="fileDescr" type="bytes" />
                  </tlv>
                  <tlv id="0x83">
                    <ELEM name="shortFileId" type="word" />
                  </tlv>
                  <tlv id="0x84">
                    <ELEM name="fileName" type="bytes" />
                  </tlv>
                  <tlv id="0x85">
                    <ELEM name="sfi" type="byte" />
                    <ELEM name="filePath" type="bytes" />
                  </tlv>
                  <tlv id="0x86" name="accessControl" >
                    <ELEM name="AC_admin" type="word" />
                    <GROUP name="AC_cmd" minnum="0" maxnum="0" >
                      <ELEM name="cla" type="byte" />
                      <ELEM name="ins" type="byte" />
                      <ELEM name="ac" type="word" />
                    </GROUP>
                  </tlv>
                  <tlv id="0xa5">
                    <ELEM name="accessControl" type="tlv" tlvtype="simple"
                          maxnum="0">
                      <tlv id="0x86" name="AC" >
                        <ELEM name="sfi" type="byte" />
                        <ELEM name="AC_admin" type="word" />
                        <ELEM name="moreACs" type="bytes" minnum="0" />
                      </tlv>
                    </ELEM>
                  </tlv>
                </ELEM>
              </tlv>
            </ELEM>
	  			</response>
				</responses>
    	</command>

      <!-- Select EF by id -->
      <command name="SelectEFS" >
        <send>
	  			<APDU>
  	    		<ELEM type="dword">0x00a4020c</ELEM>
	  			</APDU>
	  			<DATA>
	    			<ELEM name="fileId" type="word" />
	  			</DATA>
				</send>
				<results>
      		<result sw1="0x6a" sw2="0x82" type="error">File not found</result>
				</results>
				<responses>
	  			<response type="success">
	    	 		<ELEM name="fileInfo" type="tlv" tlvtype="simple" minnum="0">
              <tlv id="0x6f">
                <ELEM name="fci" type="tlv" tlvtype="simple" 
                      maxnum="0">
                  <tlv id="0x81">
                    <ELEM name="space" type="word" />
                  </tlv>
                  <tlv id="0x82">
                    <ELEM name="fileDescr" type="bytes" />
                  </tlv>
                  <tlv id="0x83">
                    <ELEM name="shortFileId" type="word" />
                  </tlv>
                  <tlv id="0x84">
                    <ELEM name="fileName" type="bytes" />
                  </tlv>
                  <tlv id="0x86" name="accesControl" >
                    <ELEM name="AC_admin" type="word" />
                    <ELEM name="AC_readRecord" type="word" />
                    <ELEM name="AC_writeRecord" type="word" />
                    <ELEM name="moreACs" type="bytes" minnum="0" />
                  </tlv>
                </ELEM>
              </tlv>
            </ELEM>
	  			</response>
				</responses>
    	</command>

      <command name="SelectMF" >
        <send>
          <APDU>
            <ELEM type="dword">0x00a4000c</ELEM>
          </APDU>
          <DATA>
            <ELEM type="word">0x3f00</ELEM>
          </DATA>
        </send>
        <results>
          <result sw1="0x6a" sw2="0x82" type="error">File not found</result>
        </results>
        <responses>
          <response type="success">
            <ELEM name="fileInfo" type="tlv" tlvtype="simple" minnum="0">
              <tlv id="0x6f">
                <ELEM name="fci" type="tlv" tlvtype="simple"
                      maxnum="0">
                  <tlv id="0x81">
                    <ELEM name="space" type="word" />
                  </tlv>
                  <tlv id="0x82">
                    <ELEM name="fileDescr" type="bytes" />
                  </tlv>
                  <tlv id="0x83">
                    <ELEM name="shortFileId" type="word" />
                  </tlv>
                  <tlv id="0x84">
                    <ELEM name="fileName" type="bytes" />
                  </tlv>
                  <tlv id="0x85">
                    <ELEM name="sfi" type="byte" />
                    <ELEM name="filePath" type="bytes" />
                  </tlv>
                  <tlv id="0x86" name="AC" >
                    <ELEM name="AC_admin" type="word" />
                    <GROUP name="AC_cmd" minnum="0" maxnum="0" >
                      <ELEM name="cla" type="byte" />
                      <ELEM name="ins" type="byte" />
                      <ELEM name="ac" type="word" />
                    </GROUP>
                  </tlv>
                  <tlv id="0xa5">
                    <ELEM name="accessControl" type="tlv" tlvtype="simple"
                          maxnum="0">
                      <tlv id="0x86" name="AC" >
                        <ELEM name="sfi" type="byte" />
                        <ELEM name="AC_admin" type="word" />
                        <ELEM name="moreACs" type="bytes" minnum="0" />
                      </tlv>
                    </ELEM>
                  </tlv>
                </ELEM>
              </tlv>
            </ELEM>
          </response>
          
        </responses>
      </command>

      <!-- no special commands for this card -->
      
    </commands>
    
    <!-- generic command responses -->
    <results>
    </results>

  </card>
</cards>

