473,402 Members | 2,046 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,402 software developers and data experts.

Assembly signing

Just a question. If i have an app with a dll version 1.5 and I replace it
with version 1.6 everithing works fine.
If i change the strong name however the app crash, but this is fine.
My curiosity is then: the various System, System.data and so on are signed?
If so, how can the mono project prot them without having the private key?

this is just for curiosity, no real need,

Thanks!
Cristian Mori
Nov 1 '05 #1
6 1715
Hi Cristian,
Welcome to Newsgroup!

Based on DonNet Framework, the assembly resolver goes through in the order
below to find an appropriate assembly file.

the 1st location that the assembly resolver uses to find an assembly is
the global assembly cache (GAC). The GAC is a machine-wide code cache that
contains assemblies that have been installed for machine-wide use. The GAC
allows administrators to install assemblies once per machine for all
applications to use. To avoid system corruption, the GAC accepts only
assemblies that have valid digital signatures and public keys. 2nd, If the
assembly resolver cannot locate the assembly using the GAC, it performs a
search through a series of directories relative to the root directory of
the application. This search is known as probing. Probing will search only
in directories that are at or below the APPBASE directory (recall that the
APPBASE directory is the directory that contains the application's
configuration file).

The Mono is the third party project. From my experience, it should also has
one similar algorithm to locate the assembly file. If you want to get more
details, you can consult it from the relevant Mono Web Site.

I hope the above information is useful for you. If you have any questions
or concerns, please feel free to let me know.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 2 '05 #2
Hi Terry, Thanks for your reply.

Thanks for the explanation, but I still miss one thing.
Id I use system.Data, my app will have the public key of the signed
assembly, in order to decript it at runtime.
If I take my app and I move it in a mono system, the same app runs without
recompiling, and this is the "magic" of .NET.
However, how could it be possible if the two assembly (.NET Framework and
Mono Version) doesn't have the same strong key?

Thanks
Cristian

""TerryFei"" wrote:
Hi Cristian,
Welcome to Newsgroup!

Based on DonNet Framework, the assembly resolver goes through in the order
below to find an appropriate assembly file.

the 1st location that the assembly resolver uses to find an assembly is
the global assembly cache (GAC). The GAC is a machine-wide code cache that
contains assemblies that have been installed for machine-wide use. The GAC
allows administrators to install assemblies once per machine for all
applications to use. To avoid system corruption, the GAC accepts only
assemblies that have valid digital signatures and public keys. 2nd, If the
assembly resolver cannot locate the assembly using the GAC, it performs a
search through a series of directories relative to the root directory of
the application. This search is known as probing. Probing will search only
in directories that are at or below the APPBASE directory (recall that the
APPBASE directory is the directory that contains the application's
configuration file).

The Mono is the third party project. From my experience, it should also has
one similar algorithm to locate the assembly file. If you want to get more
details, you can consult it from the relevant Mono Web Site.

I hope the above information is useful for you. If you have any questions
or concerns, please feel free to let me know.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 2 '05 #3
Hi Cristian,

For the execution of the .Net application, all its referenced assemblies
should be found. If not, the application will not run. In Microsoft .Net
Framework, the CLR(common language runtime) will load the referenced
strong-name assembly from GAC or its private directory according to the
probing steps listed at the previous post.

It should be the same in MONO. When MONO loads the application, it should
search the referenced assembly and then load it for the execution. Since
MONO is a virtual machine as the same the MS .net CLR, it should have the
corresponding location to store the strong-name assemblies, as the GAC in
MS .Net.

For your scenario, MONO should firstly locate the System.Data from its GAC.
Then the application could run smoothly. This is the reason why your
application could run without any error.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 3 '05 #4
OK, but I still miss one think.
If I use Syste.Data in my app, then the public key of system.data is stored
in my app and it is used to decript the assembly when loaded.

Moving to mono, my app still use the stored public key of system.data (the
microsoft .net one) to decrypt and load the System.Data of mono.
So I guess that the System.Data of mono must be signed with the same key of
the microsoft one.

What am I missing?

Cristian
""TerryFei"" wrote:
Hi Cristian,

For the execution of the .Net application, all its referenced assemblies
should be found. If not, the application will not run. In Microsoft .Net
Framework, the CLR(common language runtime) will load the referenced
strong-name assembly from GAC or its private directory according to the
probing steps listed at the previous post.

It should be the same in MONO. When MONO loads the application, it should
search the referenced assembly and then load it for the execution. Since
MONO is a virtual machine as the same the MS .net CLR, it should have the
corresponding location to store the strong-name assemblies, as the GAC in
MS .Net.

For your scenario, MONO should firstly locate the System.Data from its GAC.
Then the application could run smoothly. This is the reason why your
application could run without any error.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 3 '05 #5
You can use sn.exe, reflector, or some other program to determine what the
public key token is of the system assemblies in mono and compare them to
those used by the commercial release of .net. This will provide more
evidence that can be used to figure out what is going on.
"MoriCristian" <Cr**********@nospam.nospam> wrote in message
news:2E**********************************@microsof t.com...
OK, but I still miss one think.
If I use Syste.Data in my app, then the public key of system.data is
stored
in my app and it is used to decript the assembly when loaded.

Moving to mono, my app still use the stored public key of system.data (the
microsoft .net one) to decrypt and load the System.Data of mono.
So I guess that the System.Data of mono must be signed with the same key
of
the microsoft one.

What am I missing?

Cristian
""TerryFei"" wrote:
Hi Cristian,

For the execution of the .Net application, all its referenced assemblies
should be found. If not, the application will not run. In Microsoft .Net
Framework, the CLR(common language runtime) will load the referenced
strong-name assembly from GAC or its private directory according to the
probing steps listed at the previous post.

It should be the same in MONO. When MONO loads the application, it should
search the referenced assembly and then load it for the execution. Since
MONO is a virtual machine as the same the MS .net CLR, it should have the
corresponding location to store the strong-name assemblies, as the GAC in
MS .Net.

For your scenario, MONO should firstly locate the System.Data from its
GAC.
Then the application could run smoothly. This is the reason why your
application could run without any error.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 3 '05 #6
Hi Cristian,

The SN.exe utility of .Net Framework is used to generate public key for
assembly and it ensure the produced key globally unique. As I know,
Microsoft should not have shared the public key with MONO. So the
System.Data assembly of mono should not has the same public key as the same
to .Net System.Data Assembly. So I think MONO should has some internal
implementation to support referencing .Net provided strong-name assembly,
for example System.Data etc. This should be one MONO compatible design.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 4 '05 #7

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

Similar topics

4
by: Reinhold Schalk | last post by:
Hello, somewhere i've read that using strong names does assure two things: 1. Assure that the content of the assembly is not modified (that's ok in my opinion) 2. Assure that the assembly is...
3
by: bob | last post by:
Hello, I thought assembly signing might add protection against people reverse engineering my program, removing the protection and using it illegally. But it seems they can just stop the clr...
2
by: Henrik Skak Pedersen | last post by:
Hello, I have a class which is beeing serialized/deserialized using the BinaryFormatter class. That has been working with no problems until I signed all my assemblies. Now I get a...
2
by: steve bull | last post by:
When I run FXCop(1.32) against my project I keep getting the error "Assemblies should have strong names" and cannot get rid of the message. I edited the assembly info :
1
by: AVL | last post by:
Hi I need some clarification on signing. what does it mean--signing an assembly? where is ti used? How is it used?
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
1
by: Jason Richmeier | last post by:
I have encountered an error while attempting to sign an assembly. I have become quite frustrated since I seem to be going in circles and making no progress. Hopefully someone will have the magic...
3
by: groovyjman21 | last post by:
Hi, I am using FXCop on my c# project and it is complaining about signing the assembly with a strong name key. All the documentation I can find says to do: using System.Reflection; .... ...
1
by: GMiller | last post by:
I'm trying to sign my assembly so that I can use the caspol.exe tool to create a permissions set for it. This is my first experience signing the assembly. In VS 2005 I went to...
0
by: adam3223 | last post by:
I have a mixed code dll which will be used by many developers to build applications on top of. I've read signing an assembly is recommended to rule out any naming conflicts, and increase security....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.