Skip to content

Core\Jwt

Signs and checks JSON Web Tokens (JWT). sign and signObject write a token that always expires. verify checks a token your own program signed, and verifyIssued checks a token from another service. Both throw an error when the token is not valid.

Members

4 members.

MemberSignature
signsign(array<string> $claims, Core\Time\Duration $lifetime, secret bytes|Core\Crypto\KeyPair $key, { kid?: string, typ?: string, embedKey?: bool }): string
signObjectsignObject(object $claims, Core\Time\Duration $lifetime, Core\Crypto\KeyPair $key, { kid?: string, typ?: string, embedKey?: bool }): string
verifyverify(string $token, secret bytes $key): array<tainted string>
verifyIssuedverifyIssued<T>(string $token, Core\Jwt\KeySet|Core\Crypto\PublicKey $keys, string $issuer, string $audience, { leeway?: Core\Time\Duration, typ?: string, nonce?: string, maxAge?: Core\Time\Duration }): T