how can I protect my assembly by use strongnameidentitypermission with .NET 2.0?

A

Ares Chen

Hi, all
In .NET 1.1, I can protect my assembly by use "StrongNameIdentityPermission", so only the caller with the special StrongName Sign can call my functions in the important assembly.

But how can I do this with .NET 2.0? I find some detail with this topic from a link as below
http://msdn.microsoft.com/en-us/lib...permissions.strongnameidentitypermission.aspx

In the .NET Framework versions 1.0 and 1.1, identity permissions cannot have an Unrestricted permission state value. In the .NET Framework version 2.0, identity permissions can have any permission state value. This means that in version 2.0, identity permissions have the same behavior as permissions that implement the IUnrestrictedPermission interface. That is, a demand for an identity always succeeds, regardless of the identity of the assembly, if the assembly has been granted full trust. For information on executing version 2.0 applications with version 1.1 CAS policy, see <legacyV1CASPolicy> Element.

My problem is :"a demand for an identity always succeeds, regardless of the identity of the assembly, if the assembly has been granted full trust."

Any advice is welcome, thank you
 
P

Pavel Minaev

My problem is :"a demand for an identity always succeeds, regardless of
the identity of the assembly, if the assembly has been granted full
trust."


Well, that's why it's called "Full Trust", right? Given that a full trust
assembly can do any imaginable tricks with unmanaged code anyway, if really
needed, it could override any and all security checks, so why bother?
 
A

Ares Chen

Thank you for your reply. Well, I know that is full trust, but I also know
any other permission (e.g. Registerpermission) still can be used even the
assembly is full trust. This is the key point.

anyway, I just want to know: how can I protect the assembly by use
StrongNameIdentityPermission , even the caller assembly has been granted
full trust? The important thing is : we can not control the caller, right?

thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top