Sending Private RSA SSH Key in JSON Body - Unable to parse message body:
The problem:
I need to upload a private SSH key in ID_RSA format to the Oracle Cloud Infrastructure API. But when doing as example a cat command, I get a multi-line output of the SSH key in this format:
-----BEGIN RSA PRIVATE KEY-----
MIIG5AIBAAKCAYEAxYBpIbe7Vuc9cHDMwVQtN70GmA600dzQID7STCGwPwNG3ip1
qZL25vSGH9YJ4wWVm6Ui3EdGpNG4v4EkR/FAu7VmFYhzL4K1LP1uFynzdCYkwYhM
<REDACTED>
6CriS7d4/C8UjyQv6KuJM9JzeGODtCkoOAYifqzla2aupXwVRavASuAQ/6l3DCej
xpdSB9MY6Ty6sT5YYp6CZv14+LzkVoD7bwT7vaZooq1FuTiG4WzU8w==
-----END RSA PRIVATE KEY-----
When I copy & paste the out an want to use it as variable, for each line Postman creates a new line too. The POST command is unable to parse the load.
{
"sshKey": "-----BEGIN RSA PRIVATE KEY-----
MIIG5AIBAAKCAYEAxYBpIbe7Vuc9cHDMwVQtN70GmA600dzQID7STCGwPwNG3ip1
qZL25vSGH9YJ4wWVm6Ui3EdGpNG4v4EkR/FAu7VmFYhzL4K1LP1uFynzdCYkwYhM
iFYO/jpPtn0R12Hq0Zh4vtyOW/BbdEJtHIq+d2mc69t3m6gZfx2pgQcPUFAn+zOu
c31ZN0E/F8CAv7h8H6kU2htwsuk+XPw4tM7qCH94Cqmc+JuSpQnMNcOoQGmYff2S
9DZ6+xcHaH1fhwtEgRQtt1N5sqQdbXYv0sbYlsuFSL+vNdRHl5yeGOys7M9PTbcM
<REDACTED>
}
The Postman error:
{
"code": "InvalidParameter",
"message": "Unable to parse message body"
}
How can I send this multi-line SSH key to the API? This is the link to the API definition:
Any inputs are highly appreciated.
Thanks,
Martin