%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/dns/dnssecalgs/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/dns/dnssecalgs/__pycache__/__init__.cpython-312.pyc

�

5��e���R�UddlmZmZmZmZmZddlZddlm	Z	ddl
mZddlm
Z
ddlmZej j#d�r)ddlmZmZdd	lmZmZdd
lmZmZddlmZmZmZmZm Z dZ!nd
Z!eee"ejFjHfZ%iZ&eeee%fee	fe'd<e!r�e&jQejRdfeejTdfeejVdfeejXdfeejZdfeej\dfeej^dfe ej`dfeejbdfeejddfeejfdfei�	ddee4e5fde%dee	fd�Z6dedee	fd�Z7		ddee4e5fdee	deeejFjHe5fdee"ddf
d�Z8y)�)�Dict�Optional�Tuple�Type�UnionN)�GenericPrivateKey)�	Algorithm)�UnsupportedAlgorithm)�DNSKEY�dnssec)�
PrivateDSA�PrivateDSANSEC3SHA1)�PrivateECDSAP256SHA256�PrivateECDSAP384SHA384)�PrivateED448�PrivateED25519)�
PrivateRSAMD5�PrivateRSASHA1�PrivateRSASHA1NSEC3SHA1�PrivateRSASHA256�PrivateRSASHA512TF�
algorithms�	algorithm�prefix�returnc��tj|�}tj||f�}|r|St	dtj
|�z��)z�Get Private Key class from Algorithm.

    *algorithm*, a ``str`` or ``int`` specifying the DNSKEY algorithm.

    Raises ``UnsupportedAlgorithm`` if the algorithm is unknown.

    Returns a ``dns.dnssecalgs.GenericPrivateKey``
    z)algorithm "%s" not supported by dnspython)r	�maker�getr
�to_text)rr�clss   �9/usr/lib/python3/dist-packages/dns/dnssecalgs/__init__.py�get_algorithm_clsr".sM�����y�)�I�
�.�.�)�V�,�
-�C�
��
�
�3�i�6G�6G�	�6R�R����dnskeyc�V�d}|jtjk(r.tjj|jd�\}}nG|jtjk(r*t|jd�}|jd|dz}t|j|�S)z�Get Private Key class from DNSKEY.

    *dnskey*, a ``DNSKEY`` to get Algorithm class for.

    Raises ``UnsupportedAlgorithm`` if the algorithm is unknown.

    Returns a ``dns.dnssecalgs.GenericPrivateKey``
    Nr�)
rr	�
PRIVATEDNS�dns�name�	from_wire�key�
PRIVATEOID�intr")r$r�_�lengths    r!�get_algorithm_cls_from_dnskeyr0Bs���#�F�
���9�/�/�/��H�H�&�&�v�z�z�1�5�	���	�	�	�Y�1�1�	1��V�Z�Z��]�#�����A���
�+���V�-�-�v�6�6r#�
algorithm_clsr)�oidc���t|t�std��tj|�}d}|tj
k(r?|�t
d��t|t�rtjj|�}|}nS|tjk(r&|�t
d��tt|�g�|z}n|rt
d��|rt
d��|t||f<y)a�Register Algorithm Private Key class.

    *algorithm*, a ``str`` or ``int`` specifying the DNSKEY algorithm.

    *algorithm_cls*: A `GenericPrivateKey` class.

    *name*, an optional ``dns.name.Name`` or ``str``, for for PRIVATEDNS algorithms.

    *oid*: an optional BER-encoded `bytes` for PRIVATEOID algorithms.

    Raises ``ValueError`` if a name or oid is specified incorrectly.
    zInvalid algorithm classNz'Name required for PRIVATEDNS algorithmsz&OID required for PRIVATEOID algorithmsz,Name only supported for PRIVATEDNS algorithmz+OID only supported for PRIVATEOID algorithm)�
issubclassr�	TypeErrorr	rr'�
ValueError�
isinstance�strr(r)�	from_textr,�bytes�lenr)rr1r)r2rs     r!�register_algorithm_clsr<Ts���$�m�%6�7��1�2�2����y�)�I�"�F��I�(�(�(��<��F�G�G��d�C� ��8�8�%�%�d�+�D���	�i�*�*�	*��;��E�F�F���C��z�"�S�(��	
��G�H�H�	��F�G�G�&3�J�	�6�"�#r#)N)NN)9�typingrrrrr�dns.namer(�dns.dnssecalgs.baser�dns.dnssectypesr	�
dns.exceptionr
�dns.rdtypes.ANY.DNSKEYr�	_features�have�dns.dnssecalgs.dsar
r�dns.dnssecalgs.ecdsarr�dns.dnssecalgs.eddsarr�dns.dnssecalgs.rsarrrrr�_have_cryptographyr:r)�Name�AlgorithmPrefixr�__annotations__�update�RSAMD5�DSA�RSASHA1�DSANSEC3SHA1�RSASHA1NSEC3SHA1�	RSASHA256�	RSASHA512�ECDSAP256SHA256�ECDSAP384SHA384�ED25519�ED448r-r8r"r0r<�r#r!�<module>rZs��5�5��1�%�.�)��=�=���h��B�S�A��������5�����
�
�!5�6�7��OQ�
�D��y�/�1�2�D�9J�4K�K�L�Q�����
�
�
�t�$�m�
�]�]�D�!�:�
�
�
��%�~�
�
#�
#�T�*�,?�
�
'�
'��.�0G�
�
 �
 �$�'�)9�
�
 �
 �$�'�)9�
�
&�
&��-�/E�
�
&�
&��-�/E�
�
�
��%�~�
�_�_�d�#�\�	
��$;?���S�#�X���(7��	�
���(7�&�7�T�:K�5L�7�*15��	$4��S�#�X��$4��)�*�$4��5�������+�,�
-�$4�
�%��	$4�

�$4r#

Zerion Mini Shell 1.0