开发者

programatically get public key token using .snk file c#

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜