From the JSON Web Token Bearer Grant guide, it was recommended that I should save the Private key as a .PEM file
Note: If you’re working with sample code from one of the SDKs, save the Private key as a .PEM file. The SDK is configured to read the private key value from a file with this extension.
So now that I have generated my private key:
----BEGIN RSA PRIVATE KEY----
****
----END RSA PRIVATE KEY-----
How do I save this as a .PEM file, is it simply just pasting this private key into a notepad and instead of saving to a .txt file I should change the extension to .PEM?
Also is there any security reason why I should save the private key as a .pem instead of .txt?
You are correct, what counts is what is inside the file, not the extension.
So you can either rename docusignPrivateKey.txt
to docusignPrivateKey.pem
or leave it as .txt