5H 7_# d dgZ ddlZddlmZmZmZmZ ddlmZ ddl m
Z
mZ ddlm
Z
mZmZ ddlmZ dd lmZ dd
lmZmZ ddZd Zdd
ZdS )encodedecode N)
a2b_base64
b2a_base64hexlify unhexlify)MD5)padunpad)DESDES3AES)PBKDF1)get_random_bytes)tobytestostrc Z |t }d|z }|r |d }t ||ddt }|t ||z |ddt z
}t j |t j | }|dt
t | z z
}| t |j n|t d fdt d t d
D }|d | z
}|d|z z
}|S )
a4 Encode a piece of binary data into PEM format.
Args:
data (byte string):
The piece of binary data to encode.
marker (string):
The marker for the PEM block (e.g. "PUBLIC KEY").
Note that there is no official master list for all allowed markers.
Still, you can refer to the OpenSSL_ source code.
passphrase (byte string):
If given, the PEM block will be encrypted. The key is derived from
the passphrase.
randfunc (callable):
Random number generation function; it accepts an integer N and returns
a byte string of random data, N bytes long. If not given, a new one is
instantiated.
Returns:
The PEM block, as a string.
.. _OpenSSL: https://github.com/openssl/openssl/blob/master/include/openssl/pem.h
Nz-----BEGIN %s-----
z2Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,%s
zEmpty passwordc
^ g | ])}t t ||d z *S )0 )r r ).0idatas o/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/IO/PEM.py