code: def to_text(keyring):
      
  
      textring = {}
      for keyname in keyring:
          keytext = dns.name.to_text(keyname)
          secret = base64.encodestring(keyring[keyname])
          textring[keytext] = secret
      return textring
docs: Convert a dictionary containing (dns.name.Name, binary secret) pairs
      into a text keyring which has (textual DNS name, base64 secret) pairs.
      @rtype: dict