Self Signed Certificate – PowerShell Code Snippet

How to create self signed TLS/SSL certificate? $cert = New-SelfSignedCertificate -CertStoreLocation cert:\currentuser\my -Subject “” -DnsName “”$pwd = ConvertTo-SecureString -String ‘YourPassword’ -Force -AsPlainText$path = ‘cert:\currentuser\my\’ + $cert.thumbprintExport-PfxCertificate -cert $path -FilePath c:\test\powershellcert.pfx -Password $pwd Relevant for Azure API Management

How to convert .pfx to .cer?

openssl pkcs12 -in testcert.pfx -out C:\TLS\powershellcert.pem -nodes openssl pkcs12 -in testcert.pfx -nocerts -out [keyfilename-encrypted.key] Download and install openssl from

How to validate jwt token from Azure AD B2C in Azure API Management (APIM)?

<validate-jwt header-name=”Authorization” failed-validation-httpcode=”401″ failed-validation-error-message=”Unauthorized. Access token is missing or invalid.”> <openid-config url=”” /> <audiences> <audience>b33b3ba3-c921-4599-b648-57e9c5e023f</audience> </audiences> <issuers> <issuer></issuer> </issuers> </validate-jwt>