smartcard | PCSC smartcard reader library for nodejs | Runtime Evironment library

 by   tomkp JavaScript Version: v1.0.19 License: MIT

kandi X-RAY | smartcard Summary

kandi X-RAY | smartcard Summary

smartcard is a JavaScript library typically used in Server, Runtime Evironment, Nodejs applications. smartcard has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i smartcard2' or download it from GitHub, npm.

PCSC smartcard reader library for nodejs
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              smartcard has a low active ecosystem.
              It has 97 star(s) with 38 fork(s). There are 7 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 3 have been closed. On average issues are closed in 0 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of smartcard is v1.0.19

            kandi-Quality Quality

              smartcard has 0 bugs and 0 code smells.

            kandi-Security Security

              smartcard has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              smartcard code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              smartcard is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              smartcard releases are available to install and integrate.
              Deployable package is available in npm.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of smartcard
            Get all kandi verified functions for this library.

            smartcard Key Features

            No Key Features are available at this moment for smartcard.

            smartcard Examples and Code Snippets

            No Code Snippets are available at this moment for smartcard.

            Community Discussions

            QUESTION

            Translating GlobalPlatform from C to Delphi - Access violation errors
            Asked 2022-Apr-07 at 22:32

            I want to use the GlobalPlatform.dll from kaoh Karsten Ohme in Delphi. So i tried to translate the headers so i can use the GlobalPlatform.dll in Delphi.

            The first i translated was Connection.h, i uploaded it on pastebin here.
            The second i translated was Security.h i uploaded it on pastebin here.

            First i establish a context with the OPGP_establish_context function, that seems to go alright because the result is a OPGP_ERROR_STATUS_SUCCESS and the message also states "success".

            But then i try to list the readers with the OPGP_list_readers function, which also returns a success - but when i try to read the returned names i get various access violations (mostly at adress 00000000 and trying to read 00000000, but there are variations between my tries).

            My code is assigned to a button click:

            ...

            ANSWER

            Answered 2022-Apr-07 at 22:32

            In the 1st record you translated, OPGP_ERROR_STATUS, the errorMessage field is declared in the C code as:

            Source https://stackoverflow.com/questions/71788620

            QUESTION

            ICC not activated
            Asked 2022-Apr-02 at 15:13

            I am currently trying to hack my way into Smart Cards but I am now stuck at reading anything useful from the Card. I am trying to send a SELECT FILE Command (0x6F, 0xB, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x04, 0x0c, 0x06, 0xd2, 0x76, 0x00, 0x00, 0x01, 0x02) to my Card (after PC_to_RDR_IccPowerOn, which returns the correct ATR) with the PC_to_RDR_XfrBlock Command.

            But my response has the bmICCStatus Flag set to 0x40 which indicates the "ICC is present and inactive (not activated or shut down by hardware error)" but I am not quite sure what to do with that information. How am I supposed to activate the Card? I thought powering it was all there was to it.

            It is very much possible that I am just blind and it is written in the Specification but I was not able to find it and my Google Searches lead me to exactly 1 SO Question, which didn't really corrolate with my problem.

            I am using libusb 1.0 and C, but I don't think that this is relevant to the question.

            Edit:

            I've added an code example, but you have to select your device for yourself, if you want to run it.

            ...

            ANSWER

            Answered 2022-Apr-02 at 15:13

            According to the ATR your card is T=1 only https://smartcard-atr.apdu.fr/parse?ATR=3BD396FF81B1FE451F078081052D

            I don't know the reader you use. If the reader works in TPDU and not APDU it is more complex than just sending the APDU. You have to implement T=1 in your code.

            I guess the missing CCID command is PC_to_RDR_SetParameters to configure the reader with the correct parameters.

            I would really suggest to use already existing software. Like my CCID driver https://ccid.apdu.fr/ for Unix.

            Source https://stackoverflow.com/questions/70558359

            QUESTION

            Why Smart Card answers 6982 to EXTERNAL AUTHENTICATE while all calculations are correct?
            Asked 2022-Mar-12 at 05:05

            I am trying to establish a secure channel SCP02 with a smart card using python. My smartcard is connected to the terminal using a serial port and I use pySerial to send APDUs.

            I send commands SELECT ISD, INITIALIZE UPDATE correctly, and next I try to do EXTERNAL AUTHENTICATE as the python code below:

            ...

            ANSWER

            Answered 2022-Jan-10 at 10:45

            You can use the working Test Vectors from the GlobalPlatform library and test if your executed crypto logic is really working. It could also be that your card is using some key derivation scheme, i.e. the keys you are using cannot be used directly.

            Source https://stackoverflow.com/questions/70649512

            QUESTION

            LOAD fails for Method component in USIM card via OTA SMS-DELIVER
            Asked 2022-Feb-07 at 01:35

            I need to load a simple applet to my USIM card. Authentication is OK. I'm using OTA SMS-DELIVER via SmartCard to install CAP file.

            Using these:

            I couldnt find the right spec explaining "C482XXYY" in Header.cap, how it should be calculated,

            this answer below helped me navigate, but for Method.cap loading - it still fails https://community.oracle.com/tech/developers/discussion/1753814/globalpaltform-load-command-data-field

            I've written this loader: https://pastebin.com/pSXeDYyS

            Every component in CAP file is in separate APDU with LOAD instruction. First 5 is loaded successfully with DATA=00, SW=9000, however on Method it fails. As you can see from my script, I've fixed Descriptor size to 0000 in Directory field. And in Header C482xxyy, where xxyy is calculated properly, which is a sum of all size fields in Directory, e.g.

            ...

            ANSWER

            Answered 2022-Feb-07 at 01:35

            You can have a look into the GlobalPlatform project loader. It is LPGL, so directly using it as C code in other non LGPL projects is not possible.

            [!!!!] LOAD - Method (FAILED)

            80e800057007006d000911188c00048d00012c18197b0002037b00029210240303038b000388007a02318f00053d8c00062e1b8b00077a0120188b000860037a7a02228d00092d1d10076b101a8b000a321fae006b06188c000b7a06118d000c2c1903077b000d037b000d928b000e198b000f3b7a00c0000000

            << 9000 (should be 009000)

            I assume that the log is the unwrapped logged before the commands are prepared for SCP80. A response of 9000 in OTA means usually "I received the command, but I don't know what to do with it". Is this 9000 command from the ENVELOPE response on the card? Are you sending the data over an SMPP connection?

            Can you try your loading code with a simple HelloWorld Applet without any STK? It could be that your card is not supporting a version you are linking against, e.g. different ETSI releases. Then some method might not be supported and the loading fails.

            Source https://stackoverflow.com/questions/70993587

            QUESTION

            bash script to sort the return strings of a function
            Asked 2022-Jan-08 at 18:12

            I started a script that run on a linux satellite receiver and run the 'dvbsnoop' tool. I need help to finish the script because i do not know hot to handle the results from the 'dvbsnoop' tool.

            ...

            ANSWER

            Answered 2022-Jan-08 at 18:12

            This might be what you want:

            Source https://stackoverflow.com/questions/70634482

            QUESTION

            How to access Pinpad of a Smartcard Reader when developing a Javacard Applet
            Asked 2021-Nov-12 at 10:47

            I am relatively new to Javacard and I am in the process of developing my own Javacard Applet which works quite well until now. I am also writing a host program to communicate with my card (via APDUs), this program is written in Java and uses the javax.smartcardio library as well as apdu4j.

            My goal now is to use my reader's integrated Pinpad to ask the user for a PIN and then forward the entered PIN to the Smartcard which will verify the PIN. I already wrote the code on the card which will verify the PIN (CLA: 0x80, INS: 0x04, P1: 0x00, P2: 0x00, pin data), but I have no idea how to tell the Reader to probe for a PIN and then forward this information to the Card.

            My Card is a J3H145 by NXP (Javacard 3.0.4 / ISO7816 / ISO14443) and my Reader is a ReinerSCT cyberJack RFID standard.

            Thank you in advance.

            ...

            ANSWER

            Answered 2021-Nov-12 at 10:47

            If anyone is wondering, I found out how to do it.

            Source https://stackoverflow.com/questions/69659941

            QUESTION

            How to change the com-interface depended on the configuration in C#?
            Asked 2021-Nov-09 at 16:49

            I got a com-interface in c# which looks like this:

            ...

            ANSWER

            Answered 2021-Nov-09 at 16:49

            In C# some limited preprocessor support exists as well. Instead of #ifdef you have to use #if though.

            So that would be

            Source https://stackoverflow.com/questions/69900129

            QUESTION

            Delphi byte array leading zeroes (?empty? spaces in array)
            Asked 2021-Oct-06 at 20:03

            I'm trying to add 00 for each byte array element that is missing, to explain it better, if lenght of an array is 20 and the string fills only 9 spaces (reversed), I need the rest 11 spaces to be 00. An example will explain it better.

            This is my code so far:

            ...

            ANSWER

            Answered 2021-Oct-06 at 20:03

            The actual tax payer Id seems to be 9 characters: '021131682'. For a total length of 20 bytes you need 11 null bytes first in the ArrTaxPayerId array. So, with BufferSize=20, StrTaxPayerId='021131682' you can set the initial length of ArrTaxPayerId:

            Source https://stackoverflow.com/questions/69466553

            QUESTION

            Web Browser Certificate Enrollment (CSR Generation) and Certificate Download to Smartcard or USB Token
            Asked 2021-Aug-19 at 07:55

            I am developing Web Application for Certifying Authority as a part of which, I need to

            1. Generate asymmetric key pair - Private Key and Public Key in user's smartcard through browser,
            2. create Certificate Signing Request (CSR) and send CSR to Certifying Authority server where user's certificate gets generated.
            3. Then CA Server will send user's certificate to browser which needs to be downloaded to user's SmartCard or USB Token through browser.

            How to achieve the same using JavaScript that works in Modern Browsers? Using ActiveX and JavaApplets are not the options.

            ...

            ANSWER

            Answered 2021-Aug-19 at 07:55

            Disclosure: I work for CISPL, Co. which develops Signer.Digital Browser Extension

            Browser Extension may be used to Enroll Certificate (Generate CSR) and Download Certificate in Windows Certificate Store or Smartcard or USB Token from modern browsers. Browser extension provides JavaScript API which in turn talks to host application running on local machine to do the required operations in smartcard and returns response to JavaScript (or says users web page).

            CSR generated using Browser Javascript API genCSR may be posted to CA Server for certificate generation or to your server if you want self signed certificate. Certificate and Trust Certificate chain received back from the server may be passed to ImportCer to import in the certificate store, smartcard or usb token.

            API Available for Certifying Authorities in Signer.Digital Browser Extension are:

            1. Detect connected smartcard: (Autodetect connected Smartcard or USB Token)

            SignerDigital.getPCSCReaders(onlyConnected = true) //List PCSC Readers, set paramater to false if you want to list all available readers

            Example:

            Source https://stackoverflow.com/questions/68556285

            QUESTION

            Execute a PowerShell script within RunAs in a script
            Asked 2021-Aug-07 at 14:23

            I have a need to run a PowerShell script as another user (the users will actually be doing the auth) based on detected environment. The script leverages a smartcard for login. The problem I have is when the PowerShell.exe instance launches from the runas, it simply prints my command and doesn't actually run it.

            Note: The filepaths have spaces that get escaped with double-`, just not shown here hence the escaped ``' in the actual command. Have also used ```".

            Example:

            ...

            ANSWER

            Answered 2021-Aug-07 at 11:08

            There's generally no reason to use Start-Process to run a console application such as runas.exe - unless you explicitly want the application to run in a new window, asynchronously (by default) - see this answer for more information.

            Eliminating Start-Process simplifies the quoting:

            Source https://stackoverflow.com/questions/68688768

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install smartcard

            You can install using 'npm i smartcard2' or download it from GitHub, npm.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/tomkp/smartcard.git

          • CLI

            gh repo clone tomkp/smartcard

          • sshUrl

            git@github.com:tomkp/smartcard.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link