Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: got lParam, what to do now? Pin
Lapje9-Sep-05 6:36
Lapje9-Sep-05 6:36 
QuestionBitmap to byte array? Pin
Dr Herbie8-Sep-05 2:46
Dr Herbie8-Sep-05 2:46 
AnswerRe: Bitmap to byte array? Pin
Charlie Williams8-Sep-05 4:32
Charlie Williams8-Sep-05 4:32 
AnswerRe: Bitmap to byte array? Pin
thomasa8-Sep-05 4:39
thomasa8-Sep-05 4:39 
GeneralRe: Bitmap to byte array? Pin
Judah Gabriel Himango8-Sep-05 6:55
sponsorJudah Gabriel Himango8-Sep-05 6:55 
GeneralRe: Bitmap to byte array? Pin
thomasa8-Sep-05 21:34
thomasa8-Sep-05 21:34 
GeneralRe: Bitmap to byte array? Pin
Judah Gabriel Himango9-Sep-05 4:24
sponsorJudah Gabriel Himango9-Sep-05 4:24 
QuestionCryptographicException when instantiating RSACryptoServiceProvider Pin
mav.northwind8-Sep-05 2:35
mav.northwind8-Sep-05 2:35 
Hi folks!

I'm being bugged by a very nasty problem and don't know how to proceed any further, perhaps someone can enlighten me.

In my programs I need an RSACryptoServiceProvider to encrypt and decrypt stuff. In order to check whether this is possible during startup, I simply try instantiating the CSP. If this blows, the user is told to install the latest service packs, IE5.5+ or anything that usually includes the strong encryption CSPs.

The code to do this is
CspParameters param = new CspParameters();
param.Flags = CspProviderFlags.UseMachineKeyStore;
RSACryptoServiceProvider csp = new RSACryptoServiceProvider(param);
so I'm already using the Machine Key Store.

This throws an exception (CryptographicException: CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired), if the application was installed by an administrator on a Win2K SP4 machine and is then run by a user with restricted rights (belonging to group "Users").

When the admin is running the application, the code above executes flawlessly AND afterwards, the restricted user also can run the program!

I've been searching for this problem for quite some time and only found reports where this exception is thrown in an ASP.NET context, but my applications are Windows Forms applications, not ASP.NET ones.

I can't find which additional rights the user has to have for the code to work before the administrator has at least run it once.

Giving full access to C:\documents and settings\all users\application data\microsoft\crypto\* didn't help.

I'm completely at a loss on what to do next.
Can anyone help?

TIA,
mav
AnswerRe: CryptographicException when instantiating RSACryptoServiceProvider Pin
Ashok Dhamija8-Sep-05 4:00
Ashok Dhamija8-Sep-05 4:00 
GeneralRe: CryptographicException when instantiating RSACryptoServiceProvider Pin
mav.northwind8-Sep-05 5:01
mav.northwind8-Sep-05 5:01 
GeneralRe: CryptographicException when instantiating RSACryptoServiceProvider Pin
Ashok Dhamija8-Sep-05 18:36
Ashok Dhamija8-Sep-05 18:36 
AnswerRe: CryptographicException when instantiating RSACryptoServiceProvider Pin
mav.northwind8-Sep-05 20:28
mav.northwind8-Sep-05 20:28 
QuestionUsing Resources - Command Line Compile vs VS Compile Pin
MrEyes8-Sep-05 2:15
MrEyes8-Sep-05 2:15 
Questionhave some method in a exe file.but I want to use them in another project Pin
jzb8-Sep-05 0:28
jzb8-Sep-05 0:28 
AnswerRe: have some method in a exe file.but I want to use them in another project Pin
enjoycrack8-Sep-05 1:43
enjoycrack8-Sep-05 1:43 
AnswerRe: have some method in a exe file.but I want to use them in another project Pin
Daniel Grunwald8-Sep-05 3:47
Daniel Grunwald8-Sep-05 3:47 
AnswerRe: have some method in a exe file.but I want to use them in another project Pin
mav.northwind9-Sep-05 12:31
mav.northwind9-Sep-05 12:31 
QuestionCreating conditional windows application Pin
Fredy8-Sep-05 0:19
Fredy8-Sep-05 0:19 
AnswerRe: Creating conditional windows application Pin
Ashok Dhamija8-Sep-05 3:38
Ashok Dhamija8-Sep-05 3:38 
AnswerRe: Creating conditional windows application Pin
Patric_J8-Sep-05 6:13
Patric_J8-Sep-05 6:13 
Questionmy console application doesn't run on other pc Pin
Sasuko8-Sep-05 0:04
Sasuko8-Sep-05 0:04 
AnswerRe: my console application doesn't run on other pc Pin
Michael P Butler8-Sep-05 0:23
Michael P Butler8-Sep-05 0:23 
GeneralRe: my console application doesn't run on other pc Pin
Sasuko8-Sep-05 3:40
Sasuko8-Sep-05 3:40 
GeneralRe: my console application doesn't run on other pc Pin
Ashok Dhamija8-Sep-05 4:18
Ashok Dhamija8-Sep-05 4:18 
Questionhow can i get filed from C3 Form to Crystal Pin
Anonymous7-Sep-05 23:59
Anonymous7-Sep-05 23:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.