Skip to content

Commit

Permalink
Throw KeyException when loading an invalid PEM RSAKey
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinmo committed Dec 12, 2023
1 parent 79b4917 commit fbdcf29
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SimpleJWT/Keys/RSAKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fbdcf29

Please sign in to comment.