question about CreateIdentityPermission

  • Thread starter Thread starter =?iso-8859-1?B?ZnLpZG8=?=
  • Start date Start date
?

=?iso-8859-1?B?ZnLpZG8=?=

Why CreateIdentityPermission() is asking an instance of
Evidence? I don't understand what it is made for and
anyway from where I should take it?

I paased null and everything seems working fine.

thank you
 
Hi
Basically this function create a identity permission given a specified
evidence, which is defined in .net as follows "Evidence is the information
that the common language runtime uses to make decisions based on security
policy. Evidence indicates to the runtime that code has a particular
characteristic. Common forms of evidence include digital signatures and the
location where code originates, but evidence can also be custom-designed to
represent other information that is meaningful to the application. Both
assemblies and application domains receive permission grants based on
evidence"
checkout these links

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconEvidence.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemsecuritypolicyiidentitypermissionfactoryclasscreateidentitypermis
siontopic.asp
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
OK, but CreateIdentityPermission is not a static method
from any neutral class, but an instance method from an
evidence class. For instance Publisher expose this method.

But this is th problem: the msdn documentation says that
CreateIdentityPermission Creates a new identity
permission for the SPECIFIED evidence. Not the evidence
where the method come from.
I dont understand this.

Anyway it works fine if I insert null parameter.
 
The built-in Publisher, Site, StrongName, Url, and Zone classes all ignore
the evidence argument in their implementations of
IIdentityPermissionFactory.CreateIdentityPermission. There's obviously a
little design problem here <g>, but you need to work with the classes as
actually implemented, so go ahead and call the method with a null argument
if returning an identity permission corresponding to the instance data is
what you actually want. It's obviously what the implementers wanted,
although they chose a rather silly means of getting there...

HTH,
Nicole
 
Back
Top