GithubHelp home page GithubHelp logo

wsct-core's Introduction

WSCT-Core

Public repository for WSCT Core project.

Developped by S.Vernois @ ENSICAEN / GREYC since 2006 with the help of some students for proof of concepts.

WSCT Core API documentation is available from this url: http://www.ecole.ensicaen.fr/~vernois/wsct/WSCT-Core/

Nuget packages

WSCT Core NuGet Badge

This is the main API of this project. It defines:

  • Raw APDU command and response
  • ISO7816-4 APDU
  • Smart card reader and card access API

Warning: this package alone doesn't give access to a concrete smart card reader. Use next package for that.

WSCT Wrapper for Desktop NuGet Badge

This package seamlessly wraps native PC/SC libraries.

Supported OS :

  • From Windows XP to Windows 10 using Microsoft .NET Framework 4.6.2 or Mono 3+
  • Linux 32 and 64 bits based OS using Mono 3+
  • Mac OSX using Mono 3+

Example code

// Connect to PC/SC
var context = new CardContext();
context.Establish();

// Get installed readers
context.ListReaders("");
var allReaders = context.Readers;

// Connect to an ISO7816-4 card in the last reader found
var rawChannel = new CardChannel(context, context.Readers.Last());
var channel = new CardChannelIso7816(rawChannel);
channel.Connect(ShareMode.Exclusive, Protocol.Any);

// Build a SELECT command
var capdu = new SelectCommand(
	SelectCommand.SelectionMode.SelectDFName,
	SelectCommand.FileOccurrence.FirstOrOnly,
	SelectCommand.FileControlInformation.ReturnFci, 
	"A0 00 00  01 51".FromHexa()
	);

// Send it in a CRP an get the response back
var crp = new CommandResponsePair(capdu);
crp.Transmit(channel);
var rapdu = crp.RApdu;

// Unpower the card
channel.Disconnect(Disposition.UnpowerCard);

// Disconnect from PC/SC
context.Release();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.