HighTechTalks DotNet Forums  

Advanced Card Systems Smart Card and RSACryptoServiceProvider

Dotnet Security microsoft.public.dotnet.security


Discuss Advanced Card Systems Smart Card and RSACryptoServiceProvider in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Peter W. DeBetta
 
Posts: n/a

Default Advanced Card Systems Smart Card and RSACryptoServiceProvider - 07-06-2007 , 03:07 PM






:-(

I am trying to use an ACOS5 smart card from Advanced Card Systems (ACS)
using several different readers in conjunction with the
RSACryptoServiceProvider and I have hit a wall. I can successfully access
the smart card using IE (got a personal cert from Comodo) and via ACS's
Smart Card Cert Manager, but when I attempt to access the card via code
(C#), I get an exception: "The handle is invalid", regardless of what I do.
I have tried both the "Microsoft Base Smart Card Crypto Provider" and the
"Advanced Card Systems CSP v1.5" providers. Here is the code...

CspParameters cspParams = new CspParameters();
cspParams.ProviderName = "Advanced Card Systems CSP v1.5";
cspParams.Flags = CspProviderFlags.UseDefaultKeyContainer;
cspParams.ProviderType = 1;
cspParams.KeyNumber = 2;
m_RSAalg = new RSACryptoServiceProvider(cspParams);

Here is the relevant part of the stack trace:

at System.Security.Cryptography.Utils.GetKeyPairHelpe r(CspAlgorithmType
keyType, CspParameters parameters, Boolean randomKeyContainer, Int32
dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
at System.Security.Cryptography.RSACryptoServiceProvi der.GetKeyPair()
at System.Security.Cryptography.RSACryptoServiceProvi der..ctor(Int32
dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
at
System.Security.Cryptography.RSACryptoServiceProvi der..ctor(CspParameters
parameters)

Help...
:-(



--
Peter DeBetta, MVP - SQL Server
http://sqlblog.com
--

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.