Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

A Smart Card Framework for .NET

, 20 Feb 2013
Describes a framework to use the PCSC Smart Card API with .NET.
smartcardapi_demo.zip
smartcardapi_doc.zip
smartcardapi_doc
banner.jpg
darkcorner.jpg
GemCard
gradleft.jpg
gradtop.jpg
graycorner.jpg
minus.jpg
plus.jpg
titletile.jpg
smartcardapi_source.zip
Smartcard_API
DemoSCFmwk
Properties
GemCardEx
GemCardEx.aps
GemCardEx.def
GemCardEx.rgs
GemCardEx.suo
GemCardEx.vcproj.CORUSCANT.han.user
GemCardEx.vcproj.vspscc
GemCardExps.def
Release
GemCardEx.dll
SCardDatabaseEx.rgs
Smartcard Framework 2005.suo
GemCard
GemCard.csproj.user
SmartcardFrameworkWithWCFSCardService.zip
SmartcardFramework
DemoSCardService
bin
Release
obj
Properties
Service References
SCardNPService
configuration.svcinfo
configuration91.svcinfo
DemoSCardService.SCardNPService.APDUResponse.datasource
Reference.svcmap
service.wsdl
SCardService
configuration.svcinfo
configuration91.svcinfo
DemoSCardService.SCardService.APDUResponse.datasource
Reference.svcmap
service.wsdl
SCardServiceHost
bin
obj
Properties
Settings.settings
Smartcard Framework 2010.suo
Smartcard Framework 2010.v11.suo
Smartcard_API
DemoSCFmwk
bin
x86
obj
x86
Properties
GemCard
bin
x64
x86
GemCard.csproj.user
obj
x64
x86
SmartCardPlayer
bin
x86
obj
x86
Properties
Smartcard_Test
ApduExchange
ApduExchange.csproj.user
App.ico
bin
x86
obj
x86
Thumbs.db
GSMHelper
bin
x86
obj
x86
Properties
ReadPhonebook
bin
x86
obj
x86
Properties
Settings.settings
ReadPhonebook.csproj.user
SmartcardService
bin
obj
Properties
SmartcardService.csproj.user
Smartcard_Framework_2010.zip
Smartcard_Framework_2010
Smartcard Framework 2010.suo
Smartcard_API
DemoSCFmwk
DemoSCFmwk.csproj.user
Properties
GemCard
GemCard.csproj.user
SmartCardPlayer
Properties
Smartcard_Test
ApduExchange
ApduExchange.csproj.user
App.ico
GSMHelper
Properties
ReadPhonebook
Properties
Settings.settings
ReadPhonebook.csproj.user
Smartcard_Framework_64.zip
Smartcard_Framework
Smartcard_API
DemoSCFmwk
Properties
GemCard
GemCard.csproj.user
SmartCardPlayer
Properties
Smartcard_Test
ApduExchange
ApduExchange.csproj.user
App.ico
GSMHelper
Properties
ReadPhonebook
Properties
Settings.settings
ReadPhonebook.csproj.user
function resizeMe()	{
	alert('loaded');
}

function InitElements()  {
        for(var a=0; a<document.all.length; a++)  {
                if(document.all[a].tagName == 'DIV' && document.all[a].className.toLowerCase()=='namespacechild') {
                        document.all[a].style.display = 'none';
                }
                if(document.all[a].tagName=='IMG')  {
                        document.all[a].style.display='inline';
                }
        }
}

function gvResolve(param) {
	var lmSpan = param

	if (lmSpan.style.display == "block") {
		lmSpan.style.display = "none"
	}else{
		lmSpan.style.display = "block"
	}

		
}

function gvResolve2(param) {
	var lmSpan = param
	if (lmSpan.style.display == "block") {
		setCookie("TeamMenuDisplay", "none", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
		lmSpan.style.display = "none"
	}else{
		setCookie("TeamMenuDisplay", "block", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
		lmSpan.style.display = "block"
	}

		
}

function gvResolve2a(param) {
	var lmSpan = param
	if (lmSpan.style.display == "block") {
		setCookie("ProdMenuDisplay", "none", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
		lmSpan.style.display = "none"
	}else{
		setCookie("ProdMenuDisplay", "block", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
		lmSpan.style.display = "block"
	}

		
}

function gvResolveX2(param, whichArrow, path) {
	var lmSpan = param
	var changeArrow = whichArrow
        var rootpath = path
	if (lmSpan.style.display == "block") {
		lmSpan.style.display = "none";
		changeArrow.src = rootpath + "Plus.jpg";	
	}else{
		lmSpan.style.display = "block";
		changeArrow.src = rootpath + "Minus.jpg";
	}

		
}

function setStatus(param)	{
	var whatMSG = param;
	window.status = whatMSG;
}

function BTN_preloadImages() { //v1.2
  if (document.images) {
    var imgFiles = BTN_preloadImages.arguments;
    var preloadArray = new Array();
    for (var i=0; i<imgFiles.length; i++) {
      preloadArray[i] = new Image;
      preloadArray[i].src = imgFiles[i];
    }
  }
}


function BTN_swapImage() {
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.BTN_swapImgData;
  for (i=0; i < (BTN_swapImage.arguments.length-2); i+=3) {
    objStr = BTN_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = BTN_swapImage.arguments[i+2];
  } }
  document.BTN_swapImgData = swapArray; //used for restore
}

function BTN_swapImgRestore() { 
  if (document.BTN_swapImgData != null)
    for (var i=0; i<(document.BTN_swapImgData.length-1); i+=2)
      document.BTN_swapImgData[i].src = document.BTN_swapImgData[i+1];
}


//cookie code
function setCookie (name, value, expires, path, domain, secure) {
	document.cookie = name + "=" + escape(value) +
    	((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
	
function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}
	
function getVal(param)	{
	var myVal = getCookie(param);
	alert(myVal);
}


function toggleInfoDisplay (param)	{
	var myVal = getCookie(param);
		if (myVal == "none") {
			setCookie(param, "block", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
			toggleInfoBTN.innerText = "Hide Page Info"
			pageInfo.style.display = "block"
		}else{
			if (myVal == "block") {
				setCookie(param, "none", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
				toggleInfoBTN.innerText = "Show Page Info"
				pageInfo.style.display = "none"
				}
		}

}

function toggleTickerDisplay (param)	{
			setCookie("TickerTickler", param, "Mon, 01-Jan-2001 00:00:00 GMT", "/")
			top.location=param
}


function cookieINIT (param)	{
	var cookieVal = getCookie(param);
	if (cookieVal == null) {
		setCookie(param, "block", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
	}

}

function setCorrectBTNText(param)	{
	var myVal = getCookie(param);
		if (myVal == "none") {
			document.write("Show Page Info")
		}else{
		if (myVal == "block") {
			document.write("Hide Page Info")
			}
		}
}

function checkDefaultPage (param)	{
	var myVal = getCookie(param);
	if (myVal == null) {
		setCookie(param, "default_0.asp", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
		top.location="default_0.asp"
	}
		if (myVal == "default_0.asp") {
			top.location="default_0.asp"
		}else{
		if (myVal == "default_1.asp") {
			top.location="default_1.asp"
		}else{
		setCookie(param, "default_0.asp", "Mon, 01-Jan-2001 00:00:00 GMT", "/")
		}
		}
}


//end cookie

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

orouit
Architect Consistel - Singapore
Singapore Singapore
Software Architect, COM, .NET and Smartcard based security specialist.
 
I've been working in the software industry since I graduated in Electrical and Electronics Engineering. I chose software because I preferred digital to analog.
 
I started to program with 6802 machine code and evolved to the current .NET technologies... that was a long way.
 
For more than 20 years I have always worked in technical positions as I simply like to get my hands dirty and crack my brain when things don't go right!
 
After 12 years in the smart card industry I can claim a strong knowledge in security solutions based on those really small computers! I'm currently back in the business to design the licensing system for the enterprise solution I'm currenly working on, using a .NET smart card (yes they can run .NET CLR!)
 
View my profile on LinkedIn
 
You can contact me for professional consulting by using the forum.

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 20 Feb 2013
Article Copyright 2006 by orouit
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid