Assembly Security

  • Thread starter Thread starter Evian Spring
  • Start date Start date
E

Evian Spring

Is it possible to create an assembly (Namespace A) and set it so only
certain assembly can load it and invoke methods on it.

For example, only Namespace B and Namespace C would be able to invoke
Namespace A because of this security setting.

Is this possible? if yes I would really appreciate it you could let me
know if possible or not and how?

Many thanks!
Evian
 
Is it possible to create an assembly (Namespace A) and set it so only
certain assembly can load it and invoke methods on it.

For example, only Namespace B and Namespace C would be able to invoke
Namespace A because of this security setting.

Is this possible?

Yes (sort of), I suggest reading about Code Access Security in general
and link demands and classes like StrongNameIdentityPermission in
particular in the docs.

You can do this based on assembly identity, but namespaces has nothing
to do with it.

microsoft.public.dotnet.security is a great group for further
questions about this.


Mattias
 
Mattias said:
Yes (sort of), I suggest reading about Code Access Security in general
and link demands and classes like StrongNameIdentityPermission in
particular in the docs.

The 'sort of' bit is important. The identity permissions have no effect
for trusted code in .NET 2.0:

http://blogs.msdn.com/eugene_bobukh/archive/2005/05/06/415217.aspx

So if your code gets full trust then you cannot use identity permissions
to perform the action the OP requires in .NET 2.0

However, in .NET 2.0 you can use friend assemblies. In this case an
assembly indicates the assemblies that can call its internal types. This
is not a security issue, because any code can use reflection to call an
internal type in another assembly.

Richard
 
Back
Top