$header_decode = base64_decode($header);
//$header_decode这个得出来的是字符串,下面的这个步骤再转为字符串,应该得不到数组吧,json_encode是否应该更改为:json_decode
$header_json =json_encode($header_decode);
另外就是:JWT::decode($jwt, $pubkey, array($header_json['alg']));更改为:
JWT::decode($jwt, new Key("-----BEGIN CERTIFICATE-----\n".$header_json['x5c'][0]."\n-----END CERTIFICATE-----", $header_json['alg']));也许会方便一些
![240](https://upload.jianshu.io/users/upload_avatars/18472770/9a5e9037-b7f7-4d3a-982c-fc9752229cd7.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240)