Protecting Assemblies From Un-Authorised Use

G

Guest

Hi,

I have written an application in C# and when I distribute it I would like to
prevent un-authorised people from using these assemblies in their own
applications.

Is it possible to do this?

Thanks,

Michael
 
C

Cor Ligthert

Michael,

Your question comes almost every 3 days in this dotnet newsgroups, maybe you
can have a look at the latest thread about this subject.

http://tinyurl.com/4m2oo

I hope this gives an idea?

Cor
 
O

Olaf Baeyens

I have written an application in C# and when I distribute it I would like
to
prevent un-authorised people from using these assemblies in their own
applications.

Is it possible to do this?
Yes

Add this (assuming that you have your own PublicKey created with sn.exe)
just in front of your class you wish toprotected.

using System.Security.Permissions;


[StrongNameIdentityPermission(SecurityAction.InheritanceDemand,PublicKey="00
24000004....1")]

[StrongNameIdentityPermission(SecurityAction.LinkDemand,PublicKey="="0024000
004....1")]
public class MyClass : {
....
}

Note: In order to use this, then your program that uses these must be strong
name checked and have this public/private key compiled into it.
Note: Do not use SecurityAction.LinkDemand, for visual controls ontherwise
the Visual studio cannot open it and gives an error.
 
R

Raven

Hi.
Can someone Tell me, what's the name of the mentioned security features?
I would like to read more on it, I just don't know how it is called.

TIA

U¿ytkownik "Olaf Baeyens said:
I have written an application in C# and when I distribute it I would
like
to
prevent un-authorised people from using these assemblies in their own
applications.

Is it possible to do this?
Yes

Add this (assuming that you have your own PublicKey created with sn.exe)
just in front of your class you wish toprotected.

using System.Security.Permissions;


[StrongNameIdentityPermission(SecurityAction.InheritanceDemand,PublicKey="00
24000004....1")]
[StrongNameIdentityPermission(SecurityAction.LinkDemand,PublicKey="="0024000
004....1")]
public class MyClass : {
....
}

Note: In order to use this, then your program that uses these must be strong
name checked and have this public/private key compiled into it.
Note: Do not use SecurityAction.LinkDemand, for visual controls ontherwise
the Visual studio cannot open it and gives an error.
 

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