Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 60091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:06:27+00:00 2026-05-10T18:06:27+00:00

How do I create a self-signed certificate for code signing using the Windows SDK?

  • 0

How do I create a self-signed certificate for code signing using the Windows SDK?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:06:28+00:00Added an answer on May 10, 2026 at 6:06 pm

    Updated Answer

    If you are using the following Windows versions or later: Windows Server 2012, Windows Server 2012 R2, or Windows 8.1 then MakeCert is now deprecated, and Microsoft recommends using the PowerShell Cmdlet New-SelfSignedCertificate.

    If you’re using an older version such as Windows 7, you’ll need to stick with MakeCert or another solution. Some people suggest the Public Key Infrastructure Powershell (PSPKI) Module.

    Original Answer

    While you can create a self-signed code-signing certificate (SPC – Software Publisher Certificate) in one go, I prefer to do the following:

    Creating a self-signed certificate authority (CA)

    makecert -r -pe -n "CN=My CA" -ss CA -sr CurrentUser ^          -a sha256 -cy authority -sky signature -sv MyCA.pvk MyCA.cer 

    (^ = allow batch command-line to wrap line)

    This creates a self-signed (-r) certificate, with an exportable private key (-pe). It’s named "My CA", and should be put in the CA store for the current user. We’re using the SHA-256 algorithm. The key is meant for signing (-sky).

    The private key should be stored in the MyCA.pvk file, and the certificate in the MyCA.cer file.

    Importing the CA certificate

    Because there’s no point in having a CA certificate if you don’t trust it, you’ll need to import it into the Windows certificate store. You can use the Certificates MMC snapin, but from the command line:

    certutil -user -addstore Root MyCA.cer 

    Creating a code-signing certificate (SPC)

    makecert -pe -n "CN=My SPC" -a sha256 -cy end ^          -sky signature ^          -ic MyCA.cer -iv MyCA.pvk ^          -sv MySPC.pvk MySPC.cer 

    It is pretty much the same as above, but we’re providing an issuer key and certificate (the -ic and -iv switches).

    We’ll also want to convert the certificate and key into a PFX file:

    pvk2pfx -pvk MySPC.pvk -spc MySPC.cer -pfx MySPC.pfx 

    If you are using a password please use the below

    pvk2pfx -pvk MySPC.pvk -spc MySPC.cer -pfx MySPC.pfx -po fess 

    If you want to protect the PFX file, add the -po switch, otherwise PVK2PFX creates a PFX file with no passphrase.

    Using the certificate for signing code

    signtool sign /v /f MySPC.pfx ^               /t http://timestamp.url MyExecutable.exe 

    (See why timestamps may matter)

    If you import the PFX file into the certificate store (you can use PVKIMPRT or the MMC snapin), you can sign code as follows:

    signtool sign /v /n "Me" /s SPC ^               /t http://timestamp.url MyExecutable.exe 

    Some possible timestamp URLs for signtool /t are:

    • http://timestamp.verisign.com/scripts/timstamp.dll
    • http://timestamp.globalsign.com/scripts/timstamp.dll
    • http://timestamp.comodoca.com/authenticode
    • http://timestamp.digicert.com

    Full Microsoft documentation

    • signtool
    • makecert
    • pvk2pfx

    Downloads

    For those who are not .NET developers, you will need a copy of the Windows SDK and .NET framework. A current link is available here: [SDK & .NET][5] (which installs makecert in `C:\Program Files\Microsoft SDKs\Windows\v7.1`). Your mileage may vary.

    MakeCert is available from the Visual Studio Command Prompt. Visual Studio 2015 does have it, and it can be launched from the Start Menu in Windows 7 under "Developer Command Prompt for VS 2015" or "VS2015 x64 Native Tools Command Prompt" (probably all of them in the same folder).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 89k
  • Answers 89k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The easiest way is to add a new property to… May 11, 2026 at 5:56 pm
  • Editorial Team
    Editorial Team added an answer Do you want to do this programmatically? If not, then… May 11, 2026 at 5:56 pm
  • Editorial Team
    Editorial Team added an answer WWW::Mechanize is a subclass of LWP::UserAgent. So you can use… May 11, 2026 at 5:56 pm

Related Questions

I am building a system for distributing packages (.zip archives) created by different organizations.
I have created a self generated certificate to sign a DLL. When I load
I would like to have the authentication and registration parts of my website encrypted
I have an app with an embedded webserver. This webserver can now do SSL

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.