Is it possible开发者_如何转开发 to create a .snk file programatically and using that file I want to get the public key token?
Something like this ought to do what you want:
CspParameters parms = new CspParameters();
parms.KeyNumber = 2;
RSACryptoServiceProvider provider = new RSACryptoServiceProvider(parms);
byte[] array = provider.ExportCspBlob(!provider.PublicOnly);
StrongNameKeyPair snk = new StrongNameKeyPair(array);
byte[] publicKey = snk.PublicKey;
精彩评论