It would help to know why they think it’s invalid.
If you capture an outgoing INVITE message using either wireshark or by setting pjsip set logger host <remote_host> in the Asterisk CLI you should be able to extract the Identity header. Here’s an abbreviated example:
Copy everything after the Identity: up to but not including the ;info= and paste that into the jwt.io “Encoded” area. You should then see the decoded header and payload on the right. Now download your public certificate from the URL in the header and copy the contents into the top “Verify Signature” box. You don’t need the private key. At the bottom, you should now see “Signature Verified”. If it still says “Invalid Signature” at the bottom, then the certificate retrieved doesn’t match the private key specified in the attestation section.
When you write “but not including the ;info=”, shall I exclude the last “;” or leave it inside the Encoded field ?
My public cert is a *.cer file in PEM format, starting with -----BEGIN CERTIFICATE----- and ending with -----END CERTIFICATE-----. Shall I include both startin and ending lines ?
I just tried it and It does look like you have a mismatch between your private key and certificate so double check that the certificate you’re hosting on your web site is actually the correct certificate for the private key you’re using.
Changing my new public URL to an old one changed validation on jwt.io from failure to success, probably to an inconsistency between my public and private keys.
After digging further, I now have two different sets of public/private keys to attest outgoing traffic. Thanks again for your help.
As I incorrectly associated a private key with the wrong public key (or vice versa), would it possible if Asterisk could check if both public/private keys are compatible with each other and notify sysadmin in case of inconsistency ?
Asterisk cannot bear the burden of checking every setting but, IMHO, crypto is so error prone, a safety net would very much appreciated.