'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'

@property
def hash_algo(self):

    if (self.algorithm != u'dsa'):
        raise ValueError(unwrap(u'\n                                                                Only    DSA    keys    are    generated    using    a    hash    algorithm,    this    key    is\n                                                                %s\n                                                                ', self.algorithm.upper()))
    parameters = self[u'algorithm'][u'parameters']
    if (parameters.native is None):
        return None
    byte_len = (math.log(parameters[u'q'].native, 2) / 8)
    return (u'sha1' if (byte_len <= 20) else u'sha2')
