1

Is there way how to import *.cer personal certificate file after renewing and pair it with private key stored in Certificate Enrollment Request ?

I am using AutoIt and Chilkat ActiveX library.

EDIT: I have applied workaround with Powershell Import-Certificate function, but I still wonder if it can be done with Chilkat..

Local $sCommand = 'PowerShell.exe '
;~  Import cert, info 
https://stackoverflow.com/questions/55413247/importing-cer
-certificate-from-cmd

;~  Using the following for testing purposes only
$sCommand &= 'Set-Location -Path cert:\CurrentUser\My' ; Set 
target  cert store to pesonal
$sCommand &= ' ; '
$sCommand &= "Import-Certificate -Filepath '" & $Cesta & "\" & 
$Soubor_nazev & "'"

;~  DEBUG, Powershell window stay visible until key press
$sCommand &= ' ; '
$sCommand &= "Read-Host -Prompt 'Press Enter to exit.'"

;~  DEBUG, Write content $sCommand variable (powershell command
 line) to Auto It console
ConsoleWrite($sCommand & @CRLF)

RunWait($sCommand) ; continue AutoIt script after PowerShell 
window close
Honza
  • 11
  • 2

0 Answers0