|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Assembly SecurityIs 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 Yes (sort of), I suggest reading about Code Access Security in general>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? 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 Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Mattias Sjögren wrote:
>> Is it possible to create an assembly (Namespace A) and set it so only The 'sort of' bit is important. The identity permissions have no effect >> 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. 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 -- Fusion Tutorial: http://www.grimes.demon.co.uk/workshops/fusionWS.htm Security Tutorial: http://www.grimes.demon.co.uk/workshops/securityWS.htm |
|||||||||||||||||||||||