Search code examples
visual-studio-2010cryptographypfxassembly-signing

How to get Container name for PFX key?


Some time ago I installed my PFX key into Container using command like this:

sn -i mykey.pfx VS_XXX

but two months later I forgot the Container name (VS_XXX), so my question is: How to get than name back? I know key name, I have this key, I know the key pass phrase.


Solution

  • Download the Keypal utility and double click it, you will find all the names of the key containers. You can choose between user profile and machine profile.

    Alternatively, enumerate the certificate store to find the certificate of interest via its subject and then you can use CertGetCertificateContextProperty to get the value for PCERT_KEY_PROV_INFO_PROP_ID. This approach requires the use of Microsoft's cryptoAPI