-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathcreate_new_self-signed_cert.ps1
More file actions
7 lines (7 loc) · 816 Bytes
/
create_new_self-signed_cert.ps1
File metadata and controls
7 lines (7 loc) · 816 Bytes
1
2
3
4
5
6
7
# Create a new SelfSignedCertificates
New-SelfSignedCertificate -Type Custom -KeyUsage DigitalSignature -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") -Subject "CN=LittleBitBig" -FriendlyName "LittleBitBig Code Signing Certificate"
# Export the SelfSignedCertificate to a PFX
$passwordString = Read-Host "What password do you want for your LittleBitBig Code Signing Certificate?"
$password = ConvertTo-SecureString -String $passwordString -Force -AsPlainText
Export-PfxCertificate -cert "Cert:\CurrentUser\My\<Certificate Thumbprint>" -FilePath ~\DisplayMagicianCodeSigning.pfx -Password $password
Import-PfxCertificate -CertStoreLocation "Cert:\LocalMachine\TrustedPeople" -Password $password -FilePath -FilePath ~\DisplayMagicianCodeSigning.pfx