NNTPCryptography.py 文件源码

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

项目:newsreap 作者: caronc 项目源码 文件源码
def encode_public_key(self):
        """
        Based on spotnab, this is the gzipped version of the key
        with base64 applied to it. We encode it as such and
        return it.

        """
        fileobj = StringIO()
        with GzipFile(fileobj=fileobj, mode="wb") as f:
            try:
                f.write(self.public_pem())
            except TypeError:
                # It wasn't initialized yet
                return None

        return b64encode(fileobj.getvalue())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号