[Mono-bugs] [Bug 49785][Nor] New - AssemblyBuilder should extract the public key from the .snk file
Fri, 17 Oct 2003 09:03:12 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by email@example.com.
--- shadow/49785 2003-10-17 09:03:12.000000000 -0400
+++ shadow/49785.tmp.3357 2003-10-17 09:03:12.000000000 -0400
@@ -0,0 +1,48 @@
+Product: Mono/Class Libraries
+Summary: AssemblyBuilder should extract the public key from the .snk file
+When a user specifies a AssemblyKeyFile attribute for an assembly,
+AssemblyBuilder should extract the public key from the file, instead of
+treating the whole file as a public key, as it is done now.
+From Sebastien Pouliot:
+When you generate a SNK file (sn -k) you get a SNK file with BOTH a
+public and private key. However you ONLY embed the public key inside
+the assembly. It's worth mentioning that many people use the SNK
+extension for both the keypair (public/private) or the public key.
+So this can be misleading.
+sn -p hello.snk hello.pub
+extracts the public key from the SNK file - giving us a 160 bytes
+file. This is the file to embed into the assembly.
+There is some managed code for converting CAPI structures(both
+private/public and public
+byte snkeypair = ...
+// read data from private/public SNK file into snkbuf
+RSA rsa = CryptoConvert.FromCapiPrivateKeyBlob (snkbuf);
+byte snpubkey = CryptoConvert.ToCapiPublicKeyBlob (rsa);
+// save data into assembly
+We should probably extract this code from Mono.Security and put a copy into