Remove pkcs12 handling functions from CertDB

These functions don't require anything from the CertDB instance,
move them out so no needless instantiation of CertDB is performed
in order to use them.

https://fedorahosted.org/freeipa/ticket/5695

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Stanislav Laznicka
2017-02-27 08:43:59 +01:00
committed by Jan Cholasta
parent 0a54fac02c
commit afea026a5c
3 changed files with 24 additions and 25 deletions

View File

@@ -346,14 +346,11 @@ class KrbInstance(service.Service):
self.move_service_to_host(host_principal)
def setup_pkinit(self):
ca_db = certs.CertDB(self.realm, host_name=self.fqdn,
subject_base=self.subject_base)
if self.pkcs12_info:
ca_db.install_pem_from_p12(self.pkcs12_info[0],
certs.install_pem_from_p12(self.pkcs12_info[0],
self.pkcs12_info[1],
paths.KDC_CERT)
ca_db.install_key_from_p12(self.pkcs12_info[0],
certs.install_key_from_p12(self.pkcs12_info[0],
self.pkcs12_info[1],
paths.KDC_KEY)
else: