How Secure is "Friend"

  • Thread starter Thread starter Phil Jones
  • Start date Start date
P

Phil Jones

If I have a strongly-named assembly, I'm wondering how secure is declaring
methods as Friend?

Is this enough to ensure other assemblies will not be able to access the
method (including over a Remoting boundary) or is there some other framework
mechansim I should be employing also.

Many thanks everyone.

===
Phil
(Auckland | Aotearoa)
 
Friend is not secure. Neither is private. It's a common mistake to confuse
"visibility" with "security".

Friend declares that a method is only visible to classes within the same
project. Likewise, "private" declares that a method is only visible within a
class.

However, anybody can call a private or friend method via Reflection.

The only way to secure a method from being called by an untrusted source is
to use Code Access Security.

http://msdn.microsoft.com/library/d...n-us/cpguide/html/cpconcodeaccesssecurity.asp
 
Back
Top