# iso7816

Latest version **1.0.20** (published 2016-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install iso7816
pnpm add iso7816
yarn add iso7816
bun add iso7816
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.20 |
| Published | 2016-03-25 |
| First published | 2016-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | tomkp |
| Maintainers | tomkp |
| Keywords | pcsc, smartcard, smart-card, iso7816, iso-7816, chip-and-pin, emv, es6 |

## Links

- npm: https://www.npmjs.com/package/iso7816
- Repository: https://github.com/tomkp/iso7816
- Issues: https://github.com/tomkp/iso7816/issues
- npm.io page: https://npm.io/package/iso7816

## Dependencies (3)

- [apdu](https://npm.io/package/apdu.md) ^0.0.3
- [hexify](https://npm.io/package/hexify.md) ^1.0.1
- [card-reader](https://npm.io/package/card-reader.md) ^1.0.3

## Recent versions

- 1.0.20 (latest) — 2016-03-25
- 1.0.19 — 2016-03-25
- 1.0.18 — 2016-03-25
- 1.0.17 — 2016-03-25
- 1.0.16 — 2016-03-24
- 1.0.15 — 2016-03-24
- 1.0.14 — 2016-03-20
- 1.0.13 — 2016-03-20
- 1.0.12 — 2016-03-20
- 1.0.11 — 2016-03-19
- 1.0.10 — 2016-03-19
- 1.0.8 — 2016-03-19
- 1.0.7 — 2016-03-19
- 1.0.6 — 2016-03-18
- 1.0.5 — 2016-03-09
- … 4 more at https://npm.io/package/iso7816/versions

## README

# Smartcard API


## Examples

```javascript
var cardreader = require('card-reader');
var iso7816 = require('iso7816');

cardreader.on('device-activated', function (reader) {
    console.info(`Device '${reader.name}' activated`);
});

cardreader.on('device-deactivated', function (reader) {
    console.info(`Device '${reader.name}' deactivated`);
});

cardreader.on('card-removed', function (reader) {
    console.info(`Card removed from '${reader.name}' `);
});

cardreader.on('command-issued', function (reader, command) {
    console.info(`Command '${command.toString('hex')}' issued to '${reader.name}' `);
});

cardreader.on('response-received', function (reader, response) {
    console.info(`Response '${response}' received from '${reader.name}' `);
});


cardreader.on('card-inserted', function (reader, status) {

    console.info(`Card inserted into '${reader.name}', atr: '${status.atr.toString('hex')}'`);

    var application = iso7816(cardreader);
    application
        .selectFile([0x31, 0x50, 0x41, 0x59, 0x2E, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31])
        .then(function (response) {
            console.info(`Select PSE Response: '${response}'`);
        }).catch(function (error) {
        console.error('Error:', error, error.stack);
    });

});


```


## Compatible Readers

Tested on Mac OSX with the SCM SCR3500 Smart Card Reader. 
This library *should* work with most PC/SC readers - I'll update this page when I get to test others.
If you know of any other devices that work please let me know.
 

<div align="center">
   <img src="docs/scr3500-collapsed.JPG" width=600 style="margin:1rem;" />
</div>

<div align="center">
   <img src="docs/scr3500-expanded.JPG" width=600 style="margin:1rem;" />
</div>

---
_Source: https://npm.io/package/iso7816 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
