Subsembly: the Smart Solution for Smart Cards in .NET

Smart Cards, already popular in Europe, are gaining popularity in the US for personal identification and authentication. Enabling Smart Card access in your applications allows you to provide an additional layer of security. In this article, Divijay Chauhan discusses how to enable Smart Card applications in .NET using Subsembly to make the job a lot easier.

Contributed by
Rating: 5 stars5 stars5 stars5 stars5 stars / 19
November 24, 2004
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

Smart Cards have gained popularity in a lot of diverse areas such as personal identification, authentication and e-banking. Europeans have used them for a long time now but now Smart Cards are catching up in the United States. The reason is simple: they provide a secure medium to store and access small amounts of critical information such as certificates and private keys.

I first saw them in use in an office of TATA Consultancy Services,  where those responsible for developing some code for Microsoft were asked to use these small, credit-card-like cards for logging onto Windows 2000/XP and to remote servers located in Redmond. I was curious and I've learned a lot about them since then.

By providing support for Smart Cards on desktop machines, Microsoft has provided developers with a lot of power that they can use to Smart Card enable the solutions they evolve. For instance, they can use Smart Cards to provide a secure login to some enterprise applications or to the desktop itself.

In this article we’re going to review Smart Cards on Windows in general and the .NET way of developing Smart Card enabled applications in particular. Along the way I shall also introduce the Smart Card Subsembly and discuss its role in helping developers to design their solutions.

What is the problem?

With the release of .NET technology, Microsoft introduced a framework for designing, developing and deploying scalable, robust, quality solutions. Not to mention the introduction of new languages like C# and J#, designed to enhance developer productivity by patching up the loopholes that were present in other languages. C# and J# had inherited these loopholes from their procedural style of programming.

I’m not sure about much, but I'm very sure about the future of application development on the Windows platform. By providing efficient tools such as VS .NET, a huge code base in terms of examples, and  vast online help for the .NET platform (in addition to the new languages that target the .NET CLR), Microsoft has ensured that the technology is here to stay--even if it breaks the Win32 development style.

Although the .NET framework provides a rich set of classes like the Windows forms that make GUI programming a breeze, it doesn’t offer any support for Smart Card application development. The developers who intend to include Smart Card access or support in their applications generally resort to creating their own custom Interop wrappers on the COM components or P/Invoke wrappers to access the PC/SC 1.0 Compliant native WinSCard API that is available through the Smart Card Base Components. It is really a tedious job to get it right while delivering solutions with Smart Card access is just a small part of a larger project. Most developers would like to spend most of the time on the main application that needs this access rather than trying different P/Invoke prototypes. If you’ve tried it, you understand what I’m trying to explain.

What is Subsembly?

Subsembly is probably the first .NET class library, or rather a full fledged framework that can be used for easy access to Smart Card Readers and Smart Cards from the .NET applications that you develop. Using Subsembly not only allows you to use a convenient high level API to access and manipulate Smart Cards, but keeps you from having a hard time while trying to write a perfect P/Invoke wrapper on the WinSCard API.

To be more precise, it’s not just a wrapper on the native PC/SC API, but a complete framework that can be extended to support any Smart Card reader technology. The professional version of Subsembly for Smart Card offers support for MCARD API and the CT-API smart card readers, which are essentially different from the PC/SC readers.

Although it provides everything to the .NET framework for developing Smart Card enabled applications like the OpenCard Framework does for the Java Platform, it isn’t a stereotype of the same. It heavily improves upon the OpenCard Framework for simplicity, advanced features and utilization of the .NET framework primitives to the peak.

What does Subsembly provide?

The Smart Card Subsembly is available in several flavors to cater to the varied needs of developers. These are offered as SDKs that include extensive documentation and many sample applications with commented source code. It even offers a royalty free distribution of the binary Smart Card Subsembly with your product and free email support.

From a developers point of view the advantages of Subsembly can be enumerated as below:

  • Reduced development time by eliminating the need to write your own P//Invoke wrappers.
  • Using an OpenCard like High Level and more convenient API.
  • Make your applications quite robust by not relying on the underlying actual Smart Card API’s in such a way that the same application can use a PC/SC Smart Card reader and a CT-API reader without any changes.
  • Enhancements, Updates and Bug fixes with continuous development.

Furthermore, it takes advantage of the .NET framework to the max by having a complete implementation in the .NET Common Language Specification (CLS). Additionally, it supports C#, VB .NET, J# and all the CLS-compliant IL-oriented languages.

It also recognizes the PC/SC workgroup API compatible Smart Card Readers with support for T= 0 and T= 1 protocol. As I’ve mentioned earlier, it has built-in support for the CT-API compatible Smart Card readers. Recently, support for the ACR80 and MCARD specific cards has also been added by extending the Subsembly. That is what’s magical about the Subsembly: it allows you to extend it to any new card reader type. It even allows you to use any number of configured readers in parallel.

We can be grateful to the author Andreas Selle, or the .NET development team, or both, for providing the support for localization in the entire GUI stuff that Subsembly provides. Oh, I forgot to mention about the GUI! Yes, it provides convenient customizable GUI elements for prompting the user, PIN verification and PIN modification. And if you’re using an older version of the .NET framework, it’s still not a problem, because Subsembly supports v1.0 and v1.1 of the .NET framework.

How do I use it?

Using Subsembly is as easy as adding a reference in your project. You can do it by choosing References and, on right click popup menus, choose Add Reference...and just browse for the appropriate assembly (any one of the Subsembly DLLs) that you wish to use. Next you provide an appropriate namespace in the form of using the keyword (C#) or the Imports (VB .NET). Now you can easily use the classes and other interfaces exposed by the Subsembly. You can have a look at the samples provided with Subsembly for a good example, because they are well commented and easy to follow.

Putting Assemblies in place

The classes of the Smartcard Subsembly Framework are grouped into five distinct namespaces. The classes of each namespace are bundled in a separate .NET assembly DLL. Let’s have a look on each of these:

  • Subsembly.SmartCard (Subsembly.SmartCard.dll) This is responsible for the high level access to smart card readers and smart cards,  completely independent of actual smart card reader API or driver technology.
  • Subsembly.SmartCard.PcSc (Subsembly.SmartCard.PcSc.dll) This assembly provides low level PC/SC Workgroup API compliant smart card  reader access and full PC/SC Workgroup API functionality. This entire  namespace actually represents the product SmartCard Subsembly (PC/SC  Edition), which is a subset of the Smartcard Subsembly (Professional)  distribution.
  • Subsembly.SmartCard.CtApi (Subsembly.SmartCard.CtApi.dll) This assembly provides low level CT-API based smart card reader access and full  CT-API and CT-BCS functionality. This namespace actually represents the  product Smartcard Subsembly (CT-API Edition), which is also a subset of the  Smartcard Subsembly (Professional) distribution.
  • Subsembly.SmartCard.MCard (Subsembly.SmartCard.MCard.dll)
     This assembly provides low level MCARD API based memory card access and Smartcard Subsembly Framework extension. It depends on the Subsembly.SmartCard.PcSc and Subsembly.SmartCard. This extension is included in the Smartcard Subsembly (Professional) distribution. 
  • Subsembly.SmartCard.Acr80 (Subsembly.SmartCard.Acr80.dll)
     This assembly provides low level ACR80 API based smart card reader access and  Smartcard Subsembly Framework extension. This module depends on Subsembly.SmartCard. This extension is  included in the Smartcard Subsembly (Professional) distribution.

The following figure shows the Smartcard Subsembly assemblies and their dependencies.

 
Figure 1: Smartcard Subsembly assemblies and their dependencies.

How much does it cost?

As explained above, a lot of flavors of Subsembly are available and can be purchased to match your requirements and budget. Personally I believe the prices are nominal for a quality product like Subsembly. Below are the versions offered with their pricing details:

Smartcard Subsembly for .NET

  • Smartcard Subsembly (Professional) Development Kit EUR 198,00
  • Smartcard Subsembly (PC/SC Edition) EUR 98,00
  • Smartcard Subsembly (CT-API Edition) EUR 98,00

Are there any deployment issues?

I mentioned earlier that you’re free to distribute the binary versions of the Subsembly Assemblies with your product without paying anything once you’ve obtained a license for Subsembly. It’s royalty free, and free email support is provided as a bonus.

With the copy and paste approach of .Net deployment, the Subsembly works fine. But you may choose to deploy it in the GAC if you’re shipping several applications that use these assemblies.

Where do I get it?

You may try Subsembly for free by downloading it from the Subsembly website. It also contains other, similar products that you might be interested in. Just visit http://subsembly.com for a download of the trial version. You can download the professional edition, and it doesn’t have a time limit for trial. But I’m sure once you get used to it, you’ll soon be deploying all your Smart Card enabled applications using Subsembly.

Summary

In this article we reviewed the product Smartcard Subsembly by Andreas Selle and discussed the fine features of it. We also enumerated the different versions available and what they provide.

blog comments powered by Disqus
.NET ARTICLES

- .Net 4.5 Brings Changes
- Understanding Events in VB.NET
- Objects, Properties, Events and Methods in V...
- Install Visual Web Developer Express 2010
- Microsoft Gadgeteer an Open Source Alternati...
- Best DotNetNuke Modules
- Facebook Image Viewer in Visual Basic
- Murach`s ADO.NET 4 Database Programming with...
- 5 Must Have Visual Studio 2010 Extensions
- Dynamic Web Applications with ASP.NET Mono u...
- PDFSharp: HTML to PDF in ASP.NET 3.5 using V...
- Using the PDFSharp Library in ASP.NET 3.5 wi...
- Sending Email in ASP.NET 3.5 using VB.NET wi...
- ASP.NET 3.5 Role Based Security and User Aut...
- Creating ASP.NET Login Web Pages and Basic C...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials