summaryrefslogtreecommitdiffstats
path: root/base/util
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-04-16 02:43:03 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-04-20 03:08:54 +0200
commitb24ea9e24233636d18806326a9e2883235eb38d7 (patch)
tree1b9f4133b4757f348d343f6ae51720e464bcec1b /base/util
parentffcbc6809c1329b290c29eed962efce2bc50392e (diff)
downloadpki-b24ea9e24233636d18806326a9e2883235eb38d7.tar.gz
pki-b24ea9e24233636d18806326a9e2883235eb38d7.tar.xz
pki-b24ea9e24233636d18806326a9e2883235eb38d7.zip
Fixed PKCS #12 export options.
The CLIs for exporting PKCS #12 file have been modified to accept options to export without trust flags, keys, and/or certificate chain. https://fedorahosted.org/pki/ticket/1736
Diffstat (limited to 'base/util')
-rw-r--r--base/util/src/netscape/security/pkcs/PKCS12Util.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/base/util/src/netscape/security/pkcs/PKCS12Util.java b/base/util/src/netscape/security/pkcs/PKCS12Util.java
index 43435c822..571ee1881 100644
--- a/base/util/src/netscape/security/pkcs/PKCS12Util.java
+++ b/base/util/src/netscape/security/pkcs/PKCS12Util.java
@@ -239,6 +239,10 @@ public class PKCS12Util {
}
public void loadFromNSS(PKCS12 pkcs12) throws Exception {
+ loadFromNSS(pkcs12, true, true);
+ }
+
+ public void loadFromNSS(PKCS12 pkcs12, boolean includeKey, boolean includeChain) throws Exception {
logger.info("Loading all certificate and keys from NSS database");
@@ -247,7 +251,7 @@ public class PKCS12Util {
CryptoStore store = token.getCryptoStore();
for (X509Certificate cert : store.getCertificates()) {
- loadCertFromNSS(pkcs12, cert, true, true);
+ loadCertFromNSS(pkcs12, cert, includeKey, includeChain);
}
}