Extract private key from file with strong name?

As the title says, does anyone know how to extract the private key from the snk file? We want to use the private key from 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 private and public key if they exist in the file, but I tried it and its just a long string in CSV format with no distinction between the private key and what is the public key.

+3
source share
1 answer

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

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

Are you sure the file has a private key?

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

+2
source

Source: https://habr.com/ru/post/1441200/


All Articles