title: Use eID APDU codes with node pcsclite
body: <p>I need to access the eID information through node. For this I have found a package (<a href="https://github.com/santigimeno/node-pcsclite" rel="nofollow noreferrer">https://github.com/santigimeno/node-pcsclite</a>) to do this. The site has an example which seems to work (do something atleast.
  I have copied the following code :</p>
  
  <pre><code>#!/usr/bin/env node
  
  var pcsc = require('pcsclite');
  
  var pcsc = pcsc();
  pcsc.on('reader', function(reader) {    console.log('New reader detected', reader.name);
  
  reader.on('error', function(err) {
      console.log('Error(', this.name, '):', err.message);
  });
  
  reader.on('status', function(status) {
      console.log('Status(', this.name, '):', status);
      /* check what has changed */
      var changes = this.state ^ status.state;
      if (changes) {
          if ((changes &amp; this.SCARD_STATE_EMPTY) &amp;&amp; (status.state &amp; this.SCARD_STATE_EMPTY)) {
              console.log("card removed");/* card removed */
              reader.disconnect(reader.SCARD_LEAVE_CARD, function(err) {
                  if (err) {
                      console.log(err);
                  } else {
                      console.log('Disconnected');
                  }
              });
          } else if ((changes &amp; this.SCARD_STATE_PRESENT) &amp;&amp; (status.state &amp; this.SCARD_STATE_PRESENT)) {
              console.log("card inserted");/* card inserted */
              reader.connect({ share_mode : this.SCARD_SHARE_SHARED }, function(err, protocol) {
                  if (err) {
                      console.log(err);
                  } else {
                      console.log('Protocol(', reader.name, '):', protocol);
                      console.log('info : ' , reader)
                      reader.transmit(new Buffer([0x00, 0xB0, 0x00, 0x00, 0x20]), 40, protocol, function(err, data) {
                          if (err) {
                              console.log(err);
                          } else {
                              console.log('Data received', data);
                              reader.close();
                              pcsc.close(); 
                          }
                      });
                  }
              });
          }
      }
  });
  
  
  
  reader.on('end', function() {
          console.log('Reader',  this.name, 'removed');
      });
  });
  
      pcsc.on('error', function(err) {
          console.log('PCSC error', err.message);
      });
  </code></pre>
  
  <p>I then navigate to the directory and use node + "filename" and it gives me the following output :</p>
  
  <p><a href="https://i.stack.imgur.com/SDtD7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SDtD7.png" alt="output"></a></p>
  
  <p>As far as I can tell it is this part (the APDU code):</p>
  
  <pre><code> reader.transmit(new Buffer([0x00, 0xB0, 0x00, 0x00, 0x20])
  </code></pre>
  
  <p>that will give me a certain piece of information.</p>
  
  <p>I need some more documentation about all of this, specifically a list of APDU's that I can use; for example the APDU to read the eID picture.</p>
  
  <p>I've searched with every keyword I could think of so far, and haven't found anything useful. Really hope someone can point me in the right direction.</p>