It’s been a long time, but I’m back. Here is a sample script to generate a self-signed certificate. This was helpful for building API access to Adobe Cloud User Management API
### Create Self-Signed Certificate (only works Windows 8.1, 10, Server 2016+ ###$Name = "MyCert" $ExportPath = "C:Data" # Path to export cert $Password = "MySecretPassword" # Passphrase on cert $CertTtlMonths = 24 # Lifespan of the cert in months $SecurePwd = ConvertTo-SecureString -String $Password -Force -AsPlainText $Certificate = New-SelfSignedCertificate -DnsName $Name -CertStoreLocation "cert:LocalMachineMy" -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -HashAlgorithm "SHA256" -NotAfter (Get-Date).AddYears($CertTtlMonths) Get-ChildItem -Path ("cert:localMachineMy" + $Certificate[0].Thumbprint ) | Export-PfxCertificate -FilePath "$ExportPathMyCert.pfx" -Password $SecurePwd ### Export Public Key (Required Server 2016+) ### Export-Certificate -FilePath "$ExportPathMyCert.cer" -Cert $Certificate -Type CERT -NoClobber CertUtil -Encode "$ExportPathMyCert.cer" "$ExportPathMyCertB64.crt"