By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,554 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

Calling Code

P: n/a
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?

--
Joe Fallon


Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
In article <O2**************@TK2MSFTNGP09.phx.gbl>, Joe Fallon wrote:
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.

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2

P: n/a
"Joe Fallon" <jf******@nospamtwcny.rr.com> wrote...
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.


Nov 20 '05 #3

P: n/a
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

"Joe Fallon" <jf******@nospamtwcny.rr.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
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?

--
Joe Fallon

Nov 20 '05 #4

P: n/a
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote...
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. :-(


A search of Google yielded this on the MS site
http://msdn.microsoft.com/library/de...slibraries.asp

A quick scan indicates it "chats" about the concept but I'm not certain it
supplied a solution... but I didn't read it carefully.
Nov 20 '05 #5

P: n/a
Tom,
That's part of it, thanks!

You can check for either the PublisherIdentityPermission or the
StrongNameIdentityPermission

http://msdn.microsoft.com/library/de...ClassTopic.asp

http://msdn.microsoft.com/library/de...ClassTopic.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

"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:Nx********************@twister.nyc.rr.com...
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote...
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. :-(
A search of Google yielded this on the MS site

http://msdn.microsoft.com/library/de...slibraries.asp
A quick scan indicates it "chats" about the concept but I'm not certain it
supplied a solution... but I didn't read it carefully.

Nov 20 '05 #6

P: n/a
As always - Thanks!

I will research these topics.
--
Joe Fallon

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:OE**************@TK2MSFTNGP10.phx.gbl...
Tom,
That's part of it, thanks!

You can check for either the PublisherIdentityPermission or the
StrongNameIdentityPermission

http://msdn.microsoft.com/library/de...ClassTopic.asp
http://msdn.microsoft.com/library/de...ClassTopic.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

"Tom Leylan" <ge*@iamtiredofspam.com> wrote in message
news:Nx********************@twister.nyc.rr.com...
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote...
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. :-(


A search of Google yielded this on the MS site

http://msdn.microsoft.com/library/de...slibraries.asp

A quick scan indicates it "chats" about the concept but I'm not certain it supplied a solution... but I didn't read it carefully.


Nov 20 '05 #7

P: n/a
* "Joe Fallon" <jf******@nospamtwcny.rr.com> scripsit:
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?


<http://msdn.microsoft.com/library/en-us/cpguide/html/cpconlicensingcomponentscontrols.asp>

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.