public function decode($jwsString)
    {
        $components = explode('.', $jwsString);
        if (count($components) !== 3) {
            throw new MalformedSignatureException('JWS string must contain 3 dot separated component.');
        }

        try {
            $headers = Json::decode(Base64Url::decode($components[0]));
            $payload = Json::decode(Base64Url::decode($components[1]));
        } catch (\InvalidArgumentException $e) {
            throw new MalformedSignatureException("Cannot decode signature headers and/or payload");
        }

        return [
            'headers' => $headers,
            'payload' => $payload
        ];
    }
public function decode($jwsString)
    {
        $components = explode('.', $jwsString);
        if (count($components) !== 3) {
            throw new MalformedSignatureException('JWS string must contain 3 dot separated component.');
        }

        try {
            $headers = Json::decode(Base64Url::decode($components[0]));
            $payload = Json::decode(Base64Url::decode($components[1]));
        } catch (\InvalidArgumentException $e) {
            throw new MalformedSignatureException("Cannot decode signature headers and/or payload");
        }

        return [
            'headers' => $headers,
            'payload' => $payload
        ];
    }
public function decode ( $ jwsString ) { $ components = explode ( '.' , $ jwsString ) ; if ( count ( $ components ) !== 3 ) { throw new MalformedSignatureException ( 'JWS string must contain 3 dot separated component.' ) ; } try { $ headers = Json :: decode ( Base64Url :: decode ( $ components [ 0 ] ) ) ; $ payload = Json :: decode ( Base64Url :: decode ( $ components [ 1 ] ) ) ; } catch ( \ InvalidArgumentException $ e ) { throw new MalformedSignatureException ( "Cannot decode signature headers and/or payload" ) ; } return [ 'headers' => $ headers , 'payload' => $ payload ] ; }
Only decodes jws string and returns headers and payload. To verify signature use verify method.

@throws MalformedSignatureException
@param $jwsString
@return array(
'headers' => array(),
'payload' => payload data
)
Only decodes jws string and returns headers and payload . To verify signature use verify method .