code: def hash_algo(self):
          
  
          if self.algorithm != 'dsa':
              raise ValueError(unwrap(
                  '''
                  Only DSA keys are generated using a hash algorithm, this key is
                  %s
                  ''',
                  self.algorithm.upper()
              ))
  
          parameters = self['algorithm']['parameters']
          if parameters.native is None:
              return None
  
          byte_len = math.log(parameters['q'].native, 2) / 8
  
          return 'sha1' if byte_len <= 20 else 'sha2'
docs: Returns the name of the family of hash algorithms used to generate a
          DSA key
  
          :raises:
              ValueError - when the key is not a DSA key
  
          :return:
              A unicode string of "sha1" or "sha2" or None if no parameters are
              present