How to get Container name for PFX key?

2019-05-12 18:58发布

问题:

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.

回答1:

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



回答2:

you could just re-install the key with a new container name:

sn -i mykey.pfx VS_ABAB1234ABAB1234