Skip to content

Instantly share code, notes, and snippets.

@Mitya88
Created November 16, 2020 12:55
Show Gist options
  • Save Mitya88/65b800fda6bdf5c9b4f5648545c0417d to your computer and use it in GitHub Desktop.
Save Mitya88/65b800fda6bdf5c9b4f5648545c0417d to your computer and use it in GitHub Desktop.
$certificatePassword = "Test123!"
$newCert = New-SelfSignedCertificate -DnsName "localhost" -FriendlyName "Sitecore Identity Token Signing" -NotAfter (Get-Date).AddYears(5)
Export-PfxCertificate -Cert $newCert -FilePath .\SitecoreIdentityTokenSigning.pfx -Password (ConvertTo-SecureString -String $certificatePassword -Force -AsPlainText)
[System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes((Get-Item .\SitecoreIdentityTokenSigning.pfx))) | Out-File -Encoding ascii -NoNewline -Confirm -FilePath .\secrets\sitecore-identitycertificate.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment