Signature verification
For a compact signed JWT, the verifier separates the three dot-delimited segments. The first two encoded segments, including the dot between them, form the JWS signing input. It decodes the signature segment and checks it with the supplied HMAC secret or RSA or elliptic-curve public key. Changing even one header or payload byte causes signature verification to fail.