Powershell
$numberofYear = 3
$myplaintextpwd = "HelloWorld!"
$certName = "myCert"
$cert=New-SelfSignedCertificate -Subject "CN=eFiling Service" -CertStoreLocation "Cert:\CurrentUser\My" -KeyExportPolicy Exportable -KeySpec Signature -NotAfter (Get-Date).AddYears(3)
$bin = $cert.RawData
$base64Value = [System.Convert]::ToBase64String($bin)
$bin = $cert.GetCertHash()
$base64Thumbprint = [System.Convert]::ToBase64String($bin)
$keyid = [System.Guid]::NewGuid().ToString()
$jsonObj = @{customKeyIdentifier=$base64Thumbprint;keyId=$keyid;type="AsymmetricX509Cert";usage="Verify";value=$base64Value}
Export-Certificate -Cert $cert -FilePath .\cert.cer
$mypwd = ConvertTo-SecureString -String '$($myplaintextpwd)' -Force -AsPlainText
Export-PfxCertificate -cert $cert -FilePath ".\$($certName).pfx -Password $mypwd
Make sure you change number of years, password, and the name of your certification
No responses yet