diff options
author | John LeSueur <jlesueur@bamboohr.com> | 2014-06-23 18:38:44 +0000 |
---|---|---|
committer | John LeSueur <jlesueur@bamboohr.com> | 2014-06-23 18:38:44 +0000 |
commit | 026a6d9c45bd0cc702703c06b615e3ec216c4802 (patch) | |
tree | ab2d855021b562294aee9ada22738a0142fe0676 /Authentication/JWT.php | |
parent | b5829858aed4a1f73c3029ecaf3e34471a083e6e (diff) | |
download | php-jwt-026a6d9c45bd0cc702703c06b615e3ec216c4802.zip php-jwt-026a6d9c45bd0cc702703c06b615e3ec216c4802.tar.gz php-jwt-026a6d9c45bd0cc702703c06b615e3ec216c4802.tar.bz2 |
Updates for some whitespace and other minor issues.
Diffstat (limited to 'Authentication/JWT.php')
-rw-r--r-- | Authentication/JWT.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Authentication/JWT.php b/Authentication/JWT.php index aa4995d..d82e2cc 100644 --- a/Authentication/JWT.php +++ b/Authentication/JWT.php @@ -65,10 +65,12 @@ class JWT if (empty($header->alg)) { throw new DomainException('Empty algorithm'); } - if (is_array($key) && !isset($header->kid)) { - throw new DomainException('"kid" empty, unable to lookup correct key'); - } elseif(is_array($key) && isset($header->kid)) { - $key = $key[$header->kid]; + if (is_array($key)) { + if(isset($header->kid)) { + $key = $key[$header->kid]; + } else { + throw new DomainException('"kid" empty, unable to lookup correct key'); + } } if (!JWT::verify("$headb64.$bodyb64", $sig, $key, $header->alg)) { throw new UnexpectedValueException('Signature verification failed'); @@ -116,7 +118,7 @@ class JWT * @param string $msg The message to sign * @param string|resource $key The secret key * @param string $method The signing algorithm. Supported - * algorithms are 'HS256', 'HS384' and 'HS512' + * algorithms are 'HS256', 'HS384', 'HS512' and 'RS256' * * @return string An encrypted message * @throws DomainException Unsupported algorithm was specified |