3 ¢báWÉã@s8dZddlmZmZddlZddlZdd„Zdd„ZdS)zA place to store TSIG keys.é)Ú maybe_decodeÚ maybe_encodeNcCs<i}x2|D]*}tjj|ƒ}tjt||ƒƒ}|||<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Úbase64Z decodestringr)ÚtextringÚkeyringÚkeytextÚkeynameÚsecret©r ú!/usr/lib/python3.6/tsigkeyring.pyrs    rcCs<i}x2|D]*}t|jƒƒ}ttj||ƒƒ}|||<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_textrZ encodestring)r rr r r r r rr&s    r) Ú__doc__Z dns._compatrrrZdns.namerrrr r r rÚs