How to generate .crt file from scratch using puttygen under windows

This passage will be short and to the point, as most basic info can be found online. 

I just point out the necessary info.  Here are the steps:

  • Download and install puttygen, then generate a public/private key pair.
    • Reference: https://www.ssh.com/academy/ssh/putty/windows/puttygen
    • You should have two .ppk files: one for private key and one for public key.  
  • Convert your .ppk private key file to base64/pem format.  You can name it either in .pem or .key.  They are both referring to the same thing.  
    • Reference: https://www.tbs-certificates.co.uk/FAQ/en/putty-ppk-vers-openssl-openssh.html
    • You should have 1 .pem (or .key) file now, generated from your private key.
  • Generate a 10 years .crt file with the following command:
    • openssl req -new -x509 -key my_private.pem -out my_cert.pem -days 3650 -subj "/C=HK/ST=HK/L=HK/O=MyCompany/OU=My_organization/CN=mysite.com"
    • You should have a my_cert.pem file now
  • Convert your .pem cert to .crt cert using this command:
    • openssl crl2pkcs7 -nocrl -certfile my_cert.pem | openssl pkcs7 -print_certs -out my_new_cert.crt
    • This is your cert: my_new_cert.crt (Self signed)
Hope it helps someone.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services