mono.snk - installation and usage |
Gentoo Mono Handbook
How to make signed assembly? InternalsVisibleTo |
Mono StrongName - version 4.5.2.0 StrongName utility for signing assemblies Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed. Public Key: 002400000480000094000000060200000024000052534131000400000100010079159977d2d03a 8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c 3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fd dafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00 65d016df Public Key Token: 0738eb9f132ed756
byte[]
cotnaining the snk file, like
byte[] snk = File.ReadAllBytes("YourSnkFile.snk");
use
byte[] publicKey = GetPublicKey(snk);
byte[] publicKeyToken = GetPublicKeyToken(publicKey);
with these utility methods
public static byte[] GetPublicKey(byte[] snk)
{
var snkp = new System.Reflection.StrongNameKeyPair(snk);
byte[] publicKey = snkp.PublicKey;
return publicKey;
}
public static byte[] GetPublicKeyToken(byte[] publicKey)
{
using (var csp = new SHA1CryptoServiceProvider())
{
byte[] hash = csp.ComputeHash(publicKey);
byte[] token = new byte[8];
for (int i = 0; i < 8; i++)
{
token[i] = hash[hash.Length - i - 1];
}
return token;
}
}
/var/calculate/remote/distfiles/egit-src/mono-packaging-tools.git/mono.snkSRC_URI="${REPOSITORY}/archive/${EGIT_BRANCH}/${EGIT_COMMIT}.zip -> ${PF}.zip gac? ( mirror://gentoo/mono.snk.bz2 )"