473,654 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

StrongNameIdent ityPermission at Assembly level?

I've just used StrongNameIdent ityPermission at the class level and it works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIden tityPermission( SecurityAction. LinkDemand,
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:
StrongNameIdent ityPermission(S ecurityAction.L inkDemand, PublicKey:="00. ..")>
but it creates the error "SecurityAc tion type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.publi c.dotnet.securi ty &
microsoft.publi c.dotnet.langua ges.vb
Nov 20 '05 #1
6 2999
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 StrongNameIdent ityPermission 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******** *****@tk2msftng p13.phx.gbl...
I've just used StrongNameIdent ityPermission at the class level and it works fine. Can I use it similar to the following for the entire assembly?
<StrongNameIden tityPermission( SecurityAction. LinkDemand,
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:
StrongNameIdent ityPermission(S ecurityAction.L inkDemand, PublicKey:="00. ..")> but it creates the error "SecurityAc tion type invalid on assembly"

Thanks

Brad

Cross posted to microsoft.publi c.dotnet.securi ty &
microsoft.publi c.dotnet.langua ges.vb

Nov 20 '05 #3
Thanks!

"Tim Huntley" <ti**********@i 2.co.uk> wrote in message
news:uk******** ******@TK2MSFTN GP10.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******** *****@tk2msftng p13.phx.gbl...
I've just used StrongNameIdent ityPermission at the class level and it

works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIden tityPermission( SecurityAction. LinkDemand,
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:
StrongNameIdent ityPermission(S ecurityAction.L inkDemand,

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

Thanks

Brad

Cross posted to microsoft.publi c.dotnet.securi ty &
microsoft.publi c.dotnet.langua ges.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******** ******@TK2MSFTN GP11.phx.gbl...
Thanks!

"Tim Huntley" <ti**********@i 2.co.uk> wrote in message
news:uk******** ******@TK2MSFTN GP10.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******** *****@tk2msftng p13.phx.gbl...
I've just used StrongNameIdent ityPermission at the class level and it

works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIden tityPermission( SecurityAction. LinkDemand,
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:
StrongNameIdent ityPermission(S ecurityAction.L inkDemand,

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

Thanks

Brad

Cross posted to microsoft.publi c.dotnet.securi ty &
microsoft.publi c.dotnet.langua ges.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******@onlin e.microsoft.com > wrote in message
news:#B******** *****@tk2msftng p13.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******** ******@TK2MSFTN GP11.phx.gbl...
Thanks!

"Tim Huntley" <ti**********@i 2.co.uk> wrote in message
news:uk******** ******@TK2MSFTN GP10.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******** *****@tk2msftng p13.phx.gbl...
I've just used StrongNameIdent ityPermission at the class level and it

works
fine. Can I use it similar to the following for the entire assembly?
<StrongNameIden tityPermission( SecurityAction. LinkDemand,
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: StrongNameIdent ityPermission(S ecurityAction.L inkDemand,

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

Thanks

Brad

Cross posted to microsoft.publi c.dotnet.securi ty &
microsoft.publi c.dotnet.langua ges.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******** ********@tk2msf tngp13.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******@onlin e.microsoft.com > wrote in message
news:#B******** *****@tk2msftng p13.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******** ******@TK2MSFTN GP11.phx.gbl...
Thanks!

"Tim Huntley" <ti**********@i 2.co.uk> wrote in message
news:uk******** ******@TK2MSFTN GP10.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******** *****@tk2msftng p13.phx.gbl...
> I've just used StrongNameIdent ityPermission at the class level and it works
> fine. Can I use it similar to the following for the entire assembly? > <StrongNameIden tityPermission( SecurityAction. LinkDemand,
> 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: > StrongNameIdent ityPermission(S ecurityAction.L inkDemand,
PublicKey:="00. ..")>
> but it creates the error "SecurityAc tion type invalid on assembly"
>
> Thanks
>
> Brad
>
> Cross posted to microsoft.publi c.dotnet.securi ty &
> microsoft.publi c.dotnet.langua ges.vb
>
>



Nov 20 '05 #7

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

Similar topics

26
10541
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 these languages had to hit against a SQL Server database
1
4373
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 *ipAddress = S""; IDictionary *server_config = dynamic_cast<IDictionary*>(ConfigurationSettings::GetConfig("ServerAddress") ); ipAddress = dynamic_cast<String*>(server_config->get_Item(S"IP"));
0
1316
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
1130
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 solution, I have a Windows Forms Project called MainApp which I have signed with a strong name key. I also have a Class Library Project called CallClass, which I have signed with the same key CallClass contains one class called MyClass which is...
2
1853
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() { System.Diagnostics.Debug.Assert(Assembly.GetCallingAssembly().GetName().GetPublicKey().Length != 0);
2
1561
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 class so that it can only be inherited and instantiated by software that has the strong key of my company. A webcast suggested something like this. using namespace System::Security::Permissions;
0
997
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 getting a SecurityException: Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed The ASP.NET is strong named with the...
0
1032
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 to use this class in first console application which is having same publickkey as i set in strongnameidentiypermission it works. and for second console application having different public key it gives me error.
2
2147
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 can I do this with .NET 2.0? I find some detail with this topic from a link as below http://msdn.microsoft.com/en-us/library/system.security.permissions.strongnameidentitypermission.aspx In the .NET Framework versions 1.0 and 1.1, identity...
1
8475
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1592
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.