RickardPettersson / swish-api-csharp

Swish For Merchant API Client .Net Standard Library
MIT License
28 stars 13 forks source link

Problem using other certificates for signing #26

Closed FredrikOpenit closed 1 year ago

FredrikOpenit commented 1 year ago

I'm testing out the MainTestPayout function in the test console app, and it works fine with the test certificates. However when I try a different ciertificate for signing it does not work. I'm suspicion is that the serial number doesn't match, but I can't seem to get the correct one.

For the test certificate I get a completely different SN from the one hard coded i nthe test app, so I'm guessing I'm using the wrong function to get it.

If this is the case, what is the correct way to get the SN from the certificate?

Iäm using X509Certificate.CreateFromCertFile and then getSerialNumber and GetSerialNumberString.

I'm not 100% this is the issue, but the result I'm getting is a 401 with incorrect parameters.

Any help would be greatly appriciated..