[Mono-list] Strong name support ?

Sébastien Pouliot spouliot@videotron.ca
Sun, 26 Oct 2003 10:17:08 -0500


Jarek,

StrongNames are working but key containers aren't yet supported by Mono.

The easiest way to compile your project is to change the key location from a
container to a file.
[assembly: AssemblyKeyFile("mykey.snk")]

You got the key creation right (sn -k) but the import (from the file to the
container) isn't required in this case.

Note that if you delay sign your assembly, you'll need to resign it after
compilation (sn -R).

Sebastien Pouliot
Security Architect, Motus Technologies, http://www.motus.com
work: spouliot@motus.com
home: spouliot@videotron.ca
blog: http://pages.infinit.net/ctech/poupou.html


-----Original Message-----
From: mono-list-admin@lists.ximian.com
[mailto:mono-list-admin@lists.ximian.com]On Behalf Of Jaroslaw Kowalski
Sent: 26 octobre 2003 06:25
To: Mono List
Subject: [Mono-list] Strong name support ?


Hi!

I've recently updated mono & mcs from CVS and now mcs can't compile my
program anymore.

I use the attribute:

[assembly: AssemblyKeyName("mykey")]

to sign my assembly. Previously the attribute was just ignored, now the
compiler complains like this:

------------------
Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
range
in <0x001df> Mono.Security.Cryptography.CryptoConvert:ToCapiPublicKeyBlob
(System.Security.Cryptography.RSA)
in <0x0006b> Mono.Security.Cryptography.CryptoConvert:ToCapiKeyBlob
(System.Security.Cryptography.RSA,bool)
in <0x0002d> Mono.Security.StrongName:get_PublicKey ()
in <0x00441> System.Reflection.Emit.AssemblyBuilder:SetCustomAttribute
(System.Reflection.Emit.CustomAttributeBuilder)
in <0x00cd4> Mono.CSharp.Attribute:ApplyAttributes
(Mono.CSharp.EmitContext,object,object,Mono.CSharp.Attributes)
in <0x001f9> Mono.CSharp.RootContext:EmitCode ()
in <0x0080e> Mono.CSharp.Driver:MainDriver (string[])
in <0x0001b> Mono.CSharp.Driver:Main (string[])
-------------------------

I found the sn.exe utility and ran the following commands to create the
keypair and put it into "mykey" container.

mono sn.exe -k mykey.snk
mono sn.exe -i mykey.snk mykey

but it didn't help. I'm running RedHat 9.

Any advice?

Jarek

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list