PKCS#7 added to menus - no functionality yet....

This commit is contained in:
chris 2002-12-14 12:58:44 +00:00
parent 73e43bb8fd
commit cddc7f90e8
3 changed files with 27 additions and 4 deletions

View File

@ -52,7 +52,7 @@
#include "ExportCert.h"
ExportCert::ExportCert(QString fname, bool hasKey,
ExportCert::ExportCert(QString fname, bool hasKey,
QWidget *parent, const char *name )
:ExportCert_UI(parent,name,true,0)
{
@ -63,6 +63,7 @@ ExportCert::ExportCert(QString fname, bool hasKey,
exportFormat->insertItem("PEM all trusted Certificates");
exportFormat->insertItem("PEM all Certificates");
exportFormat->insertItem("DER");
exportFormat->insertItem("Signed PKCS#7");
if (hasKey) {
exportFormat->insertItem("PKCS #12");
exportFormat->insertItem("PKCS #12 with Certificate chain");

View File

@ -682,7 +682,7 @@ void MainWindow::writeCert()
if (!crt) return;
pki_key *privkey = crt->getKey();
ExportCert *dlg = new ExportCert((crt->getDescription() + ".crt").c_str(),
(privkey->isPrivKey()));
(privkey && privkey->isPrivKey()));
if (!dlg->exec()) {
delete dlg;
return;
@ -767,13 +767,16 @@ void MainWindow::showPopupCert(QListViewItem *item, const QPoint &pt, int x) {
CERR( "popup Cert");
QPopupMenu *menu = new QPopupMenu(this);
QPopupMenu *subCa = new QPopupMenu(this);
QPopupMenu *subP7 = new QPopupMenu(this);
QPopupMenu *subExport = new QPopupMenu(this);
int itemExtend, itemRevoke, itemTrust, itemCA, itemTemplate, itemReq;
int itemExtend, itemRevoke, itemTrust, itemCA, itemTemplate, itemReq, itemP7;
bool canSign, parentCanSign, hasTemplates, hasPrivkey;
if (!item) {
menu->insertItem(tr("New Certificate"), this, SLOT(newCert()));
menu->insertItem(tr("Import"), this, SLOT(loadCert()));
menu->insertItem(tr("Import PKCS#12"), this, SLOT(loadPKCS12()));
menu->insertItem(tr("Import from PKCS#7"), this, SLOT(loadCert()));
}
else {
pki_x509 *cert = (pki_x509 *)certs->getSelectedPKI(item->text(0).latin1());
@ -791,6 +794,12 @@ void MainWindow::showPopupCert(QListViewItem *item, const QPoint &pt, int x) {
subCa->insertItem(tr("CRL days"), this, SLOT(setCrlDays()));
itemTemplate = subCa->insertItem(tr("Signing Template"), this, SLOT(setTemplate()));
subCa->insertItem(tr("Generate CRL"), this, SLOT(genCrl()));
itemP7 = menu->insertItem(tr("PKCS#7"), subP7);
subP7->insertItem(tr("Sign"), this, SLOT(setSerial()));
subP7->insertItem(tr("Verify"), this, SLOT(setSerial()));
subP7->insertItem(tr("Encrypt"), this, SLOT(setSerial()));
subP7->insertItem(tr("Decrypt"), this, SLOT(setSerial()));
menu->insertSeparator();
itemExtend = menu->insertItem(tr("Renewal"), this, SLOT(extendCert()));
if (cert) {
@ -809,12 +818,14 @@ void MainWindow::showPopupCert(QListViewItem *item, const QPoint &pt, int x) {
menu->setItemEnabled(itemRevoke, parentCanSign);
menu->setItemEnabled(itemCA, canSign);
subExport->setItemEnabled(itemReq, hasPrivkey);
menu->setItemEnabled(itemP7, hasPrivkey);
subCa->setItemEnabled(itemTemplate, hasTemplates);
}
menu->exec(pt);
delete menu;
delete subCa;
delete subP7;
delete subExport;
return;

View File

@ -12,7 +12,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>764</width>
<width>760</width>
<height>604</height>
</rect>
</property>
@ -534,6 +534,17 @@
<string>Import PKCS#12</string>
</property>
</widget>
<widget>
<class>QPushButton</class>
<property stdset="1">
<name>name</name>
<cstring>PushButton18_2</cstring>
</property>
<property stdset="1">
<name>text</name>
<string>Import from PKCS#7</string>
</property>
</widget>
<spacer>
<property>
<name>name</name>