3
[_ð]  ã               @   s8   d Z ddlmZmZ ddlZddlZdd„ Zdd„ ZdS )zA place to store TSIG keys.é    )Úmaybe_decodeÚmaybe_encodeNc             C   s<   i }x2| D ]*}t jj|ƒ}tjt| | ƒƒ}|||< q
W |S )z¢Convert a dictionary containing (textual DNS name, base64 secret) pairs
    into a binary keyring which has (dns.name.Name, binary secret) pairs.
    @rtype: dict)ÚdnsÚnameÚ	from_textÚbase64Údecodestringr   )ÚtextringÚkeyringÚkeytextÚkeynameÚsecret© r   ú4/tmp/pip-build-yz_zf6az/dnspython/dns/tsigkeyring.pyr      s    
r   c             C   s<   i }x2| D ]*}t |jƒ ƒ}t tj| | ƒƒ}|||< q
W |S )z Convert a dictionary containing (dns.name.Name, binary secret) pairs
    into a text keyring which has (textual DNS name, base64 secret) pairs.
    @rtype: dict)r   Úto_textr   Úencodestring)r
   r	   r   r   r   r   r   r   r   (   s    
r   )	Ú__doc__Zdns._compatr   r   r   Zdns.namer   r   r   r   r   r   r   Ú<module>   s
   