I am trying to decode a STIR/SHAKEN HS256 JSON Web Token.
I tried with the Jose .NET library:
string token = "eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jci5zYW5zYXkuY29tL1RlY2hub2xvZ3lfSW5ub3ZhdGlvbl9MYWJfNTk5SiJ9.eyJhdHRlc3QiOiJCIiwiZGVzdCI6eyJ0biI6WyIxNDc5MjM5OTcwMyJdfSwiaWF0IjoxNjU5NTIxNDU5LCJvcmlnIjp7InRuIjoiMTQ2OTUwMTYwNzAifSwib3JpZ2lkIjoiOTIzNDIxOTgtMTMxNC0xMWVkLWExM2QtYmRjMWMxZDI4ODg4In0.8RF_eaVKeGGyjet4lujwPz0J_XBdtwkSKrnrOq7-pA6ODtJPD1parLgimEpDUyzSravtTaxuACxBz4yrKtMZgw";
string x = Jose.JWT.Decode(token, Nothing, JweAlgorithm.PBES2_HS256_A128KW);
It gives an error
Jose.InvalidAlgorithmException: 'The algorithm type passed to the Decode method did not match the algorithm type in the header.'
Trying the token above on https://jwt.io/ Debugger works and returns the following:
HEADER:ALGORITHM & TOKEN TYPE
{
"alg": "ES256",
"ppt": "shaken",
"typ": "passport",
"x5u": "https://cr.sansay.com/Technology_Innovation_Lab_599J"
}
PAYLOAD:DATA
{
"attest": "B",
"dest": {
"tn": [
"14792399703"
]
},
"iat": 1659521459,
"orig": {
"tn": "14695016070"
},
"origid": "92342198-1314-11ed-a13d-bdc1c1d28888"
}