'The fingerprint of a public key consists of the output of the
message-digest algorithm in the specified format.
Supported formats include L{FingerprintFormats.MD5_HEX} and
L{FingerprintFormats.SHA256_BASE64}
The input to the algorithm is the public key data as specified by [RFC4253].
The output of sha256[RFC4634] algorithm is presented to the
user in the form of base64 encoded sha256 hashes.
Example: C{US5jTUa0kgX5ZxdqaGF0yGRu8EgKXHNmoT8jHKo1StM=}
The output of the MD5[RFC1321](default) algorithm is presented to the user as
a sequence of 16 octets printed as hexadecimal with lowercase letters
and separated by colons.
Example: C{c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87}
@param format: Format for fingerprint generation. Consists
hash function and representation format.
Default is L{FingerprintFormats.MD5_HEX}
@since: 8.2
@return: the user presentation of this L{Key}\'s fingerprint, as a
string.
@rtype: L{str}'

def fingerprint(self, format=FingerprintFormats.MD5_HEX):

    if (format is FingerprintFormats.SHA256_BASE64):
        return nativeString(base64.b64encode(sha256(self.blob()).digest()))
    elif (format is FingerprintFormats.MD5_HEX):
        return nativeString(':'.join([binascii.hexlify(x) for x in iterbytes(md5(self.blob()).digest())]))
    else:
        raise BadFingerPrintFormat(('Unsupported    fingerprint    format:    %s' % (format,)))
