Every now and then I need to create a self signed certificate in azure for something. In my particular case its Azure B2C. I am using a mac so its not simply just running something like
New-SelfSignedCertificate `
-KeyExportPolicy Exportable `
-Subject "CN=yourappname.yourtenant.onmicrosoft.com" `
-KeyAlgorithm RSA `
-KeyLength 2048 `
-KeyUsage DigitalSignature `
-NotAfter (Get-Date).AddMonths(12) `
-CertStoreLocation "Cert:\CurrentUser\My"
-
Create a key
openssl genrsa -out key.pem 2048
-
Create certifcate signin request
openssl req -new -sha256 -key key.pem -out csr.csr
- enter whatever information you wish, good practice to include a password
-
Create certificate
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem
openssl pkcs12 -export -out samlIdpCert.pfx -inkey key.pem -in certificate.pem