|
@@ -1,10 +1,8 @@
|
|
from cert_gen import gen_cakey,build_name,build_csr,build_servercert,build_rootca,output_cert,output_key_encrypted,build_crl
|
|
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):
|
|
def gencerts(c,st,l,o,ou,cn,crldp,passphrase):
|
|
-## Start
|
|
|
|
-## Build Root CA
|
|
|
|
|
|
|
|
-#write_key_encrypted('rootca-key.pem',cakey,passphrase)
|
|
|
|
|
|
+## Build Root CA
|
|
|
|
|
|
casubject = caissuer = build_name(c,st,l,o,ou,u'Root CA')
|
|
casubject = caissuer = build_name(c,st,l,o,ou,u'Root CA')
|
|
|
|
|
|
@@ -12,12 +10,9 @@ def gencerts(c,st,l,o,ou,cn,crldp,passphrase):
|
|
|
|
|
|
cacert = build_rootca(cakey,casubject,caissuer,36500)
|
|
cacert = build_rootca(cakey,casubject,caissuer,36500)
|
|
|
|
|
|
-#write_cert('rootca.pem',cacert)
|
|
|
|
-
|
|
|
|
## Build CSR
|
|
## Build CSR
|
|
|
|
|
|
csrkey = gen_cakey()
|
|
csrkey = gen_cakey()
|
|
-#write_key('csr-key.pem',csrkey)
|
|
|
|
|
|
|
|
csrsubject = build_name(c,st,l,o,ou,cn)
|
|
csrsubject = build_name(c,st,l,o,ou,cn)
|
|
|
|
|
|
@@ -25,15 +20,8 @@ def gencerts(c,st,l,o,ou,cn,crldp,passphrase):
|
|
|
|
|
|
## Build Server Cert
|
|
## Build Server Cert
|
|
|
|
|
|
-#servkey = key()
|
|
|
|
-#write_key("server-key.pem",servkey)
|
|
|
|
-
|
|
|
|
-#serversubject = build_name(c,st,l,o,ou,servername)
|
|
|
|
-
|
|
|
|
servercert = build_servercert(cakey,cacert,csrcert,cn,crldp,36500)
|
|
servercert = build_servercert(cakey,cacert,csrcert,cn,crldp,36500)
|
|
|
|
|
|
-#write_cert('server.pem',servercert)
|
|
|
|
-
|
|
|
|
crlcert = build_crl(cakey,caissuer,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)
|
|
return csrsubject,output_cert(cacert),output_key_encrypted(cakey,passphrase),output_key_encrypted(csrkey,passphrase),output_cert(servercert),output_cert(csrcert),output_cert(crlcert)
|