473,503 Members | 3,045 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

StrongNameIdentityPermission at Assembly level?

I've just used StrongNameIdentityPermission at the class level and it works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIdentityPermission(SecurityAction.LinkD emand,
PublicKey:="00...")>

Rather than protect each class idependently I'd prefer to protect the entire
assembly from being accessed by an invalid program. I tried <Assembly:
StrongNameIdentityPermission(SecurityAction.LinkDe mand, PublicKey:="00...")>
but it creates the error "SecurityAction type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.public.dotnet.security &
microsoft.public.dotnet.languages.vb
Nov 20 '05 #1
6 2991
Hi Brad,

I think you can not do the similar thing with Assembly.
When you load the assembly , the CLR runtime will not check if the assembly
that load the assembly has the valid access. It will only be done with a
class, when you use a class.

So I think you may need to set StrongNameIdentityPermission with every
class in your assembly.

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #2

Try SecurityAction.RequestMinimum instead of SecurityAction.LinkDemand...

Tim.
ti**********@i2.co.uk
"Brad" <no****@co.lane.or.us> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
I've just used StrongNameIdentityPermission at the class level and it works fine. Can I use it similar to the following for the entire assembly?
<StrongNameIdentityPermission(SecurityAction.LinkD emand,
PublicKey:="00...")>

Rather than protect each class idependently I'd prefer to protect the entire assembly from being accessed by an invalid program. I tried <Assembly:
StrongNameIdentityPermission(SecurityAction.LinkDe mand, PublicKey:="00...")> but it creates the error "SecurityAction type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.public.dotnet.security &
microsoft.public.dotnet.languages.vb

Nov 20 '05 #3
Thanks!

"Tim Huntley" <ti**********@i2.co.uk> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...

Try SecurityAction.RequestMinimum instead of SecurityAction.LinkDemand...

Tim.
ti**********@i2.co.uk
"Brad" <no****@co.lane.or.us> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
I've just used StrongNameIdentityPermission at the class level and it

works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIdentityPermission(SecurityAction.LinkD emand,
PublicKey:="00...")>

Rather than protect each class idependently I'd prefer to protect the

entire
assembly from being accessed by an invalid program. I tried <Assembly:
StrongNameIdentityPermission(SecurityAction.LinkDe mand,

PublicKey:="00...")>
but it creates the error "SecurityAction type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.public.dotnet.security &
microsoft.public.dotnet.languages.vb


Nov 20 '05 #4
Unfortunately, this will not help :( Putting RequestMinimum for that permission will verify that your assembly will execute ONLY if it is signed with the key mentioned in the permission attribute -- it's quite different from what you need if I see it correctly.

I'm afraid there is no functionality now to achieve what you need :(
--
Eugene V. Bobukh

"Brad" <no****@co.lane.or.us> wrote in message news:u8**************@TK2MSFTNGP11.phx.gbl...
Thanks!

"Tim Huntley" <ti**********@i2.co.uk> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...

Try SecurityAction.RequestMinimum instead of SecurityAction.LinkDemand...

Tim.
ti**********@i2.co.uk
"Brad" <no****@co.lane.or.us> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
I've just used StrongNameIdentityPermission at the class level and it

works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIdentityPermission(SecurityAction.LinkD emand,
PublicKey:="00...")>

Rather than protect each class idependently I'd prefer to protect the

entire
assembly from being accessed by an invalid program. I tried <Assembly:
StrongNameIdentityPermission(SecurityAction.LinkDe mand,

PublicKey:="00...")>
but it creates the error "SecurityAction type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.public.dotnet.security &
microsoft.public.dotnet.languages.vb



Nov 20 '05 #5
Thank you. Yes, I found that RequestMinimum did not stop an unsigned or
different keyed program from accessing my class methods. So from what you
said and from my testing/reading, it seems the highest level at which you
can restrict access based upon a proper key , is at the class....which is
fine.

Brad

"Eugene V. Bobukh [MS]" <eu******@online.microsoft.com> wrote in message
news:#B*************@tk2msftngp13.phx.gbl...
Unfortunately, this will not help :( Putting RequestMinimum for that
permission will verify that your assembly will execute ONLY if it is signed
with the key mentioned in the permission attribute -- it's quite different
from what you need if I see it correctly.

I'm afraid there is no functionality now to achieve what you need :(
--
Eugene V. Bobukh

"Brad" <no****@co.lane.or.us> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
Thanks!

"Tim Huntley" <ti**********@i2.co.uk> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...

Try SecurityAction.RequestMinimum instead of SecurityAction.LinkDemand...
Tim.
ti**********@i2.co.uk
"Brad" <no****@co.lane.or.us> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
I've just used StrongNameIdentityPermission at the class level and it

works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIdentityPermission(SecurityAction.LinkD emand,
PublicKey:="00...")>

Rather than protect each class idependently I'd prefer to protect the

entire
assembly from being accessed by an invalid program. I tried <Assembly: StrongNameIdentityPermission(SecurityAction.LinkDe mand,

PublicKey:="00...")>
but it creates the error "SecurityAction type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.public.dotnet.security &
microsoft.public.dotnet.languages.vb



Nov 20 '05 #6
Yes, you are totally right.

RequestMinimum will make sure the current assembly has the permission in
question before allowing it to execute.

Demand and LinkDemand examine the permissions of callers which is what you
need.

Sorry for the misleading info!!
"Brad" <no****@co.lane.or.us> wrote in message
news:O9****************@tk2msftngp13.phx.gbl...
Thank you. Yes, I found that RequestMinimum did not stop an unsigned or
different keyed program from accessing my class methods. So from what you said and from my testing/reading, it seems the highest level at which you
can restrict access based upon a proper key , is at the class....which is
fine.

Brad

"Eugene V. Bobukh [MS]" <eu******@online.microsoft.com> wrote in message
news:#B*************@tk2msftngp13.phx.gbl...
Unfortunately, this will not help :( Putting RequestMinimum for that
permission will verify that your assembly will execute ONLY if it is signed with the key mentioned in the permission attribute -- it's quite different
from what you need if I see it correctly.

I'm afraid there is no functionality now to achieve what you need :(
--
Eugene V. Bobukh

"Brad" <no****@co.lane.or.us> wrote in message
news:u8**************@TK2MSFTNGP11.phx.gbl...
Thanks!

"Tim Huntley" <ti**********@i2.co.uk> wrote in message
news:uk**************@TK2MSFTNGP10.phx.gbl...

Try SecurityAction.RequestMinimum instead of SecurityAction.LinkDemand...
Tim.
ti**********@i2.co.uk
"Brad" <no****@co.lane.or.us> wrote in message
news:u8*************@tk2msftngp13.phx.gbl...
> I've just used StrongNameIdentityPermission at the class level and it works
> fine. Can I use it similar to the following for the entire assembly? > <StrongNameIdentityPermission(SecurityAction.LinkD emand,
> PublicKey:="00...")>
>
> Rather than protect each class idependently I'd prefer to protect the entire
> assembly from being accessed by an invalid program. I tried <Assembly: > StrongNameIdentityPermission(SecurityAction.LinkDe mand,
PublicKey:="00...")>
> but it creates the error "SecurityAction type invalid on assembly"
>
> Thanks
>
> Brad
>
> Cross posted to microsoft.public.dotnet.security &
> microsoft.public.dotnet.languages.vb
>
>



Nov 20 '05 #7

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

Similar topics

26
10508
by: nospam | last post by:
Just wondering, What do you think the difference in performance would be between (1.) Compiled C# (2.) Compiled C++ (3.) and Assembly Language And how would the mix be if some if any of...
1
4337
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String...
0
1291
by: Bnaya | last post by:
I'm invoking the same Dll from Console application and WinForm application Both signed with SrongName. the class that I'm invoking is protected with StrongNameIdentityPermission Demand
0
1123
by: David Riddiford | last post by:
Hi I am trying to protect a class from being used by anything other than the application for which it was intended with StrongNameIdentityPermission using declarative code access security In my...
2
1845
by: James Hadwen | last post by:
I'm not sure whether I'm doing something wrong, or StrongNameIdentityPermission just doesn't work in 2.0 beta 2 yet. public class Class1 { public Class1() {...
2
1553
by: | last post by:
I am having a little bit of trouble with the syntax using attributes in classes. The compiler always complaints (VC ++ 2002) on StrongNameIdentityPermission. :-( The intention is secure my...
0
992
by: Simon Hart | last post by:
I can't seem to get this to work. I have applied the above attribute to a class library thats installed in the GAC. I am trying to use this shared assembly from a C# ASP.NET web form, but I am...
0
1015
by: archana | last post by:
Hi all, I am having application in 2003 where i have one class library and two console application. In class library i have one class to which i set strongnameidentitypermission. When i try...
2
2142
by: Ares Chen | last post by:
Hi, all In .NET 1.1, I can protect my assembly by use "StrongNameIdentityPermission", so only the caller with the special StrongName Sign can call my functions in the important assembly. But how...
0
7264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.