[IMP] Some improvements
This commit is contained in:
+15
-3
@@ -10,9 +10,9 @@
|
||||
# Licence: <your licence>
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Maange Root CA
|
||||
# Manage Root CA
|
||||
|
||||
from common import Printing, TisPKI, check_directories
|
||||
from common import Printing, TisPKI, check_directories, config
|
||||
|
||||
import subprocess
|
||||
import jinja2
|
||||
@@ -88,4 +88,16 @@ def create_openssl_config(force=False,verbose=False):
|
||||
os.remove(TisPKI.root_ca_keyfile())
|
||||
create_openssl_config(force,verbose)
|
||||
else:
|
||||
Printing.warning('Root CA private key and certificate already exist. Skip.')
|
||||
Printing.warning('Root CA private key and certificate already exist. Skip.')
|
||||
|
||||
|
||||
def generate_root_crl(verbose=False):
|
||||
Printing.information('Generate CRL for Root CA')
|
||||
|
||||
root_ca_sign_intermediate = os.path.join(TisPKI.root_config_path(),'openssl_root_ca_sign_intermediate.ini')
|
||||
|
||||
gen_crl = subprocess.run(f'openssl ca -config {root_ca_sign_intermediate} -gencrl -out {TisPKI.root_ca_crlfile()}',shell=True)
|
||||
if gen_crl.returncode == 0:
|
||||
Printing.success(f'CRL successfuly generated in : {TisPKI.root_ca_crlfile()}')
|
||||
else:
|
||||
Printing.error('Unable to generate CRL')
|
||||
|
||||
Reference in New Issue
Block a user