Re: How to protect your dll's best?
From: Hernan de Lahitte (hernan_at_lagash.com)
Date: 02/24/04
- Next message: Michel Gallant: "Re: Question about signing XML and RSA"
- Previous message: joka: "Re: security exception when calling another dll"
- In reply to: David Lindgren: "How to protect your dll's best?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 24 Feb 2004 10:20:43 -0300
1) Simple Public method of a Public Class. (You might use the APTA
attribute: See
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/h
tml/THCMCh08.asp?frame=true#c08618429_005) )
2) Public classes with LinkDemand to a StrongName.
See articles:
http://msdn.microsoft.com/netframework/?pull=/library/en-us/dnnetsec/html/strongNames.asp
Sample:
public sealed class Utility
{
// Although SomeOperation() is a public method, the following
// permission demand means that it can only be called by assemblies
// with the specified public key.
[StrongNameIdentityPermission(SecurityAction.LinkDemand,
PublicKey="00240000048...97e85d098615")]
public static void SomeOperation() {}
}
Recall that for simple "asembly scope" you might use the "internal"
keyword.
"David Lindgren" <david.lindgren@hogia.se.REMOVE!> wrote in message
news:elZcArr%23DHA.1844@TK2MSFTNGP11.phx.gbl...
> Hello!
>
> I have written some code which I would like to protect so that other
people
> cannot use my methods etc. All of the code is inside a set of classes in a
> dll. I would like to protect it so that all classes inside the dll shall
be
> able to "communicate" but it should not be possible to create objects of
my
> classes from an outside dll or exe. There are two exceptions:
> 1) One of the methods returns an object of a class. Everyone should be
able
> to call this method. It is not static.
> 2) From a program that I have written I need to be able to initiate a few
> objects and access some methods. Only "my" programs shall be able to do
> this.
>
> Question: What options do I have to protect my dll like I described above?
>
> Thank you for helping out.
>
> Regards,
> David.
>
>
- Next message: Michel Gallant: "Re: Question about signing XML and RSA"
- Previous message: joka: "Re: security exception when calling another dll"
- In reply to: David Lindgren: "How to protect your dll's best?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|