HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/cryptography/x509/__pycache__/general_name.cpython-38.pyc
U

�)%a��
@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
dddd	d
ddd
dd�	ZGdd�de�Z
Gdd�dejd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZdS)#�N)�	parseaddr)�utils)�Name)�ObjectIdentifierZ	otherNameZ
rfc822NameZdNSNameZx400AddressZ
directoryNameZediPartyNameZuniformResourceIdentifierZ	iPAddressZregisteredID)	r��������cseZdZ�fdd�Z�ZS)�UnsupportedGeneralNameTypecstt|��|�||_dS�N)�superr�__init__�type)�self�msgr��	__class__��@/usr/lib/python3/dist-packages/cryptography/x509/general_name.pyrsz#UnsupportedGeneralNameType.__init__)�__name__�
__module__�__qualname__r�
__classcell__rrrrrsrc@seZdZejdd��ZdS)�GeneralNamecCsdS)z0
        Return the value of the object
        Nr�rrrr�value$szGeneralName.valueN)rrr�abc�abstractpropertyrrrrrr#sr)�	metaclassc@sleZdZed�dd�Ze�d�Zedd��Z	ed�dd	�Z
eed
�dd�Z
eed
�d
d�Zed�dd�ZdS)�
RFC822Name�rcCsft|t�r8z|�d�Wq@tk
r4td��Yq@Xntd��t|�\}}|sT|s\td��||_dS)N�asciiz�RFC822Name values should be passed as an A-label string. This means unicode characters should be encoded via a library like idna.�value must be stringzInvalid rfc822name value)�
isinstance�str�encode�UnicodeEncodeError�
ValueError�	TypeErrorr�_value)rr�name�addressrrrr,s
�zRFC822Name.__init__r-cCs|�|�}||_|Sr��__new__r-��clsr�instancerrr�_init_without_validationCs
z#RFC822Name._init_without_validation��returncCsd�|j�S)Nz<RFC822Name(value={0!r})>��formatrrrrr�__repr__IszRFC822Name.__repr__��otherr7cCst|t�stS|j|jkSr)r'r#�NotImplementedr�rr<rrr�__eq__Ls
zRFC822Name.__eq__cCs
||kSrrr>rrr�__ne__RszRFC822Name.__ne__cCs
t|j�Sr��hashrrrrr�__hash__UszRFC822Name.__hash__N�rrrr(rr�read_only_propertyr�classmethodr5r:�object�boolr?r@�intrCrrrrr#+s

r#c@sfeZdZed�dd�Ze�d�Zedd��Z	dd�Z
eed	�d
d�Z
eed	�dd
�Zed�dd�ZdS)�DNSNamer$cCsJt|t�r8z|�d�Wq@tk
r4td��Yq@Xntd��||_dS)Nr%z~DNSName values should be passed as an A-label string. This means unicode characters should be encoded via a library like idna.r&�r'r(r)r*r+r,r-�rrrrrrZs
�zDNSName.__init__r-cCs|�|�}||_|Srr0r2rrrr5ks
z DNSName._init_without_validationcCsd�|j�S)Nz<DNSName(value={0!r})>r8rrrrr:qszDNSName.__repr__r;cCst|t�stS|j|jkSr)r'rJr=rr>rrrr?ts
zDNSName.__eq__cCs
||kSrrr>rrrr@zszDNSName.__ne__r6cCs
t|j�SrrArrrrrC}szDNSName.__hash__NrDrrrrrJYs

rJc@sleZdZed�dd�Ze�d�Zedd��Z	ed�dd	�Z
eed
�dd�Z
eed
�d
d�Zed�dd�ZdS)�UniformResourceIdentifierr$cCsJt|t�r8z|�d�Wq@tk
r4td��Yq@Xntd��||_dS)Nr%zzURI values should be passed as an A-label string. This means unicode characters should be encoded via a library like idna.r&rKrLrrrr�s
�z"UniformResourceIdentifier.__init__r-cCs|�|�}||_|Srr0r2rrrr5�s
z2UniformResourceIdentifier._init_without_validationr6cCsd�|j�S)Nz(<UniformResourceIdentifier(value={0!r})>r8rrrrr:�sz"UniformResourceIdentifier.__repr__r;cCst|t�stS|j|jkSr)r'rMr=rr>rrrr?�s
z UniformResourceIdentifier.__eq__cCs
||kSrrr>rrrr@�sz UniformResourceIdentifier.__ne__cCs
t|j�SrrArrrrrC�sz"UniformResourceIdentifier.__hash__NrDrrrrrM�s

rMc@s`eZdZed�dd�Ze�d�Zed�dd�Z	e
ed�d	d
�Ze
ed�dd�Z
ed�d
d�ZdS)�
DirectoryNamer$cCst|t�std��||_dS)Nzvalue must be a Name)r'rr,r-rLrrrr�s
zDirectoryName.__init__r-r6cCsd�|j�S)Nz<DirectoryName(value={})>r8rrrrr:�szDirectoryName.__repr__r;cCst|t�stS|j|jkSr)r'rNr=rr>rrrr?�s
zDirectoryName.__eq__cCs
||kSrrr>rrrr@�szDirectoryName.__ne__cCs
t|j�SrrArrrrrC�szDirectoryName.__hash__N)rrrrrrrErr(r:rGrHr?r@rIrCrrrrrN�s
rNc@s`eZdZed�dd�Ze�d�Zed�dd�Z	e
ed�d	d
�Ze
ed�dd�Z
ed�d
d�ZdS)�RegisteredIDr$cCst|t�std��||_dS)Nz!value must be an ObjectIdentifier)r'rr,r-rLrrrr�s
zRegisteredID.__init__r-r6cCsd�|j�S)Nz<RegisteredID(value={})>r8rrrrr:�szRegisteredID.__repr__r;cCst|t�stS|j|jkSr)r'rOr=rr>rrrr?�s
zRegisteredID.__eq__cCs
||kSrrr>rrrr@�szRegisteredID.__ne__cCs
t|j�SrrArrrrrC�szRegisteredID.__hash__N)rrrrrrrErr(r:rGrHr?r@rIrCrrrrrO�s
rOc@sveZdZejejejejej	fd�dd�Z
e�d�Z
ed�dd�Zeed�d	d
�Zeed�dd�Zed�d
d�ZdS)�	IPAddressr$cCs,t|tjtjtjtjf�s"td��||_dS)Nzzvalue must be an instance of ipaddress.IPv4Address, ipaddress.IPv6Address, ipaddress.IPv4Network, or ipaddress.IPv6Network)r'�	ipaddress�IPv4Address�IPv6Address�IPv4Network�IPv6Networkr,r-rLrrrr�s	��	�zIPAddress.__init__r-r6cCsd�|j�S)Nz<IPAddress(value={})>r8rrrrr:�szIPAddress.__repr__r;cCst|t�stS|j|jkSr)r'rPr=rr>rrrr?�s
zIPAddress.__eq__cCs
||kSrrr>rrrr@szIPAddress.__ne__cCs
t|j�SrrArrrrrCszIPAddress.__hash__N)rrr�typing�UnionrQrRrSrTrUrrrErr(r:rGrHr?r@rIrCrrrrrP�s���
rPc@sleZdZeed�dd�Ze�d�Ze�d�Z	e
d�dd�Zee
d	�d
d�Zee
d	�dd
�Zed�dd�ZdS)�	OtherName)�type_idrcCs4t|t�std��t|t�s$td��||_||_dS)Nz#type_id must be an ObjectIdentifierzvalue must be a binary string)r'rr,�bytes�_type_idr-)rrYrrrrr	s

zOtherName.__init__r[r-r6cCsd�|j|j�S)Nz#<OtherName(type_id={}, value={!r})>)r9rYrrrrrr:s�zOtherName.__repr__r;cCs&t|t�stS|j|jko$|j|jkSr)r'rXr=rYrr>rrrr?s
zOtherName.__eq__cCs
||kSrrr>rrrr@ szOtherName.__ne__cCst|j|jf�Sr)rBrYrrrrrrC#szOtherName.__hash__N)rrrrrZrrrErYrr(r:rGrHr?r@rIrCrrrrrXs	

rX)r rQrV�email.utilsr�cryptographyr�cryptography.x509.namer�cryptography.x509.oidr�_GENERAL_NAMES�	Exceptionr�ABCMetarr#rJrMrNrOrPrXrrrr�<module>s2�
.((-