Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / June 2005

Tip: Looking for answers? Try searching our database.

ilasm and delayed signing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brian R. - 14 Jun 2005 00:08 GMT
I have some IL that I need to reassemble back into a primary interop
assembly.  I want my developers to be able to do this on their own, but I
don't want them to have the private/public key pair.  They have access to the
public key.

How can I have them assemble the IL (using ILASM) and delay sign the code
outside the Visual Studio environment?  There doesn't seem to be a switch in
the ilasm interface to do it.

Do I need to add a delaysigned attribute tot eh assembly information of the
il then sign it with just the public key (/key option in ilasm) to have a
delayed signed object?

Thanks

Signature

Brian R.

"Peter Huang" [MSFT] - 14 Jun 2005 04:46 GMT
Hi

We can use the al and sn tool to do the delay sign.
Use the sn -p to extract the publickey only,
use the al tool to delay sign the dll.
And use the sn -R to resign the dll.

Here is some information for your reference.

Obtaining the Public Key
To delay sign an assembly, you must have access to the public key. You can
either obtain the real public key from the organization in your company
that will do the eventual signing, or create a public key using the Strong
Name Tool (Sn.exe).

The following Sn.exe command creates a test public/private key pair and
saves it in the file TestKeyPair.snk. The ¨Ck option specifies to Sn.exe to
create a new key pair and save it in the specified file.

sn ¨Ck TestKeyPair.snk
You can extract the public key from the file containing the test key pair.
The following command extracts the public key from TestKeyPair.snk and
saves it in PublicKey.snk.

sn ¨Cp TestKeyPair.snk PublicKey.snk
Delay Signing an Assembly
Once you have obtained or created the public key, use the Assembly Linker
(Al.exe) to compile the assembly and specify delayed signing.

The following Al.exe command creates a strong-named satellite assembly for
the application MyApp from the strings.ja.resources file.

al /t:lib /embed:strings.ja.resources /culture:ja /out:MyApp.resources.dll
/delay+ /keyfile:PublicKey.snk
The /delay+ option specifies to delay sign the assembly. The /keyfile:
option specifies the name of the key file containing the public key to use
to delay sign the assembly.

For more information on delayed signing, see Delay Signing an Assembly.

Note that strong-named assemblies contain version information that the
runtime uses to determine which assembly to use to meet a binding request.
For more information on this topic, see Assembly Versioning.

Re-signing an Assembly
At some later date, a delay-signed satellite assembly must be re-signed
with the real key pair. You can do this using Sn.exe.

The following Sn.exe command signs MyApp.resources.dll with the real key
pair stored in the file RealKeyPair.snk. The ¨CR option specifies to Sn.exe
to re-sign a previously signed or delay-signed assembly.

sn ¨CR MyApp.resources.dll RealKeyPair.snk

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcreatingsatelliteassemblies.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.