title: APDU: "Conditions of use not satisfied" (69 85) while calculate signature
body: <p>With a smart card Gemalto (IAS ECC), I would to calculate a signature by using private key stored on smart card. For this, I use APDU commands:</p>
  
  <pre><code>// Verify PIN
  00 20 00 01 04 31 32 33 34
  -&gt; 90 00
  
  // Create a context for security operation
  00 22 41 B6 06 84 01 84 80 01 12
  -&gt; 90 00
  
  // Set the hash of the document
  00 2A 90 A0 14 HASH OF DOCUMENT
  -&gt; 69 85
  
  // Calculating the signature
  00 2A 9E 9A 80
  -&gt; 69 85
  </code></pre>
  
  <p>My problem is the following: the las two commands return the error code "69 85", meaning "Conditions of use not satisfied".</p>
  
  <p>I have already tried several solutions, but I obtain always the same error. How to resolve it? What does this code can mean?</p>
  
  <p>After some tests, I discovered something interesting. When I replace cla "00" by "10", smart card returns a different response:</p>
  
  <pre><code>// Create a context for security operation
  00 22 41 B6 06 84 01 84 80 01 12
  
  // Verify PIN
  00 20 00 01 04 31 32 33 34
  
  // Calculating the signature (I replace "00" by "10")
  10 2A 9E 9A 23 30 21 30 09 06 05 2B 0E 03 02 1A 05 00 04 14 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 12 13 14 15
  </code></pre>
  
  <p>I don't know if it's the good solution because smart card returns "90 00". But, it would return the content of my signature!</p>
  
  <p>Thank you for your help!</p>
  
  <p>Best regards</p>