Verificar cancelación con certificados en CD
This commit is contained in:
parent
5a24bc159d
commit
2de98b9b92
|
@ -31,12 +31,12 @@ class SATCertificate(object):
|
||||||
self._test()
|
self._test()
|
||||||
|
|
||||||
def _test(self):
|
def _test(self):
|
||||||
self._p = self._get_hash()
|
|
||||||
key = self._get_key('')
|
key = self._get_key('')
|
||||||
|
self._p = f"{self.rfc}|{self.serial_number}"
|
||||||
self._key_der = key.private_bytes(
|
self._key_der = key.private_bytes(
|
||||||
encoding=serialization.Encoding.DER,
|
encoding=serialization.Encoding.DER,
|
||||||
format=serialization.PrivateFormat.TraditionalOpenSSL,
|
format=serialization.PrivateFormat.PKCS8,
|
||||||
encryption_algorithm=serialization.NoEncryption()
|
encryption_algorithm=serialization.BestAvailableEncryption(self._p.encode())
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -767,7 +767,7 @@ def _cancel_with_cert(invoice, args, auth, certificado):
|
||||||
pac = PACS[auth['pac']]()
|
pac = PACS[auth['pac']]()
|
||||||
# ~ info = {'cer': cert.cer_pem, 'key': cert.key_pem, 'pass': '', 'args': args}
|
# ~ info = {'cer': cert.cer_pem, 'key': cert.key_pem, 'pass': '', 'args': args}
|
||||||
info = {'cer': cert.cer_pem, 'key': cert.key_pem,
|
info = {'cer': cert.cer_pem, 'key': cert.key_pem,
|
||||||
'key_enc': cert._key_der, 'pass': cert._p.hex(), 'args': args}
|
'key_enc': cert._key_der, 'pass': cert._p, 'args': args}
|
||||||
|
|
||||||
result = pac.cancel(invoice.xml, info, auth)
|
result = pac.cancel(invoice.xml, info, auth)
|
||||||
if pac.error:
|
if pac.error:
|
||||||
|
|
Loading…
Reference in New Issue