run.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:safetalk 作者: zjuchenyuan 项目源码 文件源码
def receive_hispubkey(mypub=None):
    """
    Try to get his public key from clipboard, saved to "hispub"
    return True if success else False
    """
    if mypub is None:
        mypub = storage_get("mypub")
    try:
        rawdata = clipboard_read()
        hispub = d64(rawdata)
        if not isinstance(hispub, rsa.PublicKey):
            return False
        if hispub == mypub:
            return False # clipboard not changed
        else:
            storage_save("hispub",hispub)
            return True,hispub
    except:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号