security exception *strongnameidentity*asp.net
- From: raghuraman_ace@xxxxxxxxxxxxxx
- Date: 25 Jan 2007 05:39:54 -0800
Hi have created a class library application and is signed with
strongname (snk) .One of the public method has docorated with
strongnameidentitypermission keyword and s given below
public string Getcaspolcontrol()
{
//SHA1Managed obj=new SHA1Managed();
//FileStream str=new
FileStream(@"\pubkey.pk",FileMode.OpenOrCreate);// Stream();
//byte[] keybyte= obj.ComputeHash(str);OR
byte[] keybyte= { 0, 36, 0, 0, 4, 128, 0, 0, 148, 0, 0, 0, 6, 2, 0, 0,
0, 36, 0, 0, 82, 83, 65,49, 0, 4, 0, 0, 1, 0, 1, 0, 93, 19, 63, 112,
56, 244, 209, 42, 240, 246, 119, 4, 22, 245, 116, 206, 101, 99, 122,
61, 180, 54, 187, 104, 91, 241, 13, 119, 165,96, 211, 149, 248, 193,
55, 53, 146, 54, 222, 117, 220, 215, 212, 245, 231, 219, 227, 68, 58,
251, 238, 140, 102, 102, 239, 189, 254, 121, 130, 132, 49, 237, 117,
170, 48, 246, 234, 124, 200, 199, 28, 86, 233, 76, 44, 25, 251, 150,
73, 186, 175, 11, 23, 167, 233, 115, 139, 124, 234, 96, 129, 26, 36,
165, 208, 119, 7, 105, 84, 252, 116, 173, 208, 98, 121, 151, 196, 100,
119, 22, 195, 206, 132, 99,104, 80, 161, 221, 103, 2, 169, 185, 11,
236, 149, 58, 164, 170 };
Version v1 = new Version("1.0.0.0");
StrongNamePublicKeyBlob blob=new StrongNamePublicKeyBlob(keybyte);
string strs=ComparePublicKeys()?"two assembly has same keys":"diff
assemblies";
StrongNameIdentityPermission idper=new
StrongNameIdentityPermission(blob,"WebCtrldll",v1);
idper.Demand();
return "success";
}
-----------------
in the webapp , i simply call the method by creating instances
(Assemblyinfo is powered with same snk file)
-------------------
please tell me what should be the strong name(WebCtrldll) value
--------------------
I then cerated a web application that references the above class
library .It is also has the same same name signed with sn command .
-********
I also understand that if i extract the pubkey using sn -Tx ,both the
library file and the web app has same public key token . But , while
debugging the class library says the calling assembly as
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
which is different .I am confused ...why the publickey token of an
assembly is different between sn -Tp and in debug mode ..
Please guide me where i went wrong .
Regards
Raghuraman.C
.
- Prev by Date: for shauna: extremely brilliant premium access - cumse kussi hitfe - (1/1)
- Next by Date: How to find out file owner?
- Previous by thread: for shauna: extremely brilliant premium access - cumse kussi hitfe - (1/1)
- Next by thread: How to find out file owner?
- Index(es):
Relevant Pages
|