Problem with InfocardBrowser sample hosted locally

HI

I have locally installed infocardbrowswer sample appln. and while trying to login using infocard it is causing following exception.

Server Error in '/' Application.


The handle is invalid.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Security.Cryptography.CryptographicException: The handle is invalid.

Source Error:

Line 182:

Line 183: SymmetricSecurityKey encryptingCrypto;

Line 184: encryptingCrypto = (SymmetricSecurityKey)tokenResolver.ResolveSecurityKey(enc.KeyIdentifier[0]);

Line 185:

Line 186:SymmetricAlgorithm algorithm = encryptingCrypto.GetSymmetricAlgorithm(enc.EncryptionMethod);


@ following line of code of tokenhelper.cs

encryptingCrypto = (SymmetricSecurityKey)tokenResolver.ResolveSecurityKey(enc.KeyIdentifier[0]);

My Local website running on win2003 server, winfx july ctp, ie 7.0 beta, iis 6.0.. I have installed self issued certificate.

Thanx in advance

shajipd

[1533 byte] By [shajipd] at [2008-2-12]
# 1

Hi Shajipd,

IIS can't access the private key of the certificate, the ACL must be set for the IIS Service account (ASPNET and NETWORK SERVICE on Windows 2003 Server) to have read access to the file. The certificate installation script will handle that or you can use findprivatekey.exe from sample\scripts\CAPICOM and cacls.exe.

You need to read the Installation-Instructions.doc in sample\documents and specifically the section "IIS: ACLS for Certificate Private Keys".

Guillaume.

GuillaumeAubert at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 2

thanx for that ... it works for me by giving access to private key.

Shaji P.D.

shajipd at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 3
Hi Guillaume,

i tried to use findprivatekey and cacls but i have always the error "key pair doesn't exist" : alg.Key = (certificate.PrivateKey as RSACryptoServiceProvider).Decrypt(symmetricKeyData, true);

.
and the sample application "SampleSecurityTokenService.exe" have stoped to work when i have launched calcs.exe.

I did this : You

need to read the Installation-Instructions.doc in sample\documents and

specifically the section "IIS: ACLS for Certificate Private Keys"

Franck.

Francky at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...
# 4

HI,

The privatekey usually located @ following path (document settings/<User>/applicationdata/Microsoft/crypto/rsa/). Browse private key and give rights througy win explorer.

Regards


shajipd at 2007-8-31 > top of Msdn Tech,Software Development for Windows Vista,Windows CardSpace (InfoCard)...

Software Development for Windows Vista

Site Classified