Smart Card Manager for managing all stuffs related to smart cards and readers
Namespace:
Cryptware.NSCAPIAssembly: NSCAPI (in NSCAPI.dll)
Syntax
| Visual Basic (Declaration) |
|---|
<ClassInterfaceAttribute(ClassInterfaceType.AutoDual)> _ <GuidAttribute("34DA31FA-D342-49e1-A2DA-F107655E3612")> _ <ComVisibleAttribute(True)> _ Public Class SmartCardManager _ Implements ISmartCardManager |
| C# |
|---|
[ClassInterfaceAttribute(ClassInterfaceType.AutoDual)] [GuidAttribute("34DA31FA-D342-49e1-A2DA-F107655E3612")] [ComVisibleAttribute(true)] public class SmartCardManager : ISmartCardManager |
| Visual C++ |
|---|
[ClassInterfaceAttribute(ClassInterfaceType::AutoDual)] [GuidAttribute(L"34DA31FA-D342-49e1-A2DA-F107655E3612")] [ComVisibleAttribute(true)] public ref class SmartCardManager : ISmartCardManager |
| JavaScript |
|---|
Cryptware.NSCAPI.SmartCardManager = function(); Type.createClass( 'Cryptware.NSCAPI.SmartCardManager', null, Cryptware.NSCAPI.ISmartCardManager); |
Remarks
SmartCardManager object allows managing smart cards and readers.
Examples
SmartCardManager scman = new SmartCardManager();
Readers readerList = scman.PluggedReaders;
Reader reader = readerList[0];
reader.WaitForSmartCardInserted(Reader.INFINITE);
SmartCard card = reader.Connect();
CommandAPDU apdu = new CommandAPDU();
apdu.CLA = 0x00;
apdu.INS = 0xCA; // GET_DATA
apdu.P1 = 0x00;
apdu.P2 = 0x81;
apdu.LE = 0x00; // entire buffer required
//sends the command APDU and gets the Response APDU
ResponseAPDU resp = card.Send(apdu);
// checks SW1 and SW2 by using Success property
if (resp.Success)
{
Console.Write("SW1: " + resp.SW1);
Console.Write("SW2: " + resp.SW2);
}
| |