def private_pem(self): """Returns: bytes""" rsa = RSA.construct( (magicsigs.base64_to_long(str(self.mod)), magicsigs.base64_to_long(str(self.public_exponent)), magicsigs.base64_to_long(str(self.private_exponent)))) return rsa.exportKey(format='PEM')
def public_pem(self): rsa = RSA.construct( (magicsigs.base64_to_long(str(self.mod)), magicsigs.base64_to_long(str(self.public_exponent)))) return rsa.exportKey(format='PEM')