| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/pysimplesoap/__pycache__/ |
Upload File : |
a
�/$ZB � @ sx d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z m
Z
mZmZm
Z
zddlZW n eyr dZY n0 dZdZdZd Zd
ZdZd*d
d�Zdd� Zdddeefdd�Zd+dd�Zdd� Zd,dd�Zd-dd�Zd.dd�Zedk�rtdZ ee �Z!e"e!� ee d d!d"�Z#e"ee# � d#Z ee d$ d$d!d"edd%�Z#e"e ee# � ee$d&��%� �Z&ee#d' e#d( e&dd)��stJ �dS )/z,Pythonic XML Security Library implementation� )�print_functionN)�StringIO)�BIO�EVP�RSA�X509�m2a�
<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="%(ref_uri)s">
<Transforms>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>%(digest_value)s</DigestValue>
</Reference>
</SignedInfo>
z�
<?xml version="1.0" encoding="UTF-8"?>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
%(signed_info)s
<SignatureValue>%(signature_value)s</SignatureValue>
%(key_info)s
%(ref_xml)s
</Signature>
aO
<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>%(digest_value)s</DigestValue>
</Reference>
</SignedInfo>
z�<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
%(signed_info)s
<SignatureValue>%(signature_value)s</SignatureValue>
%(key_info)s
</Signature>z�
<KeyInfo>
<KeyValue>
<RSAKeyValue>
<Modulus>%(modulus)s</Modulus>
<Exponent>%(exponent)s</Exponent>
</RSAKeyValue>
</KeyValue>
</KeyInfo>
z�
<KeyInfo>
<X509Data>
<X509IssuerSerial>
<X509IssuerName>%(issuer_name)s</X509IssuerName>
<X509SerialNumber>%(serial_number)s</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
</KeyInfo>
Tc C sT t � }tdur.tj�t | ��}|j||d� nddlm} || �j||d� |�� S )z@Return the canonical (c14n) form of the xml document for hashingN)Z exclusive� )�SimpleXMLElement)r �lxmlZetree�parseZ
write_c14nZ simplexmlr
�getvalue)�xml�c14n_exc�outputZetr
� r �5/usr/lib/python3/dist-packages/pysimplesoap/xmlsec.py�canonicalizeb s r c C s t �t�| ��� �S )z/Create a SHA1 hash and return the base64 string)�base64� b64encode�hashlib�sha1�digest)Zpayloadr r r �sha1_hash_digestq s r c sl t | |�}||t|�d� } t | |�} t�|� fdd��}
|
�t�| ��� �}||| t� |�t
|
||�d�S )zISign an XML document usign RSA (templates: enveloped -ref- or enveloping))�ref_uriZdigest_valuec s � S )Nr )�args�kwargs��passwordr r �<lambda>� � zrsa_sign.<locals>.<lambda>)�ref_xmlr �signed_info�signature_value�key_info)r r r Zload_keyZsignr r r r r r$ )r r Zprivate_keyr �certr �
sign_template�key_info_templater! r"