def createCertRequest(pkey, digest='md5', **name):
 req = crypto.X509Req()
 subj = req.get_subject()
 for (key, value) in name.items():
  setattr(subj, key, value)
 req.set_pubkey(pkey)
 req.sign(pkey, digest)
 return req

def createCertRequest ( pkey , digest = 'md5' , ** name ) : req = crypto . X509Req ( ) subj = req . get_subject ( ) for ( key , value ) in name . items ( ) : setattr ( subj , key , value ) req . set_pubkey ( pkey ) req . sign ( pkey , digest ) return req
create a certificate request .