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-312.pyc
�

�)%a��
�@�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
dddd	d
ddd
dd�	ZGd�de�Z
Gd�dej��ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�d e�ZGd!�d"e�Zy)#�N)�	parseaddr)�utils)�Name)�ObjectIdentifier�	otherName�
rfc822Name�dNSName�x400Address�
directoryName�ediPartyName�uniformResourceIdentifier�	iPAddress�registeredID)	r��������c���eZdZ�fd�Z�xZS)�UnsupportedGeneralNameTypec�:��tt|�|�||_y�N)�superr�__init__�type)�self�msgr�	__class__s   ��@/usr/lib/python3/dist-packages/cryptography/x509/general_name.pyrz#UnsupportedGeneralNameType.__init__s���
�(�$�8��=���	�)�__name__�
__module__�__qualname__r�
__classcell__)r!s@r"rrs
����r#rc�0�eZdZejd��Zy)�GeneralNamec��y)z0
        Return the value of the object
        N��rs r"�valuezGeneralName.value$s�r#N)r$r%r&�abc�abstractpropertyr-r+r#r"r)r)#s�������r#r))�	metaclassc��eZdZdefd�Zejd�Zed��Z	defd�Z
dedefd�Z
dedefd	�Zdefd
�Zy)�
RFC822Namer-c���t|t�r	|jd�ntd��t
|�\}}|s|st	d��||_y#t$rt	d��wxYw)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�addresss    r"rzRFC822Name.__init__,sv���e�S�!�
����W�%��2�3�3�!�%�(�
��g��w��7�8�8�����&�
� �+���
�s�A�A)r<c�6�|j|�}||_|Sr��__new__r<��clsr-�instances   r"�_init_without_validationz#RFC822Name._init_without_validationC����;�;�s�#������r#�returnc�8�dj|j�S)Nz<RFC822Name(value={0!r})>��formatr-r,s r"�__repr__zRFC822Name.__repr__I���*�1�1�$�*�*�=�=r#�otherc�`�t|t�stS|j|jk(Sr)r6r2�NotImplementedr-�rrMs  r"�__eq__zRFC822Name.__eq__Ls%���%��,�!�!��z�z�U�[�[�(�(r#c��||k(Srr+rPs  r"�__ne__zRFC822Name.__ne__R����5�=� � r#c�,�t|j�Sr��hashr-r,s r"�__hash__zRFC822Name.__hash__U����D�J�J��r#N�r$r%r&r7rr�read_only_propertyr-�classmethodrErK�object�boolrQrS�intrXr+r#r"r2r2+sr���c��*
%�E�$�$�X�.�E�����
>�#�>�)�F�)�t�)�!�F�!�t�!� �#� r#r2c�~�eZdZdefd�Zejd�Zed��Z	d�Z
dedefd�Z
dedefd	�Zdefd
�Zy)�DNSNamer-c��t|t�r	|jd�||_ytd��#t$rt	d��wxYw)Nr4z~DNSName values should be passed as an A-label string. This means unicode characters should be encoded via a library like idna.r5�r6r7r8r9r:r;r<�rr-s  r"rzDNSName.__init__Z�W���e�S�!�
����W�%�����2�3�3��&�
� �+���
��	�6�Ar<c�6�|j|�}||_|Srr@rBs   r"rEz DNSName._init_without_validationkrFr#c�8�dj|j�S)Nz<DNSName(value={0!r})>rIr,s r"rKzDNSName.__repr__qs��'�.�.�t�z�z�:�:r#rMrGc�`�t|t�stS|j|jk(Sr)r6rarOr-rPs  r"rQzDNSName.__eq__ts%���%��)�!�!��z�z�U�[�[�(�(r#c��||k(Srr+rPs  r"rSzDNSName.__ne__zrTr#c�,�t|j�SrrVr,s r"rXzDNSName.__hash__}rYr#NrZr+r#r"raraYsk��
�c�
�
%�E�$�$�X�.�E�����
;�)�F�)�t�)�!�F�!�t�!� �#� r#rac��eZdZdefd�Zejd�Zed��Z	defd�Z
dedefd�Z
dedefd	�Zdefd
�Zy)�UniformResourceIdentifierr-c��t|t�r	|jd�||_ytd��#t$rt	d��wxYw)Nr4zzURI values should be passed as an A-label string. This means unicode characters should be encoded via a library like idna.r5rcrds  r"rz"UniformResourceIdentifier.__init__�rerfr<c�6�|j|�}||_|Srr@rBs   r"rEz2UniformResourceIdentifier._init_without_validation�rFr#rGc�8�dj|j�S)Nz(<UniformResourceIdentifier(value={0!r})>rIr,s r"rKz"UniformResourceIdentifier.__repr__�s��9�@�@����L�Lr#rMc�`�t|t�stS|j|jk(Sr)r6rmrOr-rPs  r"rQz UniformResourceIdentifier.__eq__�s&���%�!:�;�!�!��z�z�U�[�[�(�(r#c��||k(Srr+rPs  r"rSz UniformResourceIdentifier.__ne__�rTr#c�,�t|j�SrrVr,s r"rXz"UniformResourceIdentifier.__hash__�rYr#NrZr+r#r"rmrm�st��
�c�
�
%�E�$�$�X�.�E�����
M�#�M�)�F�)�t�)�!�F�!�t�!� �#� r#rmc�t�eZdZdefd�Zejd�Zdefd�Z	de
defd�Zde
defd�Z
defd	�Zy
)�
DirectoryNamer-c�H�t|t�std��||_y)Nzvalue must be a Name)r6rr;r<rds  r"rzDirectoryName.__init__�s���%��&��2�3�3���r#r<rGc�8�dj|j�S)Nz<DirectoryName(value={})>rIr,s r"rKzDirectoryName.__repr__�rLr#rMc�`�t|t�stS|j|jk(Sr)r6rurOr-rPs  r"rQzDirectoryName.__eq__�s%���%��/�!�!��z�z�U�[�[�(�(r#c��||k(Srr+rPs  r"rSzDirectoryName.__ne__�rTr#c�,�t|j�SrrVr,s r"rXzDirectoryName.__hash__�rYr#N)r$r%r&rrrr[r-r7rKr]r^rQrSr_rXr+r#r"ruru�s`���d��
%�E�$�$�X�.�E�>�#�>�)�F�)�t�)�!�F�!�t�!� �#� r#ruc�t�eZdZdefd�Zejd�Zdefd�Z	de
defd�Zde
defd�Z
defd	�Zy
)�RegisteredIDr-c�H�t|t�std��||_y)Nz!value must be an ObjectIdentifier)r6rr;r<rds  r"rzRegisteredID.__init__�s ���%�!1�2��?�@�@���r#r<rGc�8�dj|j�S)Nz<RegisteredID(value={})>rIr,s r"rKzRegisteredID.__repr__�s��)�0�0����<�<r#rMc�`�t|t�stS|j|jk(Sr)r6r|rOr-rPs  r"rQzRegisteredID.__eq__�s%���%��.�!�!��z�z�U�[�[�(�(r#c��||k(Srr+rPs  r"rSzRegisteredID.__ne__�rTr#c�,�t|j�SrrVr,s r"rXzRegisteredID.__hash__�rYr#N)r$r%r&rrrr[r-r7rKr]r^rQrSr_rXr+r#r"r|r|�sa���.��
%�E�$�$�X�.�E�=�#�=�)�F�)�t�)�!�F�!�t�!� �#� r#r|c���eZdZdejejejejejffd�Z
ejd�Z
defd�Zdedefd�Zdedefd�Zdefd	�Zy
)�	IPAddressr-c��t|tjtjtjtj
f�st
d��||_y)Nzzvalue must be an instance of ipaddress.IPv4Address, ipaddress.IPv6Address, ipaddress.IPv4Network, or ipaddress.IPv6Network)r6�	ipaddress�IPv4Address�IPv6Address�IPv4Network�IPv6Networkr;r<rds  r"rzIPAddress.__init__�sU�����%�%��%�%��%�%��%�%�	
�
��(��
���r#r<rGc�8�dj|j�S)Nz<IPAddress(value={})>rIr,s r"rKzIPAddress.__repr__�s��&�-�-�d�j�j�9�9r#rMc�`�t|t�stS|j|jk(Sr)r6r�rOr-rPs  r"rQzIPAddress.__eq__�s%���%��+�!�!��z�z�U�[�[�(�(r#c��||k(Srr+rPs  r"rSzIPAddress.__ne__rTr#c�,�t|j�SrrVr,s r"rXzIPAddress.__hash__rYr#N)r$r%r&�typing�Unionr�r�r�r�r�rrr[r-r7rKr]r^rQrSr_rXr+r#r"r�r��s�����|�|��!�!��!�!��!�!��!�!�
#�
��4
%�E�$�$�X�.�E�:�#�:�)�F�)�t�)�!�F�!�t�!� �#� r#r�c��eZdZdedefd�Zejd�Zejd�Z	de
fd�Zdede
fd	�Zdede
fd
�Zdefd�Zy)
�	OtherName�type_idr-c��t|t�std��t|t�std��||_||_y)Nz#type_id must be an ObjectIdentifierzvalue must be a binary string)r6rr;�bytes�_type_idr<)rr�r-s   r"rzOtherName.__init__	s=���'�#3�4��A�B�B��%��'��;�<�<���
���r#r�r<rGc�N�dj|j|j�S)Nz#<OtherName(type_id={}, value={!r})>)rJr�r-r,s r"rKzOtherName.__repr__s"��4�;�;��L�L�$�*�*�
�	
r#rMc��t|t�stS|j|jk(xr|j|jk(Sr)r6r�rOr�r-rPs  r"rQzOtherName.__eq__s7���%��+�!�!��|�|�u�}�}�,�J����u�{�{�1J�Jr#c��||k(Srr+rPs  r"rSzOtherName.__ne__ rTr#c�D�t|j|jf�Sr)rWr�r-r,s r"rXzOtherName.__hash__#s���T�\�\�4�:�:�.�/�/r#N)r$r%r&rr�rrr[r�r-r7rKr]r^rQrSr_rXr+r#r"r�r�s}��� 0����'�e�&�&�z�2�G�$�E�$�$�X�.�E�
�#�
�
K�F�K�t�K�!�F�!�t�!�0�#�0r#r�)r.r�r��email.utilsr�cryptographyr�cryptography.x509.namer�cryptography.x509.oidr�_GENERAL_NAMES�	Exceptionr�ABCMetar)r2rarmrur|r�r�r+r#r"�<module>r�s�����
�!��'�2�������"���
������C�K�K��+ ��+ �\% �k�% �P% ��% �P �K� �2 �;� �2* ��* �Z0��0r#