Signature to update apps - Signature is invalid: Incorrect padding


I am trying to update an app on

According to the doc, the signature is given by
openssl dgst -sha512 -sign mykey.key myrelease.tar.gz | openssl base64

However, this generates a multi-line output that is not accepted through the curl process (getting “Signature is invalid: Incorrect padding” ), whereas the doc states a one-line signature

How to resolve this ?

Thank you