Announcement

Collapse
No announcement yet.

How to change .pem file to .key file?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to change .pem file to .key file?

    I created my key through XCA and exported it as a PEM private file (.pem) following this tutorial https://www.youtube.com/watch?v=nO4UnHRyLz4. When I use the path of the key as my Cert Path, I get an error saying 'Make sure .crt and .key file is present. Do I need to export my key in a different file format through XCA? How do I change a .pem file extension to .key?

    My code:


    certs_path1 = r'C:\Users\\Desktop\Certs\Arb.crt'
    certs_path2 = r'C:\Users\\Desktop\Certs\Client-2048.pem'
    my_username = ""
    my_password = ""
    my_app_key = ""
    trading = betfairlightweight.APIClient(username=my_username, password=my_password, app_key=my_app_key, certs=certs_path1 and certs_path2)
    trading.login()
    Last edited by onthepunt; 07-08-2020, 07:36 AM.

  • #2
    I experienced the same issue, this worked for me:

    Code:
    openssl rsa -in client2048.pem -out client2048.key
    You can also add the path of where you are reading in and saving the file and it should work. i.e C:\client2048.pem

    Comment


    • #3
      Thank you very much for your help, everything works!

      Comment

      Working...
      X