test_crypto.py 文件源码

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

项目:2FAssassin 作者: maxwellkoh 项目源码 文件源码
def test_export_der(self):
        """
        If passed ``FILETYPE_ASN1`` for the format, ``CRL.export`` returns a
        "DER" format string representing a serial number, a revoked reason, and
        certificate issuer information.
        """
        crl = self._get_crl()

        # DER format
        dumped_crl = crl.export(
            self.cert, self.pkey, FILETYPE_ASN1, digest=b"md5"
        )
        text = _runopenssl(
            dumped_crl, b"crl", b"-noout", b"-text", b"-inform", b"DER"
        )
        text.index(b'Serial Number: 03AB')
        text.index(b'Superseded')
        text.index(
            b'Issuer: /C=US/ST=IL/L=Chicago/O=Testing/CN=Testing Root CA'
        )

    # Flaky because we compare the output of running commands which sometimes
    # varies by 1 second
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号