Protecting Assemblies From Un-Authorised Use

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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.
 
Back
Top