How to add a Assembly use protection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if there is a way to restrict the use of a assembly "A"
to another identified assembly "B" and only for this one. This mean that for
example
anyone who would reference the assembly "A" in a VS projet would have a kind
of
licence error or something similar.

Thank you.

Cylt.
 
Hi Cylt,

Thank you for posting.

Regarding on your question about configure the assembly to allow only some
particular assemblies to call it, I think we can consider using the .NET
CAS security setting. In .NET built-in CAS permission setting, there is on
"StrongNameIdenitityPermission" which can help configure
assembly/class/method to allow only some certain assemblies which have
the specific strong-named to call it. We can use the following attribute
to declare such strong-name identity requirement statically:

#StrongNameIdentityPermissionAttribute Class
http://msdn2.microsoft.com/en-us/library/system.security.permissions.strongn
ameidentitypermissionattribute(VS.80).aspx

Also, you can also use the StrongNameIdentityPermission Class to
programmatically do such checking in your code at runtime:

http://msdn2.microsoft.com/en-us/library/system.security.permissions.strongn
ameidentitypermission(VS.80).aspx

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
there is on
"StrongNameIdenitityPermission" which can help configure
assembly/class/method to allow only some certain assemblies which have
the specific strong-named to call it.

It's woth pointing out that under 2.0 any fully trusted code can still
call into the "protected" assembly, regardless of its strong name.


Mattias
 
Back
Top