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: //home/arjun/projects/env/lib/python3.10/site-packages/dns/__pycache__/tsigkeyring.cpython-310.pyc
o

!weI
�@s�dZddlZddlmZmZddlZddlZdeeefdeej	j
ejjffdd�Z
deej	j
efdeeeffd	d
�ZdS)zA place to store TSIG keys.�N)�Any�Dict�textring�returncCsbi}|��D](\}}tj�|�}t|t�r tj�||�j||<q|\}}tj�|||�||<q|S)a7Convert a dictionary containing (textual DNS name, base64 secret)
    pairs into a binary keyring which has (dns.name.Name, bytes) pairs, or
    a dictionary containing (textual DNS name, (algorithm, base64 secret))
    pairs into a binary keyring which has (dns.name.Name, dns.tsig.Key) pairs.
    @rtype: dict)	�items�dns�name�	from_text�
isinstance�str�tsig�Key�secret)r�keyringr�value�kname�	algorithmr�r�H/home/arjun/projects/env/lib/python3.10/site-packages/dns/tsigkeyring.pyr	s
r	rcCsvi}dd�}|��D].\}}|��}t|t�r||�||<q
t|jt�r*||j�}nt|j�}|j��|f||<q
|S)a;Convert a dictionary containing (dns.name.Name, dns.tsig.Key) pairs
    into a text keyring which has (textual DNS name, (textual algorithm,
    base64 secret)) pairs, or a dictionary containing (dns.name.Name, bytes)
    pairs into a text keyring which has (textual DNS name, base64 secret) pairs.
    @rtype: dictcSst�|�����S)N)�base64�encodebytes�decode�rstrip)rrrr�	b64encode6szto_text.<locals>.b64encode)r�to_textr
�bytesrrr)rrrr�key�tname�text_secretrrrr-s

r)�__doc__r�typingrr�dns.namer�dns.tsigrr�Namerr
r	rrrrr�<module>s**