def create_certificate_request(self, pkey, digest='sha256', **name):
"""
Create a certificate request.
Arguments: key - The key to associate with the request
digest - Digestion method to use for signing, default is sha256
**name - The name of the subject of the request, possible
arguments are:
C - Country name
ST - State or province name
L - Locality name
O - Organization name
OU - Organizational unit name
CN - Common name
emailAddress - E-mail address
Returns: The certificate request in an X509Req object
"""
request = crypto.X509Req()
subject = request.get_subject()
# Handle creating the subject of the request
for(key,value) in name.items():
setattr(subject, key, value)
request.set_pubkey(pkey)
# Sign the request
request.sign(pkey, digest)
return request
评论列表
文章目录