Reputation: 119
How can I migrate a key container from one machine to another?
I have a key container on an old machine that is used for strong naming assemblies.
Currently I am in the process of migrating the project to a newer machine.
Unfortunately the key container on the old machine is marked as non-exportable, but I managed to export it using mimikatz.
The result was a PVK file (private key), that I converted to an XML file (RSAKeyValue) using the Chilkat library.
The xml file could then be imported to a key container on the new machine using aspnet_regiis.
However, when building the project on the new machine, I get this Linker error:
LINK : fatal error LNK1256: ALINK operation failed (80040405) : The key container name '...' does not exist
I noticed that there's a difference between key containers that are created with aspnet_regiis and sn.exe.
Key containers generated with sn.exe can be found by the Linker, but key containers generated with aspnet_regiis are not found (LNK1256 error from above).
But in order to install the same key container with sn.exe, it needs to be a .snk file, which I didn't manage to convert yet.
If I can convert it to a .snk file, it doesn't necessarily have to be imported to a key container, because I could use the strong name key file for signing as well.
Upvotes: 1
Views: 268