diff --git a/pytrustnfe/certificado.py b/pytrustnfe/certificado.py index b96df91..d24732c 100644 --- a/pytrustnfe/certificado.py +++ b/pytrustnfe/certificado.py @@ -2,8 +2,7 @@ # © 2016 Danimar Ribeiro, Trustcode # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from uuid import uuid4 +import tempfile from OpenSSL import crypto @@ -13,7 +12,7 @@ class Certificado(object): self.password = password def save_pfx(self): - pfx_temp = '/tmp/' + uuid4().hex + pfx_temp = tempfile.mkstemp()[1] arq_temp = open(pfx_temp, 'wb') arq_temp.write(self.pfx) arq_temp.close() @@ -32,8 +31,8 @@ def extract_cert_and_key_from_pfx(pfx, password): def save_cert_key(cert, key): - cert_temp = '/tmp/' + uuid4().hex - key_temp = '/tmp/' + uuid4().hex + cert_temp = tempfile.mkstemp()[1] + key_temp = tempfile.mkstemp()[1] arq_temp = open(cert_temp, 'w') arq_temp.write(cert) diff --git a/requirements.txt b/requirements.txt index 886103b..c42cf9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ Jinja2 signxml urllib3 >= 1.22 suds-jurko >= 0.6 -suds-jurko-requests >= 1.0 +suds-jurko-requests >= 1.1 defusedxml >= 0.4.1, < 0.6 eight >= 0.3.0, < 0.5 cryptography >= 1.8, < 1.10 diff --git a/setup.py b/setup.py index e5a3b5d..84740cf 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # coding=utf-8 from setuptools import setup, find_packages -VERSION = "0.1.0" +VERSION = "0.1.1" setup( name="PyTrustNFe3", @@ -41,7 +41,7 @@ later (LGPLv2+)', 'signxml >= 2.4.0', 'lxml >= 3.5.0, < 4', 'suds-jurko >= 0.6', - 'suds-jurko-requests >= 0.3', + 'suds-jurko-requests >= 1.1', 'reportlab' ], tests_require=[