diff --git a/CHANGELOG.md b/CHANGELOG.md index 7036b89..9c39c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file. - Removed: Support for PHP 7.2 +## 0.8.1 + +- Fixed: Throw a `KeyException` when loading an invalid PEM-encoded + RSAKey + ## 0.8.0 - Added: Support for `Ed25519` signatures and `X25519` key derviation diff --git a/src/SimpleJWT/Keys/RSAKey.php b/src/SimpleJWT/Keys/RSAKey.php index e2cb2b0..2b8d765 100644 --- a/src/SimpleJWT/Keys/RSAKey.php +++ b/src/SimpleJWT/Keys/RSAKey.php @@ -119,6 +119,8 @@ public function __construct($data, $format, $password = null, $alg = 'PBES2-HS25 $jwk['dp'] = Util::base64url_encode($seq->getChildAt(6)->getValueAsUIntOctets()); $jwk['dq'] = Util::base64url_encode($seq->getChildAt(7)->getValueAsUIntOctets()); $jwk['qi'] = Util::base64url_encode($seq->getChildAt(8)->getValueAsUIntOctets()); + } else { + throw new KeyException('Unrecognised key format'); } parent::__construct($jwk);