Skip to content

Document generation of self-signed Windows certificates #2899

Description

@freakboy3742

What kind of documentation issue is this?

Missing documentation

Affected page

https://briefcase.beeware.org/en/stable/how-to/code-signing/windows/

Describe the issue

The documentation for Windows code signing describes that self-signed certificates exist, but doesn't describe how to create one.

Suggested improvement

Add a section to the Windows code signing document describing how to generate a self-signed certificate. We need to retain the advisory that self-signed certificates will be problematic in practice.

The following commands can be issued at a PowerShell prompt to generate a self-signed certificate:

PS C:\> $cert = New-SelfSignedCertificate -Subject "My self-signed certificate" -Type CodeSigningCert -Certstorelocation Cert:\CurrentUser\My
PS C:\> Export-Certificate -Cert $cert -FilePath my-self-signed-certificate.crt

Once you've done this, you can get the identity of the certificate by running:

PS C:\> $cert.Thumbprint

This will output the 40-character hexadecimal identity that is used by Briefcase to identify the certificate.

The certificate can be converted into a password-protected PFX file using:

PS C:\> $password = ConvertTo-SecureString -String "<your password>" -Force -AsPlainText
PS C:\> Export-PfxCertificate -Cert "Cert:\CurrentUser\My\$($cert.Thumbprint)" -FilePath my-self-signed-certificate.pfx -Password $password 

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationAn improvement required in the project's documentation.good first issueIs this your first time contributing? This could be a good place to start!

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions