Open ecoben opened 2 years ago
Hi @ecoben, thanks for the report. I am trying to reproduce the error, but everything works on my end. Normalization is working as expected but the signing might fail for you? I believe it must be a problem with your keys. Did you sign any other SDs successfully yet?
If you want to get the full error message you can change line 180 console.dir(error?.response?.data, { depth: null, colors: true });
to console.dir(error, { depth: null, colors: true });
.
Thanks @oceanByte, I will try debugging this as you suggested.
Okay, now I got helpful messages from jose and can confirm: my .env was not in the expected format.
I had to convert the private key from pkcs1 to pkcs8 using OpenSSL:
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in pkcs1.key -out pkcs8.key
(The -nocrypt flag seems to be deprecated these days, but I think that's how the input is needed here.)
I didn't actually know about the different formats - and didn't pick up on the subtle difference:
the example.env begins with
"PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
which seems to be the case in pkcs8 format
rather than
"PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
which was my pkcs1 version.
Maybe a hint on this could save others some time?
Using the SD signer tool as described in Step 2 of the gx-compliance README, fails with the following error message:
The input used for testing is identical to the one in this API POST:
When checking the above SD input using the Swagger test page at https://compliance.gaia-x.eu/docs/#/Common/CommonController_normalizeSelfDescriptionRaw , I get a response of 201 Undocumented.
The sample files provided, produce the same response: