o
    ™¨Êh„  ã                   @   s4   d dl mZmZmZ d dlmZ G dd„ deƒZdS )é    )Úabsolute_importÚdivisionÚprint_function)Úutilsc                   @   sJ   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zedd„ ƒZ	e
 d¡ZdS )ÚObjectIdentifierc              	   C   s²   || _ | j  d¡}g }|D ]}z
| t|dƒ¡ W q ty'   td| j  ƒ‚w t|ƒdk r5td| j  ƒ‚|d dkrBtd| j  ƒ‚|d dk rU|d dkrWtd	| j  ƒ‚d S d S )
NÚ.r   z%Malformed OID: %s (non-integer nodes)é   z0Malformed OID: %s (insufficient number of nodes)z2Malformed OID: %s (first node outside valid range)é   é(   z3Malformed OID: %s (second node outside valid range))Ú_dotted_stringÚsplitÚappendÚintÚ
ValueErrorÚlen)ÚselfÚdotted_stringÚnodesÚintnodesÚnode© r   úJ/var/www/html/env/lib/python3.10/site-packages/cryptography/hazmat/_oid.pyÚ__init__   s@   ÿÿÿÿÿÿÿÿÿÿzObjectIdentifier.__init__c                 C   s   t |tƒstS | j|jkS ©N)Ú
isinstancer   ÚNotImplementedr   ©r   Úotherr   r   r   Ú__eq__+   s   
zObjectIdentifier.__eq__c                 C   s
   | |k S r   r   r   r   r   r   Ú__ne__1   ó   
zObjectIdentifier.__ne__c                 C   s   d  | j| j¡S )Nz%<ObjectIdentifier(oid={0}, name={1})>)Úformatr   Ú_name©r   r   r   r   Ú__repr__4   s   þzObjectIdentifier.__repr__c                 C   s
   t | jƒS r   )Úhashr   r#   r   r   r   Ú__hash__:   r    zObjectIdentifier.__hash__c                 C   s   ddl m} | | d¡S )Nr   )Ú
_OID_NAMESzUnknown OID)Úcryptography.x509.oidr'   Úget)r   r'   r   r   r   r"   =   s   zObjectIdentifier._namer   N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r$   r&   Úpropertyr"   r   Úread_only_propertyr   r   r   r   r   r   
   s     
r   N)Ú
__future__r   r   r   Úcryptographyr   Úobjectr   r   r   r   r   Ú<module>   s   