473,385 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Protecting Assemblies From Un-Authorised Use

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
Nov 22 '05 #1
4 1257
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
Nov 22 '05 #2
> 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.Inheri tanceDemand,PublicKey="00
24000004....1")]

[StrongNameIdentityPermission(SecurityAction.LinkDe mand,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.
Nov 22 '05 #3
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" <ol**********@skyscan.be> napisał w wiadomo¶ci
news:41**********************@news.skynet.be...
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.Inheri tanceDemand,PublicKey="00 24000004....1")]

[StrongNameIdentityPermission(SecurityAction.LinkDe mand,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.

Nov 22 '05 #4
> 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.


Try this:
http://msdn.microsoft.com/library/de...ccodeguide.asp
Nov 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sky Fly | last post by:
Hi, I know that when an .NET exe is run, the CLR loads the exe (along with dependent assemblies), compiles them to native code then runs the code. Assuming the assemblies are loaded from a...
4
by: Michael | last post by:
Hi, When an application is shipped is there a way of un-authroized people from using the assemblies in their own applications? Regards, Michael
5
by: wallacej | last post by:
Hi Is there a way to protect system files, eg .ini files but still allow access to them from C++ code? As an example I have a settings file called SIMS.INI. This file is often accessed...
3
by: Typpo | last post by:
Hi all, Because the programs I work on are intended to be limited to only certain users, I have had several problems concerning people hex'ing out authentication procedures and replacing strings...
7
by: Bobby C. | last post by:
My company is in the process of getting ready (well actually QTR 2 2004) to roll out a rewritten version of a vertical market application for the municipal market (small and medium sized cities). ...
5
by: Venkat | last post by:
Hi, My application is splitted into more than one assembly. And I want to clean up the methods which are not called or not used among any of the assemblies. And also I want to remove the code...
6
by: Frank Rizzo | last post by:
It seems that I can overwrite a .net assembly even though it is in use (in most cases). In some cases, the OS says File in use. Is there a write-up somewhere on when a .net assembly can be messed...
12
by: David | last post by:
Hi, I want to be able to make a class only visible within the namespace, i.e. only other classes within the namespace will have access to it. I have tried putting a protected keyword against...
11
by: sarika | last post by:
Hi all I am making a website related to uploading art pieces. My requirement is to protect art pieces from being saved by any means. I dont want my images to be save in temporary internet...
16
by: MA | last post by:
Hi, We have added a shared assembly in GAC so that our multiple solutions can use use it. We use the publisher policy to controls the different versions of the assembly. This shared assembly...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.