Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

where are thecertificates ?

Status
Not open for further replies.

ingresman

IS-IT--Management
Feb 17, 2003
1,541
GB
Hi Guys, hope you can help on this one.
I've got some personal certificates on my windows 2000 machine which I can see with certmgr.exe and the certificate tools from the browser but for the life of me I can't find them in the registry.
I tracked down an ActiveX ( which says the certificates are held under HKLM\software\microsoft\systemcertificates or HKCU\...
The code sample from aspencrypt does in fact show the certificates but if I navigate the the key in regedit, they are nowhere to be seen.
The software is expensive for what I want (just to enumerate them in some script code) so could any one shine any light on this
I will be very gratefull
 
Thanks for that, unfourtnalty groups are blocked at my site so I'll have a look tonight. What I did do was manage to create a script which tells me what they are and if they can be exportable or not:
Code:
On Error Resume Next
Const CAPICOM_STORE_OPEN_EXISTING_ONLY            = 128
Const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME       = 0
Const CAPICOM_CURRENT_USER_STORE                  = 2

dim storeNames
Dim storeType   

storeType = CAPICOM_CURRENT_USER_STORE
storeNames = Array("MY" )

For i = 0 To Ubound(storeNames)
 Set Store = CreateObject("CAPICOM.Store")
 Store.Open storeType, Storenames(i), CAPICOM_STORE_OPEN_EXISTING_ONLY
 If Err <> 0 Then
  WScript.Echo "Store: " & storeNames(i) & " not found"
    Else
  WScript.Echo "Store: " & storeNames(i) & " (" & Store.Certificates.Count & " certificate)"
  For Each Certificate In Store.Certificates
    If Certificate.HasPrivateKey Then
       simpleName = Certificate.getInfo(CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME) 
       set pk = certificate.privatekey
       if pk.isExportable then
          exportStatus = "exportable"
       else
          exportStatus = "NOT exportable"
       end if
    wscript.echo "Certificate " & simpleName & " is " & exportStatus
    End If
  Next
 End If
 Set Store = Nothing
Next
You need to put it into a file with an extention of .vbs and run it from the command prompt by typing cscript <name>.vbs and it should show your personal certificates.
I'd be gratefull if some people could run it for me across the globe (aint the web great?) and tell me what happended i.e. did it correctly report that you had x certificates and the export status is correct and the op system you run. It looks ok on w2000 but slightly differenty on NT4. Dont tell me the name it gives !!
many thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top