certificates.py 文件源码

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

项目:utils 作者: rapydo 项目源码 文件源码
def generate_csr_and_key(user='TestUser'):
        """
        TestUser is the user proposed by the documentation,
        which will be ignored
        """
        key = crypto.PKey()
        key.generate_key(crypto.TYPE_RSA, 1024)
        req = crypto.X509Req()
        req.get_subject().CN = user
        req.set_pubkey(key)
        req.sign(key, "sha1")
        # print("CSR", key, req)
        return key, req
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号