473,238 Members | 1,705 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,238 software developers and data experts.

Restricting access to Assembly.LoadFrom call within an assembly based on strong names

Hi,

I use the Assembly.LoadFrom call in my code to load assemblies dynamically.
This call currently loads both signed and unsigned assemblies.
It now needs to be changed to load only signed assemblies. Again only those
signed assemblies with known public keys need to be loaded.
Is there an easy way to implement this?

Regards
Surya

Nov 15 '05 #1
3 2834
Surya,

You aren't going to be able to do this. You are going to have to
implement a load mechanism yourself and then have all of your code go
through that mechanism.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"surya" <su************************@honeywell.com> wrote in message
news:Ou**************@TK2MSFTNGP10.phx.gbl...
Hi,

I use the Assembly.LoadFrom call in my code to load assemblies dynamically. This call currently loads both signed and unsigned assemblies.
It now needs to be changed to load only signed assemblies. Again only those signed assemblies with known public keys need to be loaded.
Is there an easy way to implement this?

Regards
Surya

Nov 15 '05 #2
Nicholas,

Thanks for the reply.

Can I get the public key of a signed assembly at runtime using the Evidence
of the assembly? This would help in determining whether the assembly can be
trusted.

Regards
Surya

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uG**************@TK2MSFTNGP12.phx.gbl...
Surya,

You aren't going to be able to do this. You are going to have to
implement a load mechanism yourself and then have all of your code go
through that mechanism.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"surya" <su************************@honeywell.com> wrote in message
news:Ou**************@TK2MSFTNGP10.phx.gbl...
Hi,

I use the Assembly.LoadFrom call in my code to load assemblies

dynamically.
This call currently loads both signed and unsigned assemblies.
It now needs to be changed to load only signed assemblies. Again only

those
signed assemblies with known public keys need to be loaded.
Is there an easy way to implement this?

Regards
Surya


Nov 15 '05 #3
Surya,

You can get this by using the Assembly class instance that represents
the Assembly. The Name property will expose an AssemblyName instance. From
there, you can call the GetPublicKey method on the AssemblyName instance and
get the key.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"surya" <su************************@honeywell.com> wrote in message
news:OY*************@TK2MSFTNGP10.phx.gbl...
Nicholas,

Thanks for the reply.

Can I get the public key of a signed assembly at runtime using the Evidence of the assembly? This would help in determining whether the assembly can be trusted.

Regards
Surya

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:uG**************@TK2MSFTNGP12.phx.gbl...
Surya,

You aren't going to be able to do this. You are going to have to
implement a load mechanism yourself and then have all of your code go
through that mechanism.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"surya" <su************************@honeywell.com> wrote in message
news:Ou**************@TK2MSFTNGP10.phx.gbl...
Hi,

I use the Assembly.LoadFrom call in my code to load assemblies

dynamically.
This call currently loads both signed and unsigned assemblies.
It now needs to be changed to load only signed assemblies. Again only

those
signed assemblies with known public keys need to be loaded.
Is there an easy way to implement this?

Regards
Surya



Nov 15 '05 #4

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

Similar topics

0
by: Michael | last post by:
Hi, I have an assembly that has a strong name against it and in this assembly I have a method that will create instance of other classes, within the same assembly, and call a method. I use...
0
by: surya | last post by:
Hi, I am using Assembly.LoadFrom within a web service to load assemblies from a web site. This web site is in the same machine where I am running the web service. The...
2
by: Mário Sobral | last post by:
Hi, I created an assembly (let's call it assembly (B)) that returns a localized resource for a given key (similar to System.Globalization.ResourceManager). I checks if the caller assembly (let's...
3
by: Leonardo D'Ippolito | last post by:
Hello sirs, I am trying to understand how strong names work. Suppose I have lib.dll (a .net library), and also MyApplication.exe (a .NET WinApp) . MyApplication uses lib.dll . Suppose someone...
1
by: Jimski | last post by:
Hi all, I am creating an assembly that will access a database to return record details. I need to deploy it to a 3rd Party and they will then be able to use the assembly in their code to...
0
by: Oenone | last post by:
I have created a number of "plug-in" DLLs for my ASP.NET application which are dynamically loaded at run-time. This is done by locating the DLL file on disk and loading it using the...
3
by: Mark Keogh | last post by:
Hi, Why is everything some confusng when MS are involved ;-) Anyway, I have my excel export routines working fine, now when I try to build them into my assembly, which has a strong name, I get...
14
by: Nak | last post by:
Hi there I'm trying to use the Microsoft Web Browser within a strong names .NET assembly that I have written. Unfortunately I am getting the following linker problem as the Interop DLL that was...
4
by: James | last post by:
Hi, I have just upgraded a user machine to Vista (our first) as a test. Unfortunately a couple of our apps are failing due to Vista... 1. One app that loads an assembly from an Intranet...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.