开发者

programatically get public key token using .snk file c#

开发者 https://www.devze.com 2022-12-22 07:55 出处:网络
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:

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

精彩评论

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

关注公众号