wallet.py 文件源码

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

项目:goofycoin 作者: homeowmorphism 项目源码 文件源码
def load_key(cls, wallet_name, key_type):
        if key_type == 'public_key':
            ecdsa_key = ecdsa.VerifyingKey
            extension = ".pk"
        elif key_type =='secret_key':
            ecdsa_key = ecdsa.SigningKey
            extension = ".sk"
        else:
            raise ValueError('Third argument key_type needs to be either public_key or secret_key.')

        key_path = os.path.join(settings.WALLETS_ABS_PATH, wallet_name + extension)
        with open(key_path, 'rb') as temp_file:
            hex_key = temp_file.read()
            bytes_key = unhexlify(hex_key)
            key = ecdsa_key.from_string(bytes_key, settings.bitcoin_curve)

        return key
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号