$Path = "c:\\certificates"
$Name = "xp0.xconnect_client"
$Signer = Invoke-GetCertificateConfigFunction -Id 'DO_NOT_TRUST_SitecoreRootCert' -CertStorePath Cert:\LocalMachine\Root -Verbose
$Signer.GetType()
$DnsName = "xp0.xconnect_client"
$CertStoreLocation = 'Cert:\LocalMachine\My'
$signedCertificate = New-SelfSignedCertificate -CloneCert $Signer -DnsName $DnsName -CertStoreLocation $CertStoreLocation -Verbose
if ($null -eq $signedCertificate) {
throw "Failed to create signed certificate for '$DnsName' in $CertStoreLocation"
}
Write-Host "Created signed certificate $signedCertificate"
Write-Host "Export new certificate public key as a CRT file"
$exportFilePath = Join-Path -Path $Path -ChildPath "$Name.crt"
$certificateInfo = Export-Certificate -Cert $signedCertificate -FilePath $exportFilePath -Force
Write-Information -MessageData "Exported signed certificate to $exportFilePath"
0 people found this article useful
0 people found this article useful