How Secure is "Friend"

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)
 
G

Guest

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
 
G

Guest

No problem. THough I've opened up a whole can of worms with Code Access
security. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top