
    gI
                         S r SSKrSSKJrJr  SSKrSSKrS\\\4   S\\R                  R                  \R                  R                  4   4S jrS\\R                  R                  \4   S\\\4   4S jrg)	zA place to store TSIG keys.    N)AnyDicttextringreturnc                 J   0 nU R                  5        H  u  p#[        R                  R                  U5      n[	        U[
        5      (       a-  [        R                  R                  XC5      R                  X'   Mf  Uu  pV[        R                  R                  XFU5      X'   M     U$ )a'  Convert 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   s          H/home/matz/Project1/venv/lib/python3.13/site-packages/dns/tsigkeyring.pyr   r      s|     G~~'""4(eS!! XX\\%7>>GN"'Y XX\\%CGN ( N    r   c                 n   0 nS nU R                  5        H  u  p4UR                  5       n[        U[        5      (       a  U" U5      X'   M6  [        UR                  [        5      (       a  U" UR                  5      nO[        UR                  5      nUR                  R                  5       U4X'   M     U$ )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: dictc                 f    [         R                  " U 5      R                  5       R                  5       $ )N)base64encodebytesdecoderstrip)r   s    r   	b64encodeto_text.<locals>.b64encode6   s%    !!&)00299;;r   )r   to_textr   bytesr   r   r   )r   r   r   r
   keytnametext_secrets          r   r   r   -   s     H< ]]_	c5!!'nHO#**e,,'

3!#**o"}}446DHO % Or   )__doc__r   typingr   r   dns.namer	   dns.tsigr   r
   Namer   r   r   r    r   r   <module>r*      sx   $ "    S#X 4sxx||0K+L $T#((--,- $sCx. r   