.netcryptographystrongnameprivate-keysnk

Export snk from non-exportable key container


I have created a snk file using sn -k KeyFile.snk
I installed it on my test machine and signed a couple of files for use as a license file.
I exported the public key and embed it in my application in order to verify the license.

Now the problem is that i lost my Keyfile.snk and i want to install the key pair on a production server. I can't generate a new keypair since i have already issued licenses using the old keypair and the application is already installed on several customer's PCs.

I tried exporting it from my test machine's key container but it is set as non-exportable.
I used mimikatz to force an export. It worked, but it returned a .pvk file.
And now i'm stuck.

Any idea to how i should proceed?
Thank you.


Solution

  • I'm the author of mimikatz, don't you know that you can convert PVK with OpenSSL ?

    http://blog.gentilkiwi.com/cryptographie/openssl-conversion-pvk-microsoft-privatekey-blob

    You can also make a pfx/p12 with the public certificate (sn -p) and the converted PEM key :)