Calling Code

  • Thread starter Thread starter Joe Fallon
  • Start date Start date
J

Joe Fallon

Is it possible to build a Class Library in such a way that only the poeple
who developed it can call the methods in it?

I can see how someone else could copy the .dll, make a reference to it and
then use its Public methods.
Is it possible to prevent this?
 
Is it possible to build a Class Library in such a way that only the poeple
who developed it can call the methods in it?

I can see how someone else could copy the .dll, make a reference to it and
then use its Public methods.
Is it possible to prevent this?

I actually think there is... I'm not sure of the exact syntax - but I
believe that there are security attributes that you can apply that limit
who can call your functions.

Not very helpfull, I know - but I wanted to give you some hope :) If no
one jumps in and gives you the details - I'll look into it tonight and
get back to you.
 
Joe Fallon said:
Is it possible to build a Class Library in such a way that only the poeple
who developed it can call the methods in it?

If there isn't an intrinsic methodology it should certainly be possible to
do by establishing a public "security" class/method that needs to be
created/called first. The general public wouldn't know a) to call it first
or b) what to pass as a key.

I'm thinking fast (there is more than one way to do it) but it seems that
you could unlock the classes on a class-by-class basis or perhaps easier
(for the developer) you could simply unlock the entire library.
 
Joe,
As Tom stated, here are two attributes that you need to apply, I just seen
the post today, but I do not remember which newsgroup. :-(

If I find them I will post something.

Hope this helps
Jay
 
Tom,
That's part of it, thanks!

You can check for either the PublisherIdentityPermission or the
StrongNameIdentityPermission

http://msdn.microsoft.com/library/d...ionsPublisherIdentityPermissionClassTopic.asp

http://msdn.microsoft.com/library/d...onsStrongNameIdentityPermissionClassTopic.asp

I do not have examples of how to do this, the other post didn't either, just
the two permissions to check.

Remember there are both the permissions and attributes.
StrongNameIdentityPermission & StrongNameIdentityPermissionAttribute. So you
can apply to the attribute to your code and the framework will check for the
permission or you can instantiate the class and check your self.

Hope this helps
Jay
 
Back
Top