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

Detecting Signed Code

I'm building a "plugin" architecture into my application where it will automatically detect (through Reflection) assemblies that are dropped into a folder as plugins and execute them when necessary. However, I do not want just anyone to be able to create an assembly and drop it in and have it execute. So, I'd like to sign the assemblies with a private key and then have the application verify that the assembly is signed properly before it will execute code contained in it. What is the best way to do this?

Thanks,

Ian
Nov 15 '05 #1
1 1394
Hi,

You shuld look into Assembly.Evidence property and search for a StrongName
class.
Code snippet:
Evidence e = Assembly.GetExecutingAssembly().Evidence;

foreach (object o in e)

{

StrongName sn = o as StrongName;

if (sn != null)

Console.WriteLine(sn.PublicKey);

}
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"R. Ian Lee" <an*******@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
I'm building a "plugin" architecture into my application where it will automatically detect (through Reflection) assemblies that are dropped into a
folder as plugins and execute them when necessary. However, I do not want
just anyone to be able to create an assembly and drop it in and have it
execute. So, I'd like to sign the assemblies with a private key and then
have the application verify that the assembly is signed properly before it
will execute code contained in it. What is the best way to do this?
Thanks,

Ian

Nov 15 '05 #2

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

Similar topics

3
by: Karthik | last post by:
Hi, I am writing this application that needs a lot of arithmetic calculations. I was wondering if C++ language specifies any way of detecting arithmetic overflows. Let us consider the following...
2
by: Paul Emmons | last post by:
Can anyone suggest example code, or how to proceed, in adding or subtracting two long long integers (I'm working in gcc with Linux, where a long long is 64 bits) and determining whether an overflow...
6
by: Rob | last post by:
int *p; p = malloc(1); free(p); /* */ In the above code, how do I detect that variable p points to nothing?
25
by: junky_fellow | last post by:
Is there any way by which the overflow during addition of two integers may be detected ? eg. suppose we have three unsigned integers, a ,b, c. we are doing a check like if ((a +b) > c) do...
12
by: Thomas Carter | last post by:
Imagine that there is some include file f.h that contains the following line: typedef unsigned int ui32 ; My question is: If I have a C source file F.c that includes f.h, is it possible for...
7
by: pocmatos | last post by:
Hi all, What the best way to detect under/over flow in a program with a lot of computations? For example: #include <iostream> #include <limits> using namespace std;
3
by: jobo | last post by:
Hello, I'm trying to detect the EOF for scanf. But for some reason I can't get it to trigger. What am I doing wrong? Thanks. int puzzle; // Puzzle data structure int i, j, count; //...
6
by: Andre Majorel | last post by:
How do you compute an off_t with overflow detection ? Ideally, the target language is C89/C90 and the target platform is reasonably recent versions of the major Unixen. If there is no practical...
10
by: =?iso-8859-2?B?SmFuIFJpbmdvuQ==?= | last post by:
Hello everybody, this is my first post to a newsgroup at all. I would like to get some feedback on one proposal I am thinking about: --- begin of proposal --- Proposal to add...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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...
0
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,...

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.