3

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.

Dariusz
  • 15,573
  • 9
  • 52
  • 68

3 Answers3

6

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

rboy
  • 2,018
  • 1
  • 23
  • 35
Raj
  • 1,113
  • 1
  • 17
  • 34
0

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

sn -i mykey.pfx VS_ABAB1234ABAB1234
Sean
  • 1,025
  • 9
  • 17
  • 1
    As far as I know, this fails with "Failed to install key pair -- Object already exists." if you already have the key installed with the different container. – famousgarkin Feb 28 '13 at 12:09
0

Update for 2021: Found answer here https://stackoverflow.com/a/59999581/9862613

You can get the container name using SnInstallPfx tool:

SnInstallPfx.exe yourKey.pfx
riskeez
  • 61
  • 4
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30537858) – AfterFray Dec 10 '21 at 04:41
  • @Jamjitul thanks. I've added usage example now – riskeez Dec 10 '21 at 21:39