title: Could not delete applet
body: <p>I create a <em>.cap</em> file of the code that is <a href="http://wrankl.de/Javacard/TANGenJava.txt" rel="nofollow noreferrer">here</a>.
  It is a simple one-time-passwort generator.</p>
  <p>finally I set <code>010203040506070809</code> as <em>package ID</em> and <code>0102030405060708090000</code> as <em>applet AID</em>, and upload it to my card.</p>
  <p>This is output of <strong>GPJ</strong> when I list applets :</p>
  <pre><code>C:\Users\ghasemi\Desktop\gpj-20120310&gt;gpj -list
  
  C:\Users\ghasemi\Desktop\gpj-20120310&gt;java -jar gpj.jar -list
  Found terminals: [PC/SC terminal ACS CCID USB Reader 0]
  Found card in terminal: ACS CCID USB Reader 0
  ATR: 3B 68 00 00 00 73 C8 40 12 00 90 00
  DEBUG: Command  APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00
  DEBUG: Response APDU: 6A 82
  Failed to select Security Domain GP211 A0 00 00 01 51 00 00 , SW: 6A 82
  DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00
  DEBUG: Response APDU: 6A 82
  Failed to select Security Domain GemaltoXpressPro A0 00 00 00 18 43 4D 00 , SW:
  6A 82
  DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
  DEBUG: Response APDU: 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 0
  0
  Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
  DEBUG: Command  APDU: 80 50 00 00 08 B5 16 68 A9 92 84 7D 58
  DEBUG: Response APDU: 00 00 11 60 01 00 8A 79 0A F9 FF 02 00 5B 6B 9E 48 44 A2 D
  B 8A 52 C1 87 99 FC 26 72 90 00
  DEBUG: Command  APDU: 84 82 00 00 10 EE 5D DB 8D 26 DA C6 B9 51 85 E1 33 A2 CE 2
  4 AD
  DEBUG: Response APDU: 90 00
  DEBUG: Command  APDU: 84 82 00 00 08 EE 5D DB 8D 26 DA C6 B9
  DEBUG: Response APDU: 90 00
  DEBUG: Command  APDU: 80 F2 80 00 02 4F 00
  DEBUG: Response APDU: 08 A0 00 00 00 03 00 00 00 01 9E 90 00
  DEBUG: Command  APDU: 80 F2 80 00 02 4F 00
  DEBUG: Response APDU: 08 A0 00 00 00 03 00 00 00 01 9E 90 00
  DEBUG: Command  APDU: 80 F2 40 00 02 4F 00
  DEBUG: Response APDU: 0B 01 02 03 04 05 06 07 08 09 00 00 07 00 90 00
  DEBUG: Command  APDU: 80 F2 40 00 02 4F 00
  DEBUG: Response APDU: 0B 01 02 03 04 05 06 07 08 09 00 00 07 00 90 00
  DEBUG: Command  APDU: 80 F2 10 00 02 4F 00
  DEBUG: Response APDU: 6A 81
  DEBUG: Command  APDU: 80 F2 10 00 02 4F 00
  DEBUG: Response APDU: 6A 81
  DEBUG: Command  APDU: 80 F2 20 00 02 4F 00
  DEBUG: Response APDU: 0A 01 02 03 04 05 06 07 08 09 00 01 00 90 00
  DEBUG: Command  APDU: 80 F2 20 00 02 4F 00
  DEBUG: Response APDU: 0A 01 02 03 04 05 06 07 08 09 00 01 00 90 00
  AID: A0 00 00 00 03 00 00 00                       |........|        ISD LC: 1 P
  R: 0x9E
  
  AID: 01 02 03 04 05 06 07 08 09 00 00              |...........|     App LC: 7 P
  R: 0x00
  
  AID: 01 02 03 04 05 06 07 08 09 00                 |..........|      Exe LC: 1 P
  R: 0x00
  
  C:\Users\ghasemi\Desktop\gpj-20120310&gt;
  </code></pre>
  <p>As you see, my applets uploaded successfully.</p>
  <hr />
  <p>After uploading I send some APDU to my applet :</p>
  <pre><code>&lt; 00 A4 04 00 0B 00
  &lt; 01 02 03 04 05 06 07 08 09 00 00
  &gt; 9000
  
  &lt; 00 20 00 02 03 00
  &lt; 22 22 22
  &gt; 9000
  
  &lt; 00 20 00 02 03 00
  &lt; 11 11 23
  &gt; 6C02
  
  &lt; 00 20 00 02 03 00
  &lt; 11 11 23
  &gt; 6C01
  
  &lt; 00 20 00 02 03 00
  &lt; 11 11 23
  &gt; 6C00
  
  &lt; 00 20 00 02 03 00
  &lt; 11 11 23
  &gt; 6D00
  </code></pre>
  <p>As you see above, I select my applet, send verify command to it (one time with correct PIN and three time with wrong pin). and make it lock.</p>
  <hr />
  <p>Now I want to delete the applet :</p>
  <pre><code>C:\Users\ghasemi\Desktop\gpj-20120310&gt;java -jar gpj.jar -delete 0102030405060708
  090000 -deletedeps
  Found terminals: [PC/SC terminal ACS CCID USB Reader 0]
  Found card in terminal: ACS CCID USB Reader 0
  ATR: 3B 68 00 00 00 73 C8 40 12 00 90 00
  DEBUG: Command  APDU: 00 A4 04 00 07 A0 00 00 01 51 00 00
  DEBUG: Response APDU: 6A 82
  Failed to select Security Domain GP211 A0 00 00 01 51 00 00 , SW: 6A 82
  DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 18 43 4D 00
  DEBUG: Response APDU: 6A 82
  Failed to select Security Domain GemaltoXpressPro A0 00 00 00 18 43 4D 00 , SW:
  6A 82
  DEBUG: Command  APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
  DEBUG: Response APDU: 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 0
  0
  Successfully selected Security Domain OP201a A0 00 00 00 03 00 00 00
  DEBUG: Command  APDU: 80 50 00 00 08 5E 64 FF F5 A9 52 96 4D
  DEBUG: Response APDU: 00 00 11 60 01 00 8A 79 0A F9 FF 02 00 5A 29 D0 38 18 61 9
  9 BA 72 91 2D 89 12 55 0E 90 00
  DEBUG: Command  APDU: 84 82 00 00 10 20 3E 1D 85 1C 36 2B B8 EA DC 25 E9 9F 78 8
  D 2D
  DEBUG: Response APDU: 90 00
  DEBUG: Command  APDU: 84 82 00 00 08 20 3E 1D 85 1C 36 2B B8
  DEBUG: Response APDU: 90 00
  DEBUG: Command  APDU: 80 E4 00 80 0D 4F 0B 01 02 03 04 05 06 07 08 09 00 00
  DEBUG: Response APDU: 6A 86
  DEBUG: Command  APDU: 80 E4 00 80 0D 4F 0B 01 02 03 04 05 06 07 08 09 00 00
  DEBUG: Response APDU: 6A 86
  Could not delete AID: 01 02 03 04 05 06 07 08 09 00 00
  
  C:\Users\ghasemi\Desktop\gpj-20120310&gt;
  </code></pre>
  <p><strong>Q1 : Did I blocked the card or just blocked my applet?</strong></p>
  <p><strong>Q2 : Why I can't delete it and what shall I do?</strong></p>