HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/cryptography/x509/__pycache__/general_name.cpython-38.pyc
U

�e�]�(�
@s~ddlmZmZmZddlZddlZddlZddlmZddl	Z	ddl
mZddlm
Z
ddlmZddlmZdd	d
ddd
dddd�	Zdd�ZGdd�de�Ze	�ej�Gdd�de��Ze
�e�Gdd�de��Zdd�Ze
�e�Gdd�de��Ze
�e�Gdd�de��Ze
�e�Gd d!�d!e��Ze
�e�Gd"d#�d#e��Z e
�e�Gd$d%�d%e��Z!e
�e�Gd&d'�d'e��Z"dS)(�)�absolute_import�division�print_functionN)�	parseaddr)�urllib_parse)�utils)�Name)�ObjectIdentifierZ	otherNameZ
rfc822NameZdNSNameZx400AddressZ
directoryNameZediPartyNameZuniformResourceIdentifierZ	iPAddressZregisteredID)	r��������cCs0zddl}|WStk
r*td��YnXdS)Nrz�idna is not installed, but a deprecated feature that requires it was used. See: https://cryptography.io/en/latest/faq/#importerror-idna-is-not-installed)�idna�ImportError)r�r�@/usr/lib/python3/dist-packages/cryptography/x509/general_name.py�_lazy_import_idna!s�rcseZdZ�fdd�Z�ZS)�UnsupportedGeneralNameTypecstt|��|�||_dS�N)�superr�__init__�type)�self�msgr��	__class__rrr0sz#UnsupportedGeneralNameType.__init__)�__name__�
__module__�__qualname__r�
__classcell__rrrrr/src@seZdZejdd��ZdS)�GeneralNamecCsdS)z0
        Return the value of the object
        Nr�rrrr�value7szGeneralName.valueN)r r!r"�abc�abstractpropertyr&rrrrr$5sr$c@sReZdZdd�Ze�d�Zedd��Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dS)�
RFC822NamecCs|t|tj�rNz|�d�WqVtk
rJ|�|�}tjdtj	dd�YqVXnt
d��t|�\}}|sj|srtd��||_
dS)N�asciiz�RFC822Name values should be passed as an A-label string. This means unicode characters should be encoded via idna. Support for passing unicode strings (aka U-label) will be removed in a future version.r��
stacklevel�value must be stringzInvalid rfc822name value)�
isinstance�six�	text_type�encode�UnicodeEncodeError�_idna_encode�warnings�warnr�PersistentlyDeprecated2017�	TypeErrorr�
ValueError�_value)rr&�name�addressrrrr@s
�	zRFC822Name.__init__r9cCs|�|�}||_|Sr��__new__r9��clsr&�instancerrr�_init_without_validation[s
z#RFC822Name._init_without_validationcCs<t�}t|�\}}|�d�}|dd|�|d��d�S)N�@rr
r*)rr�splitr1�decode)rr&r�_r;�partsrrrr3as
zRFC822Name._idna_encodecCsd�|j�S)Nz<RFC822Name(value={0!r})>��formatr&r%rrr�__repr__gszRFC822Name.__repr__cCst|t�stS|j|jkSr)r.r)�NotImplementedr&�r�otherrrr�__eq__js
zRFC822Name.__eq__cCs
||kSrrrKrrr�__ne__pszRFC822Name.__ne__cCs
t|j�Sr��hashr&r%rrr�__hash__sszRFC822Name.__hash__N�r r!r"rr�read_only_propertyr&�classmethodrAr3rIrMrNrQrrrrr)>s

r)cCsRt�}dD]6}|�|�r
|t|�d�}||�|��d�Sq
|�|��d�S)N)z*.�.r*)r�
startswith�lenr1rD)r&r�prefixrrrr3ws
r3c@sJeZdZdd�Ze�d�Zedd��Zdd�Z	dd	�Z
d
d�Zdd
�ZdS)�DNSNamecCs^t|tj�rLz|�d�WqTtk
rHt|�}tjdtj	dd�YqTXnt
d��||_dS)Nr*z�DNSName values should be passed as an A-label string. This means unicode characters should be encoded via idna. Support for passing unicode strings (aka U-label) will be removed in a future version.rr+r-�r.r/r0r1r2r3r4r5rr6r7r9�rr&rrrr�s�	zDNSName.__init__r9cCs|�|�}||_|Srr<r>rrrrA�s
z DNSName._init_without_validationcCsd�|j�S)Nz<DNSName(value={0!r})>rGr%rrrrI�szDNSName.__repr__cCst|t�stS|j|jkSr)r.rYrJr&rKrrrrM�s
zDNSName.__eq__cCs
||kSrrrKrrrrN�szDNSName.__ne__cCs
t|j�SrrOr%rrrrQ�szDNSName.__hash__N)
r r!r"rrrSr&rTrArIrMrNrQrrrrrY�s

rYc@sReZdZdd�Ze�d�Zedd��Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dS)�UniformResourceIdentifiercCs`t|tj�rNz|�d�WqVtk
rJ|�|�}tjdtj	dd�YqVXnt
d��||_dS)Nr*z�URI values should be passed as an A-label string. This means unicode characters should be encoded via idna. Support for passing unicode strings (aka U-label)  will be removed in a future version.rr+r-rZr[rrrr�s
�	z"UniformResourceIdentifier.__init__r9cCs|�|�}||_|Srr<r>rrrrA�s
z2UniformResourceIdentifier._init_without_validationcCsnt�}t�|�}|jr<|�|j�d�|j��d��d�}n|�|j��d�}t�|j	||j
|j|j|j
f�S)Nz:{}r*)rrZurlparseZportr1ZhostnamerHrDZ
urlunparseZscheme�pathZparamsZqueryZfragment)rr&rZparsedZnetlocrrrr3�s$

����z&UniformResourceIdentifier._idna_encodecCsd�|j�S)Nz(<UniformResourceIdentifier(value={0!r})>rGr%rrrrI�sz"UniformResourceIdentifier.__repr__cCst|t�stS|j|jkSr)r.r\rJr&rKrrrrM�s
z UniformResourceIdentifier.__eq__cCs
||kSrrrKrrrrN�sz UniformResourceIdentifier.__ne__cCs
t|j�SrrOr%rrrrQ�sz"UniformResourceIdentifier.__hash__NrRrrrrr\�s

r\c@s>eZdZdd�Ze�d�Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
�
DirectoryNamecCst|t�std��||_dS)Nzvalue must be a Name)r.rr7r9r[rrrr�s
zDirectoryName.__init__r9cCsd�|j�S)Nz<DirectoryName(value={})>rGr%rrrrI�szDirectoryName.__repr__cCst|t�stS|j|jkSr)r.r^rJr&rKrrrrM�s
zDirectoryName.__eq__cCs
||kSrrrKrrrrNszDirectoryName.__ne__cCs
t|j�SrrOr%rrrrQszDirectoryName.__hash__N�r r!r"rrrSr&rIrMrNrQrrrrr^�s
r^c@s>eZdZdd�Ze�d�Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
�RegisteredIDcCst|t�std��||_dS)Nz!value must be an ObjectIdentifier)r.r	r7r9r[rrrrs
zRegisteredID.__init__r9cCsd�|j�S)Nz<RegisteredID(value={})>rGr%rrrrIszRegisteredID.__repr__cCst|t�stS|j|jkSr)r.r`rJr&rKrrrrMs
zRegisteredID.__eq__cCs
||kSrrrKrrrrNszRegisteredID.__ne__cCs
t|j�SrrOr%rrrrQ"szRegisteredID.__hash__Nr_rrrrr`s
r`c@s>eZdZdd�Ze�d�Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
�	IPAddresscCs,t|tjtjtjtjf�s"td��||_dS)Nzzvalue must be an instance of ipaddress.IPv4Address, ipaddress.IPv6Address, ipaddress.IPv4Network, or ipaddress.IPv6Network)r.�	ipaddressZIPv4AddressZIPv6AddressZIPv4NetworkZIPv6Networkr7r9r[rrrr(s��	�zIPAddress.__init__r9cCsd�|j�S)Nz<IPAddress(value={})>rGr%rrrrI<szIPAddress.__repr__cCst|t�stS|j|jkSr)r.rarJr&rKrrrrM?s
zIPAddress.__eq__cCs
||kSrrrKrrrrNEszIPAddress.__ne__cCs
t|j�SrrOr%rrrrQHszIPAddress.__hash__Nr_rrrrra&s
rac@sHeZdZdd�Ze�d�Ze�d�Zdd�Zdd�Z	d	d
�Z
dd�Zd
S)�	OtherNamecCs4t|t�std��t|t�s$td��||_||_dS)Nz#type_id must be an ObjectIdentifierzvalue must be a binary string)r.r	r7�bytes�_type_idr9)r�type_idr&rrrrNs

zOtherName.__init__rer9cCsd�|j|j�S)Nz#<OtherName(type_id={}, value={!r})>)rHrfr&r%rrrrIZs�zOtherName.__repr__cCs&t|t�stS|j|jko$|j|jkSr)r.rcrJrfr&rKrrrrM^s
zOtherName.__eq__cCs
||kSrrrKrrrrNdszOtherName.__ne__cCst|j|jf�Sr)rPrfr&r%rrrrQgszOtherName.__hash__N)r r!r"rrrSrfr&rIrMrNrQrrrrrcLs	

rc)#Z
__future__rrrr'rbr4Zemail.utilsrr/Z	six.movesrZcryptographyrZcryptography.x509.namerZcryptography.x509.oidr	Z_GENERAL_NAMESr�	ExceptionrZ
add_metaclass�ABCMeta�objectr$Zregister_interfacer)r3rYr\r^r`rarcrrrr�<module>sL�

8
,C%