summaryrefslogtreecommitdiff
path: root/jwt/contrib/algorithms/pycrypto.py
diff options
context:
space:
mode:
Diffstat (limited to 'jwt/contrib/algorithms/pycrypto.py')
-rw-r--r--jwt/contrib/algorithms/pycrypto.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/jwt/contrib/algorithms/pycrypto.py b/jwt/contrib/algorithms/pycrypto.py
index e6afaa5..fe477db 100644
--- a/jwt/contrib/algorithms/pycrypto.py
+++ b/jwt/contrib/algorithms/pycrypto.py
@@ -7,6 +7,7 @@ from Crypto.Signature import PKCS1_v1_5
from jwt.algorithms import Algorithm
from jwt.compat import string_types, text_type
+from jwt.exceptions import InvalidAsymmetricKeyError
class RSAAlgorithm(Algorithm):
@@ -36,7 +37,7 @@ class RSAAlgorithm(Algorithm):
key = RSA.importKey(key)
else:
- raise TypeError('Expecting a PEM- or RSA-formatted key.')
+ raise InvalidAsymmetricKeyError
return key