4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-02 06:09:33 +00:00

initial version of cmssigner, a simple gui program to showcase asynchronous X.509 signing operations, with either files or smartcards

svn path=/trunk/kdesupport/qca/; revision=660847
This commit is contained in:
Justin Karneges 2007-05-03 22:14:13 +00:00
parent 7b3bfe7404
commit 8e2495b95d
10 changed files with 1916 additions and 0 deletions

26
examples/cmssigner/TODO Normal file

@ -0,0 +1,26 @@
icons needed:
app icon (may need different sizes of this?) (a pen?)
keystore icon (a box?)
keystore entry identity icon (a card?)
file identity icon (a file?) (keybundle icon?)
cert icon (a piece of paper?) (cert icon?)
have a graphical busy indicator for:
keystores are busy? (maybe a flashing thing in the status bar)
sign operation in progress (maybe just use an endless QProgressBar)
entry icons
key bundle
cert
crl
pgp secret
pgp public
store icons
system
user
application
smart card
pgp keyring
unknown store/entry icon (can use the same icon for both i think)

@ -0,0 +1,10 @@
include(../examples.pri)
CONFIG -= console
CONFIG += app_bundle
QT += gui
HEADERS += mylistview.h keystoreview.h
SOURCES += main.cpp
FORMS += mainwin.ui loadstore.ui modconfig.ui
RESOURCES += cmssigner.qrc

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/gfx" >
<file>key.png</file>
</qresource>
</RCC>

BIN
examples/cmssigner/key.png Normal file

Binary file not shown.

After

(image error) Size: 693 B

@ -0,0 +1,20 @@
#ifndef KEYSTOREVIEW_H
#define KEYSTOREVIEW_H
#include <QTreeView>
//class QAbstractListModel;
class KeyStoreView : public QTreeView
{
Q_OBJECT
public:
KeyStoreView(QWidget *parent = 0) : QTreeView(parent) {}
//QAbstractListModel *model;
/*protected:
virtual void contextMenuEvent(QContextMenuEvent *event);*/
};
#endif

@ -0,0 +1,90 @@
<ui version="4.0" >
<class>LoadStore</class>
<widget class="QDialog" name="LoadStore" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>363</width>
<height>233</height>
</rect>
</property>
<property name="windowTitle" >
<string>Storage Device Browser</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Select an identity from a storage device below:</string>
</property>
</widget>
</item>
<item>
<widget class="KeyStoreView" name="lv_stores" />
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KeyStoreView</class>
<extends>QTreeView</extends>
<header>keystoreview.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>lv_stores</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>LoadStore</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>227</x>
<y>211</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>232</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>LoadStore</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>295</x>
<y>217</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>232</y>
</hint>
</hints>
</connection>
</connections>
</ui>

1289
examples/cmssigner/main.cpp Normal file

File diff suppressed because it is too large Load Diff

@ -0,0 +1,229 @@
<ui version="4.0" >
<class>MainWin</class>
<widget class="QMainWindow" name="MainWin" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>577</width>
<height>501</height>
</rect>
</property>
<property name="windowTitle" >
<string>CMS Signer</string>
</property>
<widget class="QWidget" name="centralwidget" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Identities:</string>
</property>
</widget>
</item>
<item>
<widget class="MyListView" name="lv_identities" />
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Known Peers:</string>
</property>
</widget>
</item>
<item>
<widget class="MyListView" name="lv_known" />
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Text:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="te_data" />
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Signature:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="te_sig" />
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pb_sign" >
<property name="text" >
<string>&amp;Sign</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pb_verify" >
<property name="text" >
<string>&amp;Verify</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>577</width>
<height>29</height>
</rect>
</property>
<widget class="QMenu" name="menuHelp" >
<property name="title" >
<string>Help</string>
</property>
<addaction name="actionAbout_CMS_Signer" />
</widget>
<widget class="QMenu" name="menuFile" >
<property name="title" >
<string>File</string>
</property>
<addaction name="actionLoad_Identity_From_File" />
<addaction name="actionLoad_Identity_From_Storage_Device" />
<addaction name="separator" />
<addaction name="actionConfigure_PKCS_11_Modules" />
<addaction name="separator" />
<addaction name="actionQuit" />
</widget>
<addaction name="menuFile" />
<addaction name="menuHelp" />
</widget>
<widget class="QStatusBar" name="statusbar" />
<action name="actionLoad_Identity_From_File" >
<property name="text" >
<string>Load Identity From &amp;File...</string>
</property>
</action>
<action name="actionLoad_Identity_From_Storage_Device" >
<property name="text" >
<string>Load Identity From &amp;Storage Device...</string>
</property>
</action>
<action name="actionQuit" >
<property name="text" >
<string>&amp;Quit</string>
</property>
</action>
<action name="actionAbout_CMS_Signer" >
<property name="text" >
<string>About CMS Signer</string>
</property>
</action>
<action name="actionConfigure_PKCS_11_Modules" >
<property name="text" >
<string>Configure &amp;PKCS#11 Modules...</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>MyListView</class>
<extends>QListView</extends>
<header>mylistview.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="cmssigner.qrc" />
</resources>
<connections/>
</ui>

@ -0,0 +1,227 @@
<ui version="4.0" >
<class>ModConfig</class>
<widget class="QDialog" name="ModConfig" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>536</width>
<height>207</height>
</rect>
</property>
<property name="windowTitle" >
<string>PKCS#11 Module Configuration</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Configured PKCS#11 Modules:</string>
</property>
</widget>
</item>
<item>
<widget class="QListView" name="lv_modules" />
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="pb_add" >
<property name="text" >
<string>Add</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pb_remove" >
<property name="text" >
<string>Remove</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QGroupBox" name="gb_details" >
<property name="title" >
<string>Module Details</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLineEdit" name="le_library" />
</item>
<item>
<widget class="QPushButton" name="pb_browse" >
<property name="text" >
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Name:</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="lb_file" >
<property name="text" >
<string>Module File:</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="le_name" >
<property name="minimumSize" >
<size>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>lv_modules</tabstop>
<tabstop>pb_add</tabstop>
<tabstop>pb_remove</tabstop>
<tabstop>le_name</tabstop>
<tabstop>le_library</tabstop>
<tabstop>pb_browse</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>ModConfig</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>336</x>
<y>185</y>
</hint>
<hint type="destinationlabel" >
<x>320</x>
<y>137</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>ModConfig</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>361</x>
<y>183</y>
</hint>
<hint type="destinationlabel" >
<x>363</x>
<y>135</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -0,0 +1,20 @@
#ifndef MYLISTVIEW_H
#define MYLISTVIEW_H
#include <QListView>
class QAbstractListModel;
class MyListView : public QListView
{
Q_OBJECT
public:
MyListView(QWidget *parent = 0);
QAbstractListModel *model;
protected:
virtual void contextMenuEvent(QContextMenuEvent *event);
};
#endif