Jump to content

import protected pfx file to Windows XP


Recommended Posts

Hi

i try import protected pfx file to Windows XP by CertUtil

i need add a pfx to this CertificateStoreName:

  • "Trusted Root Certification Authorities"
  • "Trusted Publishers"
  • "Third-Party Root Certification Authorities"

certutil import pfx to  Windows 10 by this command
 

Local $path_OSSys=@WindowsDir&"\System32"
    If @OSArch="X64" Or  @OSArch="IA64" Then $path_OSSys=@WindowsDir&"\SysWOW64"

    $command="certutil.exe -f -p " & $password &'  -importPFX TrustedPublisher "' & $pfx & '"'
    $iPID = Run($path_OSSys&"\CMD.exe" & " /C " & $command,"",@SW_HIDE)
    ProcessWaitClose($iPID)

    $command="certutil.exe -f -p " & $password &'  -importPFX AuthRoot"' & $pfx & '"'
    $iPID = Run($path_OSSys&"\CMD.exe" & " /C " & $command,"",@SW_HIDE)
    ProcessWaitClose($iPID)

work fine.

 

in Windows XP :

i add certutil.exe and certadm.dll (Windows Server 2003 -v5.2.3790) to System Folder ($path_OSSys)

but it can't support CertificateStoreName and only add this command line

Local $path_OSSys=@WindowsDir&"\System32"
    If @OSArch="X64" Or  @OSArch="IA64" Then $path_OSSys=@WindowsDir&"\SysWOW64"

    $command="certutil.exe -f -p " & $password &'  -importPFX "' & $pfx & '"'
    $iPID = Run($path_OSSys&"\CMD.exe" & " /C " & $command,"",@SW_HIDE)
    ProcessWaitClose($iPID)

it add to pepole only.

 

How to add pfx to "Trusted Root Certification Authorities", "Trusted Publishers" and "Third-Party Root Certification Authorities"  (Windows XP only)?

how to convert and use X509Store (C# codes here)



  X509Store store = new X509Store(StoreName.TrustedPublisher, StoreLocation.LocalMachine);
  store.Open(OpenFlags.ReadWrite);
  store.Add(new X509Certificate2(PFX, "myPass", X509KeyStorageFlags.MachineKeySet));
  store.Close();

  X509Store store2 = new X509Store(StoreName.AuthRoot, StoreLocation.LocalMachine);
  store2.Open(OpenFlags.ReadWrite);
  store2.Add(new X509Certificate2(PFX, "myPass", X509KeyStorageFlags.MachineKeySet));
  store2.Close();

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...