@property
def key_details(self):
    key_type = self.key.get_name().lower()
    details = 'Host: {0} ({1})\n'.format(self.hostname, key_type)
    if key_type.startswith('ssh-'):
        key_type = key_type[4:]
    key_type = key_type.split('-', 1)[0].upper()
    details += '{0} key fingerprint is SHA256:{1}.\n'.format(key_type, base64.b64encode(hashlib.new('sha256', self.key.asbytes()).digest()).decode('utf-8'))
    details += '{0} key fingerprint is MD5:{1}.\n'.format(key_type, binascii.b2a_hex(hashlib.new('md5', self.key.asbytes()).digest()).decode('utf-8'))
    return details
@property
def key_details(self):
    key_type = self.key.get_name().lower()
    details = 'Host: {0} ({1})\n'.format(self.hostname, key_type)
    if key_type.startswith('ssh-'):
        key_type = key_type[4:]
    key_type = key_type.split('-', 1)[0].upper()
    details += '{0} key fingerprint is SHA256:{1}.\n'.format(key_type, base64.b64encode(hashlib.new('sha256', self.key.asbytes()).digest()).decode('utf-8'))
    details += '{0} key fingerprint is MD5:{1}.\n'.format(key_type, binascii.b2a_hex(hashlib.new('md5', self.key.asbytes()).digest()).decode('utf-8'))
    return details