def pem_decode(self, encoded_key): asn1_object, = asn1.pem_decode(encoded_key, 'RSA PUBLIC KEY', der_strict=False) self.n, self.e = map(long, asn1_object)
def pem_decode(self, encoded_key): asn1_object, = asn1.pem_decode(encoded_key, 'RSA PRIVATE KEY', der_strict=False) version = int(asn1_object[0]) assert version == 0, 'Incorrect version value' self.version, self.n, self.e, self.d, self.p, self.q, self.d_p, self.d_q, self.q_inv = map(long, asn1_object)