#NEWLINE# def use_tsig( self , keyring , keyname = None , algorithm = dns . tsig . default_algorithm ) : #NEWLINE# #INDENT# 'Add a TSIG signature to the query.\n\n        @param keyring: The TSIG keyring to use; defaults to None.\n        @type keyring: dict\n        @param keyname: The name of the TSIG key to use; defaults to None.\n        The key must be defined in the keyring.  If a keyring is specified\n        but a keyname is not, then the key used will be the first key in the\n        keyring.  Note that the order of keys in a dictionary is not defined,\n        so applications should supply a keyname when a keyring is used, unless\n        they know the keyring contains only one key.\n        @param algorithm: The TSIG key algorithm to use.  The default\n        is dns.tsig.default_algorithm.\n        @type algorithm: string' #NEWLINE# self . keyring = keyring #NEWLINE# if ( keyname is None ) : #NEWLINE# #INDENT# self . keyname = self . keyring . keys ( ) [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . keyname = keyname #NEWLINE# #UNINDENT# self . keyalgorithm = algorithm