12345678910111213141516171819202122232425262728 |
- from cert_gen import gen_cakey,build_name,build_csr,build_servercert,build_rootca,output_cert,output_key_encrypted,build_crl
- def gencerts(c,st,l,o,ou,cn,crldp,passphrase,bits):
- ## Build Root CA
- casubject = caissuer = build_name(c,st,l,o,ou,u'Root CA')
- cakey = gen_cakey(bits)
- cacert = build_rootca(cakey,casubject,caissuer,36500)
- ## Build CSR
- csrkey = gen_cakey(bits)
- csrsubject = build_name(c,st,l,o,ou,cn)
- csrcert = build_csr(csrkey,csrsubject,cn)
- ## Build Server Cert
- servercert = build_servercert(cakey,cacert,csrcert,cn,crldp,36500)
- crlcert = build_crl(cakey,caissuer,36500)
- return csrsubject,output_cert(cacert),output_key_encrypted(cakey,passphrase),output_key_encrypted(csrkey,passphrase),output_cert(servercert),output_cert(csrcert),output_cert(crlcert)
-
|