Converting a certificate from a .cer to .pem using powershell or .bat

6,604

Run certutil -encode .pem

You could also download the PSPKI module, and I think there is a cmdlet in there for this as well, but certutil is built into every single Windows machine since like Windows 2000.

Share:
6,604

Related videos on Youtube

deathscythe272
Author by

deathscythe272

Updated on September 18, 2022

Comments

  • deathscythe272
    deathscythe272 over 1 year

    I am trying to find a way to script converting a .cer formated cert to a .pem format either using powershell or cmdline native to windows. Does anyone have any idea how this might be done?

    • Admin
      Admin about 6 years
    • Admin
      Admin about 6 years
      PS does not have any native files, it would just be calling a program that has CLI ability.
    • Vomit IT - Chunky Mess Style
      Vomit IT - Chunky Mess Style about 6 years
      Agree, use OpenSSL CLI....
  • mellow-yellow
    mellow-yellow about 4 years
    example: certutil -encode c:\in.cer c:\out.pem