Commit aec84c5c authored by godog's avatar godog

create CA private key if not found

parent f48c2e88
......@@ -97,11 +97,18 @@ class CA(object):
self._update_config()
# Generate keys if they do not exist.
if not os.path.exists(self.files.private_key):
log.info('creating new RSA private key')
openssl_wrap.run('genrsa', '-des3',
'-out', self.files.private_key,
self.config['bits'])
# Generate keys if they do not exist.
if not os.path.exists(self.files.public_key):
tmpdir = tempfile.mkdtemp()
csr_file = os.path.join(tmpdir, 'ca.csr')
log.info('creating new RSA CA CSR')
log.info('creating new temporary RSA CA CSR')
openssl_wrap.run_with_config(
self.basedir, self.files.conf,
'req', '-new',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment