I used to create self signed certificates using makecert like so

    -iv fooCA.pvk
    -ic fooCA.cer
    -n "CN=Username"
    -sv username.pvk 
    -a sha1 
    -len 2048 
    -b 08/07/2014 
    -e 08/07/2024 
    -sky exchange username.cer 

Now using Windows 10 I can't use MakeCert anymore, I'm trying to use the New-SelfSignedCertificate script to achieve the same. Here's what I've tried so far.

-Subject "CN=Username" 
-KeyExportPolicy Exportable 
-Container "Username.pvk" 
-KeyAlgorithm sha1 
-KeyLength 2048 
-NotBefore 08/07/2014 
-NotAfter 08/07/2024 -KeySpec KeyExchange 
-TextExtension @("")

What parameters should I use to mirror the -iv and -ic from MakeCert?

I also suspect that my Subject is incorrect or that I need add an alternative subject in the TextExtension as I currently get a Missing Subject Information Error.


I have Windows 10 and makecert.exe is in "c:\Program Files (x86)\Windows Kits\10\bin\x64" . You can download the SDK from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk .

  • Thanks, is this likely to be a sustainable way of doing it? – ThrowingSpoon Aug 17 '16 at 17:26
  • It's part of the SDK, so , I don't think it's going away anytime soon. – Mer Aug 17 '16 at 17:28
  • @Mer This answer doesn't address OP's question. – Ash Mar 26 '18 at 0:46
  • @ThrowingSpoon MakeCert now appears to be deprecated. See msdn.microsoft.com/en-us/library/windows/desktop/… – Ash Mar 26 '18 at 0:47

a little late to the game - but found that you need to prefix the values in TextExtension with{text}

so in your case it would probably look something like this:

-TextExtension @("{text}")

Search for "Enhanced Key Usage" on this page: https://docs.microsoft.com/en-us/powershell/module/pkiclient/new-selfsignedcertificate?view=win10-ps#examples


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.