This commit is contained in:
Jonas Roussel
2020-08-25 18:07:37 +02:00
parent 997fe84f7f
commit 7081bb99fd
5 changed files with 89 additions and 5 deletions

View File

@ -73,10 +73,8 @@ class RS256Algorithm extends JWTAlgorithm {
final parser = RSAPKCSParser();
RSAKeyPair pair;
try {
pair = parser.parsePEM(privateKey.key, password: privateKey.passphrase);
assert(pair.private != null);
} catch (ex) {
pair = parser.parsePEM(privateKey.key, password: privateKey.passphrase);
if (pair.private == null) {
throw JWTInvalidError('invalid private RSA key');
}