How does one convert a .snk file (for strong-name signing .NET assemblies) into a password protected .pfx file suitable for the same purpose?
Edit: to clarify, suppose I create a project in VS and in project properties, Signing, click 'New strong name key file', and elect not to protect the key file with a password:
Now imagine that a year later I change my mind and want to add a password – without trashing the assembly's identity by creating a new keypair. How do I do this?
Best Answer
You do not convert however you can sign an existing snk file using the Strong Name Tool (Sn.exe). (There are a few steps involved if the snk is already been protected as you need to split the strong-name part from the certificate).
The pfx is a private certificate that is created for you in Visual Studio when you select the password protection option. The password you enter is used to protect this certificate.
Is this for development or for commercial release? I would not recommend signing the assemblies with private key for development.
From the CLR Inside Out Article:
Read CLR Inside Out (MSDN) Article on Using Strong Name Signatures.
HTH,