Pipelines/Steps/Install/OnPrem/Solr/SSL/New-RootCert.ps1

$ErrorActionPreference = "Stop"

$rootCertName = BuildSolrRootCertName -Prefix $SAFConfiguration.prefix
$exportPath = Get-Location

$certDestPath = Join-Path -Path $exportPath -ChildPath "SolrRootSSLCertificate_SAF.pfx"
if (Test-Path $certDestPath) {
    Write-Warning "It seems that you alredy have SolrRootSSLCertificate_SAF.pfx SSL certificate. Skipping creation..."
    Start-Sleep -s 5
}
else {
    GenerateRootCert -RootCertName $rootCertName
    ExportCert -CertName $rootCertName -PfxName "SolrRootSSLCertificate_SAF.pfx" -ExportPath $exportPath -Password $SAFDefaultPFXPassword
}