crypto.py 文件源码

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

项目:Bitcoin-Cash-Off-The-Grid 作者: cornwarecjp 项目源码 文件源码
def getPublicKey(self):
        """
        Gets a public key.

        Return value:
        str; the public key data.

        Exceptions:
        Exception: getting the key failed
        """

        if not self.hasPublicKey:
            raise Exception("Public key unknown")

        size = libssl.i2o_ECPublicKey(self.keyData, None)
        if not size:
            raise Exception("i2o_ECPublicKey failed")

        b = ctypes.create_string_buffer(size)
        if libssl.i2o_ECPublicKey(self.keyData, ctypes.byref(ctypes.pointer(b))) != size:
            raise Exception("i2o_ECPublicKey returned unexpected size")

        return ''.join(c for c in b)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号