https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/lib/python2.7/site-packages/asn1crypto/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/lib/python2.7/site-packages/asn1crypto/pem.pyc
�
y�\c@`s�dZddlmZmZmZmZddlZddlZddlZddl	m
Z
ddlmZ
mZmZejdkr�ddlmZndd	lmZd
�Zdd�Zd�Zed
�ZdS(uq
Encoding DER to PEM and decoding PEM to DER. Exports the following items:

 - armor()
 - detect()
 - unarmor()

i(tunicode_literalstdivisiontabsolute_importtprint_functionNi(tunwrap(t	type_nametstr_clstbyte_clsi(tStringIO(tBytesIOcC`sUt|t�s-ttdt|����n|jd�dkpT|jd�dkS(u�
    Detect if a byte string seems to contain a PEM-encoded block

    :param byte_string:
        A byte string to look through

    :return:
        A boolean, indicating if a PEM-encoded block is contained in the byte
        string
    uC
            byte_string must be a byte string, not %s
            s
-----BEGINi����s
---- BEGIN(t
isinstanceRt	TypeErrorRt
_type_nametfind(tbyte_string((s4/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/pem.pytdetects
cC`s�t|t�s.ttdt|����nt|t�s[ttdt|����n|j�jd�}t�}|j	d�|j	|�|j	d�|rxX|D]P}|j	|jd��|j	d�|j	||jd��|j	d�q�W|j	d�nt
j|�}t|�}d}x?||krs|j	|||d	!�|j	d�|d	7}q5W|j	d
�|j	|�|j	d�|j
�S(u

    Armors a DER-encoded byte string in PEM

    :param type_name:
        A unicode string that will be capitalized and placed in the header
        and footer of the block. E.g. "CERTIFICATE", "PRIVATE KEY", etc. This
        will appear as "-----BEGIN CERTIFICATE-----" and
        "-----END CERTIFICATE-----".

    :param der_bytes:
        A byte string to be armored

    :param headers:
        An OrderedDict of the header lines to write after the BEGIN line

    :return:
        A byte string of the PEM block
    uA
            der_bytes must be a byte string, not %s
            uD
            type_name must be a unicode string, not %s
            uasciis-----BEGIN s-----
s: s
ii@s	-----END (R
RRRRRtuppertencodeR	twritetbase64t	b64encodetlentgetvalue(Rt	der_bytestheaderstoutputtkeyt	b64_bytestb64_lenti((s4/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/pem.pytarmor2s<	








c
c`s�t|t�s-ttdt|����nd}i}d}d}t}t}xQ|jt�D]@}|dkryqan|dkr�tj	d|�}|s�qan|j
d�jd�}t}d}qan|dkr4|j
d�d	kr�d
}q4|jd�}	|	jdd�\}
}|j�||
<qan|d
kra|dd
!dkr�tj|�}|||fVd}i}d}d}t}qan||7}qaqaW|s�|r�ttd���ndS(ux
    Convert a PEM-encoded byte string into one or more DER-encoded byte strings

    :param pem_bytes:
        A byte string of the PEM-encoded data

    :raises:
        ValueError - when the pem_bytes do not appear to be PEM-encoded bytes

    :return:
        A generator of 3-element tuples in the format: (object_type, headers,
        der_bytes). The object_type is a unicode string of what is between
        "-----BEGIN " and "-----". Examples include: "CERTIFICATE",
        "PUBLIC KEY", "PRIVATE KEY". The headers is a dict containing any lines
        in the form "Name: Value" that are right after the begin line.
    uA
            pem_bytes must be a byte string, not %s
            utrashts1^(?:---- |-----)BEGIN ([A-Z0-9 ]+)(?: ----|-----)iuasciiuheaderst:i����ubodyu:iis-----s---- u|
            pem_bytes does not appear to contain PEM-encoded data - no
            BEGIN/END combination found
            N(s-----s---- (R
RRRRtNonetFalset
splitlinestretmatchtgrouptdecodetTrueR
tsplittstripRt	b64decodet
ValueError(
t	pem_byteststateRtbase64_datatobject_typetfound_startt	found_endtlinettype_name_matchtdecoded_linetnametvalueR((s4/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/pem.pyt_unarmorpsT	cC`s t|�}|st|�S|S(u�
    Convert a PEM-encoded byte string into a DER-encoded byte string

    :param pem_bytes:
        A byte string of the PEM-encoded data

    :param multiple:
        If True, function will return a generator

    :raises:
        ValueError - when the pem_bytes do not appear to be PEM-encoded bytes

    :return:
        A 3-element tuple (object_name, headers, der_bytes). The object_name is
        a unicode string of what is between "-----BEGIN " and "-----". Examples
        include: "CERTIFICATE", "PUBLIC KEY", "PRIVATE KEY". The headers is a
        dict containing any lines in the form "Name: Value" that are right
        after the begin line.
    (R8tnext(R-tmultiplet	generator((s4/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/pem.pytunarmor�s
(i(t__doc__t
__future__RRRRRR$tsyst_errorsRt_typesRRRRtversion_infot	cStringIORR	tioRR!RR8R"R<(((s4/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/pem.pyt<module>
s"	>	T

https://t.me/AnonymousX5 - 2025