How to get .key certificate? I only have a .pem file not .key!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lesageethan
    Junior Member
    • Jan 2021
    • 1

    #1

    How to get .key certificate? I only have a .pem file not .key!

    Like the title says, does anyone know how to I can get a .key certificate? My python code says I need a .key not the .pem one I generated with XCA.
  • sharpred
    Junior Member
    • Feb 2021
    • 1

    #2
    Your PEM file contains your public certificate and your private key. You need the private key bit. Open your PEM file in a text editor, if it was generated correctly it will have two sections,

    the first one will start with
    -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----

    the second section will start with
    -----BEGIN RSA PRIVATE KEY----- and end with -----BEGIN RSA PRIVATE KEY-----


    this second section is your private key, copy this bit (including the -----BEGIN RSA PRIVATE KEY----- and -----BEGIN RSA PRIVATE KEY-----) into a new file and save it with a .key extension.

    If your python code needs a .crt file, do the same with the first bit

    Comment

    • jordancp
      Junior Member
      • Mar 2021
      • 1

      #3
      Couldn't have done it with the following:

      https://www.youtube.com/watch?v=XrZxJsKUQR8&t=120s

      Comment

      Working...
      X