Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Readme
EMV / Chip and PIN library
var cardreader = require('card-reader');
var emvTags = require('../lib/emvTags');
var emvApplication = require('../lib/emvApplication');
cardreader.on('device-activated', function (reader) {
console.info(`Device '${reader.name}' activated`);
});
cardreader.on('device-deactivated', function (reader) {
console.info(`Device '${reader}' 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 = emvApplication(cardreader);
application
.selectPse()
.then(function (response) {
console.info(`Select PSE Response:\n${emvTags.format(response)}`);
var sfi = 1;
var record = 0;
while (record++ < 10) {
application.readRecord(sfi, record).then(function (response) {
if (response.isOk()) {
console.info(`Read Record Response: ${emvTags.format(response)}`);
var aid = emvTags.findTag(response, 0x4f);
if (aid) {
console.info(`Application ID: '${aid.toString('hex')}`);
}
}
return response;
}).catch(function (error) {
console.error('Read Record Error:', error, error.stack);
});
}
}).catch(function (error) {
console.error('Error:', error, error.stack);
});
});
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.
FAQs
EMV / Chip and PIN library
The npm package emv receives a total of 8 weekly downloads. As such, emv popularity was classified as not popular.
We found that emv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.