#!/usr/bin/php 'http://example.org', 'aud' => 'http://example.com', 'iat' => 1356999524, 'nbf' => 1357000000, // 'exp' => 1457000000 ]; $keyPair = sodium_crypto_sign_keypair(); $privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair)); $publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair)); echo(urlencode('https://srv-ovc-linux.ovc.nl/kldv/call.php?action=sso&')."\n"); echo("privateKey $privateKey\n"); echo("publicKey $publicKey\n"); echo("time ".time()."\n"); /** * IMPORTANT: * You must specify supported algorithms for your application. See * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40 * for a list of spec-compliant algorithms. */ $jwt = JWT::encode($payload, $privateKey, 'EdDSA'); //echo($jwt."\n"); $decoded = JWT::decode($jwt, new Key($publicKey, 'EdDSA')); print_r($decoded); ?>