From b6a9acb8bae06bc8c764c572aaefadb06504e54f Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Fri, 16 Jul 2021 15:34:45 -0500 Subject: [PATCH] Fix issue #1 --- CHANGELOG.md | 5 +++++ VERSION | 2 +- source/sat/cfdi_cert.py | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0da8b07..10f6d5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Lista de cambios +## v 0.2.1 [16-Jul-21] +--- +* Fix - Issue #1 + + ## v 0.2.0 [15-Jul-21] --- * Se agrega la posibilidad de firmar con fiel en formato PEM diff --git a/VERSION b/VERSION index 0ea3a94..0c62199 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 +0.2.1 diff --git a/source/sat/cfdi_cert.py b/source/sat/cfdi_cert.py index 9fe9cbd..ec1937f 100644 --- a/source/sat/cfdi_cert.py +++ b/source/sat/cfdi_cert.py @@ -19,7 +19,7 @@ from conf import TOKEN class SATCertificate(object): - def __init__(self, cer=b'', key=b'', pem='', password=''): + def __init__(self, cer=b'', key=b'', pem=b'', password=''): self._error = '' self._init_values() self._get_data_cer(cer) @@ -38,6 +38,7 @@ class SATCertificate(object): self._cer_pem = '' self._cer_txt = '' self._key_enc = b'' + self._key_pem = b'' self._p12 = b'' self._cer_modulus = 0 self._key_modulus = 0 @@ -133,6 +134,9 @@ class SATCertificate(object): return key_pem def _get_data_pem(self, pem): + if not pem: + return + self._key_pem = serialization.load_pem_private_key( pem, None, backend=default_backend()) return