Export targets: PEM trusted, PEM all, PEM chain

This commit is contained in:
chris 2002-12-13 17:01:44 +00:00
parent 8642884941
commit d74a598bbd
3 changed files with 24 additions and 6 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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)