ca_service.py 文件源码

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

项目:loopchain 作者: theloopkr 项目源码 文件源码
def sign_test(self):
        """???/??? ?? ? ?? ???

        :return: ??? ??(True/False)
        """
        if self.is_secure is False:
            logging.debug("CA is not secure_mode")
            return False

        data = b"test"
        signature = self.__ca_pri.sign(
            data,
            ec.ECDSA(hashes.SHA256())
        )
        try:
            pub_key = self.__ca_cert.public_key()
            return pub_key.verify(
                signature,
                data,
                ec.ECDSA(hashes.SHA256())
            )
        except InvalidSignature:
            logging.debug("cert test fail!!!")
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号