Exemplo n.º 1
0
        static Platform()
        {
            var platform = Environment.OSVersion.Platform;

            switch (platform)
            {
            case PlatformID.Unix:
                if (Unix.Native.GetUnameSysName() == Unix.Native.OS_NAME_OSX)
                {
                    // Mono identifies MacOSX as Unix
                    goto case PlatformID.MacOSX;
                }

                Type = PlatformType.Linux;
                Lib  = new PCSCliteLinux();
                break;

            case PlatformID.MacOSX:
                Type = PlatformType.MacOSX;
                Lib  = new PCSCliteMacOsX();
                break;

            case PlatformID.Win32NT:
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
            case PlatformID.WinCE:
                Type = PlatformType.Windows;
                Lib  = new WinSCardAPI();
                break;

            default:
                throw new NotSupportedException("Sorry, your OS platform is not supported.");
            }
        }
Exemplo n.º 2
0
        static Platform()
        {
            var platform = Environment.OSVersion.Platform;

            if (
                platform == PlatformID.Win32S ||
                platform == PlatformID.Win32Windows ||
                platform == PlatformID.Win32NT ||
                platform == PlatformID.WinCE
                )
            {
                IsWindows = true;
                Lib       = new WinSCardAPI();
                return;
            }

            IsWindows = false;
            Lib       = new PCSCliteAPI();
        }
Exemplo n.º 3
0
 internal CardHandle(ISCardApi api, ISCardContext context)
 {
     _api     = api ?? throw new ArgumentNullException(nameof(api));
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Exemplo n.º 4
0
 internal CardReader(ISCardApi api, ICardHandle cardHandle, bool isOwner)
 {
     _api       = api;
     CardHandle = cardHandle ?? throw new ArgumentNullException(nameof(cardHandle));
     _isOwner   = isOwner;
 }
Exemplo n.º 5
0
 internal SCardContext(ISCardApi api)
 {
     _api = api;
 }