From 14ba108859bb118f425b0e35054f3add6f006be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 12 Oct 2012 09:11:51 +0200 Subject: Explicitly cast ASN.1 integer type to Python int --- rsa/key.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsa/key.py b/rsa/key.py index 43f4c87..b6de7b3 100644 --- a/rsa/key.py +++ b/rsa/key.py @@ -158,7 +158,7 @@ class PublicKey(AbstractKey): from rsa.asn1 import AsnPubKey (priv, _) = decoder.decode(keyfile, asn1Spec=AsnPubKey()) - return cls(n=priv['modulus'], e=priv['publicExponent']) + return cls(n=int(priv['modulus']), e=int(priv['publicExponent'])) def _save_pkcs1_der(self): '''Saves the public key in PKCS#1 DER format. -- cgit v1.2.1