<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> from OpenSSL import crypto <EOL> from certgen import ( <EOL> createKeyPair , <EOL> createCertRequest , <EOL> createCertificate , <EOL> ) <EOL> cakey = createKeyPair ( crypto . TYPE_RSA , <NUM_LIT> ) <EOL> careq = createCertRequest ( cakey , CN = '<STR_LIT>' ) <EOL> cacert = createCertificate ( careq , ( careq , cakey ) , <NUM_LIT:0> , ( <NUM_LIT:0> , <NUM_LIT> * <NUM_LIT> * <NUM_LIT> * <NUM_LIT> * <NUM_LIT:5> ) ) <EOL> print ( '<STR_LIT>' ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT:w>' ) as capkey : <EOL> capkey . write ( <EOL> crypto . dump_privatekey ( crypto . FILETYPE_PEM , cakey ) . decode ( '<STR_LIT:utf-8>' ) <EOL> ) <EOL> print ( '<STR_LIT>' ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT:w>' ) as ca : <EOL> ca . write ( <EOL> crypto . dump_certificate ( crypto . FILETYPE_PEM , cacert ) . decode ( '<STR_LIT:utf-8>' ) <EOL> ) <EOL> for ( fname , cname ) in [ ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) ] : <EOL> pkey = createKeyPair ( crypto . TYPE_RSA , <NUM_LIT> ) <EOL> req = createCertRequest ( pkey , CN = cname ) <EOL> cert = createCertificate ( req , ( cacert , cakey ) , <NUM_LIT:1> , ( <NUM_LIT:0> , <NUM_LIT> * <NUM_LIT> * <NUM_LIT> * <NUM_LIT> * <NUM_LIT:5> ) ) <EOL> print ( '<STR_LIT>' <EOL> % ( fname , fname ) ) <EOL> with open ( '<STR_LIT>' % ( fname , ) , '<STR_LIT:w>' ) as leafpkey : <EOL> leafpkey . write ( <EOL> crypto . dump_privatekey ( crypto . FILETYPE_PEM , pkey ) . decode ( '<STR_LIT:utf-8>' ) <EOL> ) <EOL> print ( '<STR_LIT>' <EOL> % ( fname , fname ) ) <EOL> with open ( '<STR_LIT>' % ( fname , ) , '<STR_LIT:w>' ) as leafcert : <EOL> leafcert . write ( <EOL> crypto . dump_certificate ( crypto . FILETYPE_PEM , cert ) . decode ( '<STR_LIT:utf-8>' ) <EOL> ) </s>
