Code based security

  • Thread starter Thread starter Martin Robins
  • Start date Start date
M

Martin Robins

Unfortunately, this is an area of the .NET framework that I have yet to get
a grip of; however, I have a requirement that I believe can be acheived
using code based security.

I would like to create one or more class libraries that can only be used by
an application that is signed with the same strong name key.

The objective is that some of the classes within the library can only be
used by my application.

I am also open to alternative solutions, I have tried the licensing examples
where a class can only be used when licensed but I have never been able to
get the examples working.

Thanks in advance.
 
If you want to restrict access so that it's called by a specific app, you
can make a link demand - it's checked during the jit, and is fairly
low-cost. After the original jit, the check gets out of the way.
 
Mickey,

Could you possibly be more specific?

I have tried using StongNameIdentityPermissionAttribute at the assembly
level of the DLL, but by then signing the calling assembly I still get a
permissions error. I suspect that I am close, but still have no cigar!!

Any chance of a small example?

Thanks.
 
Back
Top