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
评论列表
文章目录