Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:siegel
xca
pem_chain_key.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pem_chain_key.diff of Package xca
diff --git a/lib/db_x509.cpp b/lib/db_x509.cpp index 18a210e..667a03a 100644 --- a/lib/db_x509.cpp +++ b/lib/db_x509.cpp @@ -659,6 +659,8 @@ void db_x509::store(QModelIndexList list) tr("PKCS #12 chain")); types << exportType(exportType::PKCS12, "p12", "PKCS #12"); + types << exportType(exportType::PEM_chain_key, "pem", + tr("PEM chain + key")); } else { usual << exportType(exportType::PKCS12, "p12", "PKCS #12"); @@ -736,6 +738,7 @@ void db_x509::store(QModelIndexList list) break; case exportType::PEM_cert_pk8: case exportType::PEM_cert_key: + case exportType::PEM_chain_key: pkey = (pki_evp *)crt->getRefKey(); if (!pkey || pkey->isPubKey()) { XCA_WARN(tr("There was no key found for the Certificate: '%1'"). @@ -755,6 +758,16 @@ void db_x509::store(QModelIndexList list) pkey->writeKey(fname, NULL, NULL, true); } crt->writeCert(fname, true, true); + if (type == exportType::PEM_chain_key) { + while(true) { + oldcrt = crt; + crt = crt->getSigner(); + if(!crt || crt == oldcrt) { + break; + } + crt->writeCert(fname, true, true); + } + } break; default: exit(1); diff --git a/widgets/ExportDialog.cpp b/widgets/ExportDialog.cpp index 1c2b2b9..447fc5a 100644 --- a/widgets/ExportDialog.cpp +++ b/widgets/ExportDialog.cpp @@ -85,6 +85,7 @@ ExportDialog::ExportDialog(MainWindow *mw, QString title, QString filt, help[exportType::PKCS8_encrypt] = tr("Encrypted private key in PKCS#8 text format"); help[exportType::SSH2_public] = tr("The public key encoded in SSH2 format"); + help[exportType::PEM_chain_key] = tr("Concatenated text format of the complete certificate chain and the unencrypted private key in one PEM file"); on_exportFormat_highlighted(0); } diff --git a/widgets/ExportDialog.h b/widgets/ExportDialog.h index 1e410bd..e17639d 100644 --- a/widgets/ExportDialog.h +++ b/widgets/ExportDialog.h @@ -22,6 +22,7 @@ class exportType { PEM_key, PEM_private, PEM_private_encrypt, DER_private, DER_key, PKCS8, PKCS8_encrypt, SSH2_public, PEM_selected, PKCS7_selected, + PEM_chain_key, ETYPE_max }; enum etype type; QString desc;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor