Extracting private key from a strong name file?

南笙酒味 提交于 2019-12-06 09:35:24

问题


As the title states, does anyone know how to extract the private key from an snk file? We want to use the private key from the StrongName for encryption purposes. I read in:
http://msdn.microsoft.com/en-us/library/k5b5tt23(VS.80).aspx that sn -o key.snk will extract both the private/public key if they exist in the file but i tried it and its just a long CSV formatted string with no distinction between what is the private key and what is the public key.


回答1:


In the document you link, next to the -o flag, it says:

If the infile contains a key pair with a private key, the private key is also extracted.

Are you certain there is a private key in the file?

You can run sn -p key.snk to get the public key, and compare that to the output of sn -o key.snk - if they are the same, the key file only has a public key, if not, the difference is the private key.



来源:https://stackoverflow.com/questions/3412011/extracting-private-key-from-a-strong-name-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!