Haacked
Tue Nov 02 18:33:02 CST 2004
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/default.asp?url=/library/en-us/cpguide/html/cpconcodeaccesssecurity.asp
"Phil Jones" wrote:
> 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)
>
>
>