0

I have this script to generate a self-signed certificate:-

PS C:\Users\Administrator> New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -DnsName "SPGPIntegration-Test"                                                                               



PS C:\Users\Administrator> Export-PfxCertificate -cert Cert:\LocalMachine\my\99CE213D84E71DFFE4D34E970162C6D4D6201D25 -FilePath "C:\certificates\SPGPIntegration-Test.pfx" -Password $pwd


                                                                                                                                 



PS C:\Users\Administrator> Export-PfxCertificate -cert Cert:\LocalMachine\my\99CE213D84E71DFFE4D34E970162C6D4D6201D25 -FilePath 

"C:\certificates\SPGPIntegration-Test.crt" -Password $pwd

Then i tried to upload the generated .crt file inside the >> inside our azure app registration >> but got this error:-

enter image description here

so the error is saying to upload the crt file and i am doing so... any advice?

Thanks

1 Answer 1

1

Export-PfxCertificate will export the certificate as a PFX file. It's a non sense to indicate .cer extension with this command. Use Export-Certificate instead.

Try this command:

$certName = "SPGPIntegration-Test"
$cert = Get-ChildItem -Path Cert:\LocalMachine\my | Where-Object { $_.Subject -eq "CN=$certName" }
Export-Certificate -Cert $cert -Type CERT -FilePath "$certName.cer"

And insert the .cer file in your App Registration > Certificates & secrets.

upload a certificate

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.