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.
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
you could just re-install the key with a new container name:
sn -i mykey.pfx VS_ABAB1234ABAB1234
来源:https://stackoverflow.com/questions/6443642/how-to-get-container-name-for-pfx-key