本文整理汇总了Python中paramiko.rsakey.RSAKey.get_fingerprint方法的典型用法代码示例。如果您正苦于以下问题:Python RSAKey.get_fingerprint方法的具体用法?Python RSAKey.get_fingerprint怎么用?Python RSAKey.get_fingerprint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paramiko.rsakey.RSAKey
的用法示例。
在下文中一共展示了RSAKey.get_fingerprint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: public_key_fingerprint
# 需要导入模块: from paramiko.rsakey import RSAKey [as 别名]
# 或者: from paramiko.rsakey.RSAKey import get_fingerprint [as 别名]
def public_key_fingerprint(key):
paramiko_key = ParamikoRSAKey(vals=(key.e, key.n))
fp = hexlify(paramiko_key.get_fingerprint())
openssh_fp = ":".join([a+b for a, b in zip(fp[::2], fp[1::2])])
return openssh_fp
示例2: public_key_fingerprint
# 需要导入模块: from paramiko.rsakey import RSAKey [as 别名]
# 或者: from paramiko.rsakey.RSAKey import get_fingerprint [as 别名]
def public_key_fingerprint(key):
# paramiko can compute the OpenSSH-style fingerprint
# Only fingerprints the public key
paramiko_key = ParamikoRSAKey(vals=(key.e, key.n))
fp = hexlify(paramiko_key.get_fingerprint())
# OpenSSH puts a ":" character between every pair of hex-digits.
# For whatever reason. Readability, I guess.
openssh_fp = ":".join([a + b for a, b in zip(fp[::2], fp[1::2])])
return openssh_fp
示例3: get_fingerprint_for_rsa_key_path
# 需要导入模块: from paramiko.rsakey import RSAKey [as 别名]
# 或者: from paramiko.rsakey.RSAKey import get_fingerprint [as 别名]
def get_fingerprint_for_rsa_key_path(path):
key = RSAKey(filename=path)
fp = key.get_fingerprint().encode('hex')
return add_colons_to_fingerprint(fp)