.NET
  Home arrow .NET arrow Smart Cards in .NET
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Smart Cards in .NET
By: Digvijay Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 102
    2004-03-15

    Table of Contents:
  • Smart Cards in .NET
  • The Solution
  • Three More Methods
  • A New Reference
  • The Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Smart Cards in .NET


    (Page 1 of 5 )

    I’ll begin with an introduction to the smart card standards and especially the PC/SC specification, which I believe is the most widely accepted platform for developing and deploying Smart Card Applications and will move on to the problems encountered while accessing smart cards from the .NET environment. Concluding the article I’ll present the solution, which I adopted to resolve the problem and I hope that will help you with writing Smart Card Enabled applications in .NET.


    Smart Cards have been around for many years now with the SUN® initiative of JavaCard™ technology to develop Smart Card solutions. They have created  a lot of buzz in the IT world, especially the IT-enabled services sector. In this article we’ll be reading about the problems encountered while developing Smart Card enabled applications in .NET and then will see a solution for the same.
    This solution may not be the best, but that it works just great for me! We’ll develop a pure, managed Smart Card Class library in future articles of this series.

    Background:
    Recently I needed to use a Smart Card reader from a C# application and I thought there would be support for it in some namespace in the FCL. But to my surprise there is no support for Smart Card access.
     I tried to find some third party class libraries or Components which I could use but I ended up with some Delphi Components and a few articles explaining how to access WinSCard.dll Functions in C#. I tried that option but was unable to make the CLR work with the types, which vary in the native Win32 and the .NET environment. I couldn’t find anything that would satisfy all my requirements.

    So I had two options to accomplish the task.

    • To use P/Invoke and access the WinSCard.dll raw API, and
    • To use the System.Runtime.InteropServices namespace which provides a collection of classes useful for accessing COM objects, and native APIs from .NET.

    I tried the first option and realized that there would be a lot of trouble in this hit and miss method of identifying correct prototypes for the WinSCard.dll exported functions. So I was left with just one option: Writing a COM component for Smart Card access and later use the InteropServices to use it in .NET.  It worked!

    More .NET Articles
    More By Digvijay Chauhan


     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek