mirror of
https://github.com/chris2511/xca.git
synced 2026-09-14 11:06:19 +05:00
Export targets: PEM trusted, PEM all, PEM chain
This commit is contained in:
parent
8642884941
commit
d74a598bbd
@ -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");
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user