summaryrefslogtreecommitdiffstats
path: root/base/common/python/pki/nssdb.py
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-03-17 15:23:34 +0100
committerEndi S. Dewata <edewata@redhat.com>2016-04-02 07:48:58 +0200
commit9eba5f33f04348ee4b243d3fc0d095268f824115 (patch)
tree67dddaf27686f295f5ae478dccab9c8ad2b7cb15 /base/common/python/pki/nssdb.py
parent9bd9548d5c1718ad8159f2134f170649c092a581 (diff)
downloadpki-9eba5f33f04348ee4b243d3fc0d095268f824115.tar.gz
pki-9eba5f33f04348ee4b243d3fc0d095268f824115.tar.xz
pki-9eba5f33f04348ee4b243d3fc0d095268f824115.zip
Added support for cloning 3rd-party CA certificates.
The installation code has been modified such that it imports all CA certificates from the PKCS #12 file for cloning before the server is started using certutil. The user certificates will continue to be imported using the existing JSS code after the server is started. This is necessary since JSS is unable to preserve the CA certificate nicknames. The PKCS12Util has been modified to support multiple certificates with the same nicknames. The pki pkcs12-cert-find has been modified to show certificate ID and another field indicating whether the certificate has a key. The pki pkcs12-cert-export has been modified to accept either certificate nickname or ID. The pki pkcs12-import has been modified to provide options for importing only user certificates or CA certificates. https://fedorahosted.org/pki/ticket/1742
Diffstat (limited to 'base/common/python/pki/nssdb.py')
-rw-r--r--base/common/python/pki/nssdb.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/base/common/python/pki/nssdb.py b/base/common/python/pki/nssdb.py
index e6aa0a6c2..f4ce1f240 100644
--- a/base/common/python/pki/nssdb.py
+++ b/base/common/python/pki/nssdb.py
@@ -512,8 +512,11 @@ class NSSDatabase(object):
finally:
shutil.rmtree(tmpdir)
- def import_pkcs12(self, pkcs12_file, pkcs12_password=None,
- pkcs12_password_file=None):
+ def import_pkcs12(self, pkcs12_file,
+ pkcs12_password=None,
+ pkcs12_password_file=None,
+ no_user_certs=False,
+ no_ca_certs=False):
tmpdir = tempfile.mkdtemp()
@@ -544,6 +547,12 @@ class NSSDatabase(object):
'--pkcs12-password-file', password_file
])
+ if no_user_certs:
+ cmd.extend(['--no-user-certs'])
+
+ if no_ca_certs:
+ cmd.extend(['--no-ca-certs'])
+
subprocess.check_call(cmd)
finally: