facho/fe/form_xml: se translada de vecindario.
FossilOrigin-Name: 1f10d9fdd2362de65561943f96720ecb03e8cbbc34ada162359cb4636f6cc266
This commit is contained in:
15
facho/fe/form_xml/utils.py
Normal file
15
facho/fe/form_xml/utils.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from .. import fe
|
||||
|
||||
__all__ = ['DIANWrite', 'DIANWriteSigned']
|
||||
|
||||
def DIANWrite(xml, filename):
|
||||
document = xml.tostring(xml_declaration=True, encoding='UTF-8')
|
||||
with open(filename, 'w') as f:
|
||||
f.write(document)
|
||||
|
||||
|
||||
def DIANWriteSigned(xml, filename, private_key, passphrase, use_cache_policy=False):
|
||||
document = xml.tostring(xml_declaration=True, encoding='UTF-8')
|
||||
signer = fe.DianXMLExtensionSigner(private_key, passphrase=passphrase, mockpolicy=use_cache_policy)
|
||||
with open(filename, 'w') as f:
|
||||
f.write(signer.sign_xml_string(document))
|
||||
Reference in New Issue
Block a user