Closed matt-read closed 1 year ago
Hi @matt-read. You may want to check out https://github.com/eBay/digital-signature-verification-ebay-api/issues/4 Someone else also had issues with C#. In that case, it was a different line break between Windows and Linux based operating systems. There was some sample code on that github issue as well. Please go through it and let me know if this is of any help.
Many thanks for the pointer @uherberg. The line break was in fact the issue. All working well now.
Thank you
@matt-read Awesome!
We are looking to adopt the new digital signature needed to post to ebay issue_refund API calls as described here: https://developer.ebay.com/develop/guides/digital-signatures-for-apis.
We have set up a .Net console app to test the new signature code. See below for our sample code. The code we have produced is based on the PHP example code eBay provides here: https://github.com/eBay/digital-signature-php-sdk.
Sample Code
Using the Key Management API we have successfully created our keys. From which we use the public JWE for the x-ebay-signature-key header.
Content-Digest
The content-digest header is created by converting the response body payload and converting to a SHA-256 digest, so this:
Gets converted to:
Signature-Input
Signature
This calls a service which firstly builds up the signature base:
We then load in the private key and use this to convert to a base64 string. So we end up with:
However after running our sample code, the response we are getting back from the API is:
Some help to understand what we have done wrong would be gratefully received.
Many thanks