diff --git a/ExportCert.cpp b/ExportCert.cpp index 1a67e7e9..f3309018 100644 --- a/ExportCert.cpp +++ b/ExportCert.cpp @@ -59,6 +59,9 @@ ExportCert::ExportCert(QString fname, bool hasKey, filename->setText(fname); setCaption(tr(XCA_TITLE)); exportFormat->insertItem("PEM"); + exportFormat->insertItem("PEM with Certificate chain"); + exportFormat->insertItem("PEM all trusted Certificates"); + exportFormat->insertItem("PEM all Certificates"); exportFormat->insertItem("DER"); if (hasKey) { exportFormat->insertItem("PKCS #12"); diff --git a/MainWindowX509.cpp b/MainWindowX509.cpp index 55da7370..aaf0b43f 100644 --- a/MainWindowX509.cpp +++ b/MainWindowX509.cpp @@ -678,6 +678,7 @@ void MainWindow::writeCert() { QStringList filt; pki_x509 *crt = (pki_x509 *)certs->getSelectedPKI(); + pki_x509 *oldcrt = NULL; if (!crt) return; pki_key *privkey = crt->getKey(); ExportCert *dlg = new ExportCert((crt->getDescription() + ".crt").c_str(), @@ -694,15 +695,28 @@ void MainWindow::writeCert() try { switch (dlg->exportFormat->currentItem()) { case 0: // PEM - crt->writeCert(fname.latin1(),true); + crt->writeCert(fname.latin1(),true,false); break; - case 1: // DER - crt->writeCert(fname.latin1(),false); + case 1: // PEM with chain + while(crt && crt != oldcrt) { + crt->writeCert(fname.latin1(),true,true); + oldcrt = crt; + crt = crt->getSigner(); + } break; - case 2: // P12 + case 2: // PEM all trusted Certificates + certs->writeAllCerts(fname,true); + break; + case 3: // PEM all Certificates + certs->writeAllCerts(fname,false); + break; + case 4: // DER + crt->writeCert(fname.latin1(),false,false); + break; + case 5: // P12 writePKCS12(fname,false); break; - case 3: // P12 + cert chain + case 6: // P12 + cert chain writePKCS12(fname,true); break; diff --git a/Makefile.in b/Makefile.in index 0c28db2d..c28cacd4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -63,7 +63,8 @@ dist: (cd ../$(TARGET); autoconf; \ ./mkxcapro.sh ||true; lrelease xca.pro ||true; \ cat rpm/xca.spec |sed s/VERSION/$(VERSION)/g >rpm/$(TARGET)-1.spec; \ - rm -rf rpm/xca.spec autom4te.cache ) + rm -rf rpm/xca.spec autom4te.cache; \ + cd doc; linuxdoc -B html xca.sgml; ) (cd ..; tar zcf $(TARGET).tar.gz $(TARGET) ) #rm -rf ../$(TARGET)