Generate a secure code signing certificate.
Version : 1.0
File Name : gencodesigncert.ps1
Author : Adewale Azeez - iamthecarisma@gmail.com
Date : Jan-09-2020
Generate a code signing certificate to sign your application, powershell script e.t.c. After generating the certificate, it is exported into the output folder specified in the third parameter.
If a certificate already exist with the same Subject name the old certificate is removed and replaced with the new certificate that is generated.
gencodesigncert [-cert_name] <String> [-expiry_year_] <Int32>
[-output_folder_path] <String> [-password_] <String> [<CommonParameters>]
attr |
value |
---|---|
Required? |
true |
Position? |
1 |
Default value |
|
Accept pipeline input? |
false |
Accept wildcard characters? |
false |
attr |
value |
---|---|
Required? |
true |
Position? |
2 |
Default value |
0 |
Accept pipeline input? |
false |
Accept wildcard characters? |
false |
attr |
value |
---|---|
Required? |
true |
Position? |
3 |
Default value |
|
Accept pipeline input? |
false |
Accept wildcard characters? |
false |
attr |
value |
---|---|
Required? |
true |
Position? |
4 |
Default value |
|
Accept pipeline input? |
false |
Accept wildcard characters? |
false |
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
System.String System.int32 System.String System.String
System.String
gencodesigncert 'Cronux' 3 ./dist/ mypassword
This generates the Cronux certificate in ‘cert:/LocalMachine/My’ and exports Cronux.pfx to ./dist/ folder. The generated certificate expires after 3 years.
gencodesigncert 'My Code Signer' 1 ./dist/ mypassword
This generates the Cronux certificate in ‘cert:/LocalMachine/My’ and exports Cronux.pfx to ./dist/ folder. The generated certificate expires after 1 years.