Commit Graph

136 Commits

Author SHA1 Message Date
Christian Hohnstaedt
778e5c2e3a Feature #313: Add JWK export
Export private and public keys as JWK.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
a25b6c7402 Close #520: permanent processor load
Improve the timer interval maintenance process:
 - Do not fire every second,
   but at most 1 second after the last run
 - Reduce the fired events.
 - Every container now only evaluates its own elements
   (keys, certs,etc.) instead of each container evaluating all
   items and duplicating work

Disable sorting and resizing in the view during initialization,
to speed up opening the database
2024-02-23 12:24:31 +01:00
Christian Hohnstaedt
993da2d474 Use C++11 initializers for all non-static class members
When XCA started in 2002, there were no C++ initializers.
Drop explicit initializers from the constructors.

 - Fix indentations of section declarators.
 - Replace NULL by nullptr when feasible.
 - Sort private section: properties first, then methods.
2023-10-08 22:19:18 +02:00
Christian Hohnstaedt
2333b02ddc Close #384: Quick view of certificates without trying to open XCA
The ImportMulti dialog does not show up if there is only
one item to display, but the item is displayed directly.

The displayed items have a new "Import" button to import
directly from the viewed item.

If XCA is called with certs, crls, keys etc. from the commandline
XCA only displays and optionally imports the item if a default
database is given. Afterwards XCA exits.
2023-10-05 23:12:40 +02:00
Christian Hohnstaedt
3a73697406 Drop global pointer to mainwin by fixing its last user db_x509
Instead of querying the view about the selected item,
let the view store the current item in the model.
2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
42b76418fb Enable Warnings and fix them 2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
65b10c33ce Close #444 cannot update template internal name
Update internal name, even if they seem unchanged
if the force option is set.
2023-09-21 20:58:14 +02:00
Christian Hohnstaedt
061f676041 Improve/simplify item import
Unify import functions for some (on_butImport_clicked)
or all (on_butOk_clicked) items.
They both call "importIndexes(const QModelIndexList &indexes)"
containing some or all indexes to import.

db_x509.cpp: Only need to search the treeItem (containing all items
without issuer, not all in the rootItem (containing also certificates
with known issuer)

Re-use "remFromCont()" when stealing items from an other CA.
2023-05-30 14:38:55 +02:00
Christian Hohnstädt
6ea01e80f6 Refactor item export: separate GUI and database
Collect all export formats in pki_export.

Each export format has assigned acouple of flags, indicating,
whether they are text, concatenateable, encrypted, usable for
multiple selections or only for a single item.
2021-11-13 14:49:02 +01:00
Christian Hohnstaedt
f2fe9be3f3 Move file loading GUI element out of non-gui container class (db_*)
into GUI View widgets/*TreeView.cpp
2021-10-30 11:51:35 +02:00
Christian Hohnstädt
be1a44d0a8 Consolidate export types and format in pki_export class
Move the descriptons from the ExportDialog into the
new pki_export class.

Also translate the exportType::etype to F_* flags
2021-10-30 11:51:35 +02:00
Christian Hohnstaedt
c752508979 Separate XCA Warning in Cmdline and GUI 2021-09-09 21:46:30 +02:00
Christian Hohnstädt
56c6df6c90 editComment: Move Gui elements to widgets/XcaTreeView
Another step to separate GUI from functionality
2021-06-19 13:18:48 +02:00
Christian Hohnstaedt
731d866bcb Drop more unneeded includes 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
487f5e2046 Cleanup: Drop many superflous includes and unused loadImg() function 2021-06-01 17:48:37 +02:00
Christian Hohnstädt
68273d0a30 Switch from autotools/qmake to cmake
Why?
 - QT will switch from qmake to cmake sooner or later.
 - autotools are good for unix-ish systems, cmake also for
   macOS and Xcode as well as Windows and VS-code
 - Cross compiling the windows-binaries on linux
   is not very helpful to attract windows-centric
   developers.

Also drop qmake's xca.pro
Generate man-page and sphinx sources of commandline arguments
during build by executing xca (xcadoc.cpp).
Generating Version-patchlevel and git hash is now also
OS independent.
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
57802580c8 Drop backward-compatibility for old(<2.0.0) XCA databases 2021-05-10 20:41:12 +02:00
Christian Hohnstädt
703d9c0ba7 sql: better handle SQL errors during insert
Don't pop-up a success message, but delete the item,
if an SQL error occures during insert.
2021-05-05 19:39:28 +02:00
Christian Hohnstaedt
ef24c00c22 Minor fixes 2020-06-26 14:21:32 +02:00
Christian Hohnstaedt
17b621ccef Encapsulate all index.internalPointer() in fromIndex(index) 2020-05-10 09:09:31 +02:00
Christian Hohnstaedt
45f834a6e4 Move tree-handling from db_x509 class to the base class
This is a preparation for possibly inserting
structuring folder elements later.
2020-05-08 17:37:40 +02:00
Christian Hohnstaedt
1e544161f6 Eliminate the use of "mainwin" in lib/db_* 2020-05-08 11:59:09 +02:00
Christian Hohnstaedt
7c65a786ea Revamp database management
The global variable "Database" of class xca_db
can be used by any other class to access. No need
to provide it.

The "xca_db" class managed the "database_model" pointer.
Accessing the name of the current database has been unified.
2020-05-08 07:47:15 +02:00
Christian Hohnstaedt
b2ab7570b8 Minor fixxes and constifies 2020-04-30 18:47:28 +02:00
Christian Hohnstaedt
0f7465dcc5 Add convenience function to convert QModelIndex to pki_base * 2020-04-30 18:46:08 +02:00
Christian Hohnstaedt
03633d7a8a Provide db class name through constructor 2020-04-30 18:44:36 +02:00
Christian Hohnstaedt
a3344100e3 Drop FOR_ALL_pki() makro and use a foreach() loop
The foreach loop iterates over all items of a type.
The iterate method is now superflous
2020-04-30 18:40:49 +02:00
Christian Hohnstaedt
5a64725556 Move item store from db_base into separate class "pki_lookup"
Since also pki_base and other classes need to access them.
2020-04-30 18:37:25 +02:00
Christian Hohnstaedt
595cf9a722 Drop connNewX509() signal and slot
in the past it was used to connect the NewX509 dialog
with requests keys and certs.

The NewX509 dialog knows mainwin since some time
and thus can connect itself to models and views

mainwin: use model<T>() instead of models->model<T>()
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
241d7e9c7f Move newItem() function from model to view
Move CRL and Template data collection via UI to
the appropriate views
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
3dd34a61bc Move "showPki()" from the model class to the view
The displaying function requires UI.
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
d0d387b03e Directly display the error instead of signaling others
The XCA_ERROR() is console-compatible and can be used
without GUI
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
19eafe1739 Improve and fix qDeleteAll()
qDeleteAll() does not clear the QList.
Add it, if necessary.

Use dynamic_cast where appropriate
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
c5208f1cd7 Consolidate headers, unguard delete operator 2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
b2a69f3586 Several fixes of previous commit
Passwd::cleanse() also resets the password size
db_base::flushLookup() now deletes all items
and pki_base does not anymore.

Drop TRACE
Colorize pki_base::print()

Set and inherit filename of loaded items
Add print() method to pki_pkcs12
and constify its methods
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
113a201d39 Separate database from Mainwin for better cmdline support
New classes:
 - database_model: Manage the database tables (keys, req, cert, crl, templ)
   extracted from widgets/MW_database.cpp
 - arguments: parse commandline, dynamically create help text
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
b9a8bb1a04 Cleanup: remove unused properties and declarations 2019-03-27 05:58:25 +01:00
Christian Hohnstaedt
f43e7520db Support concurrent database access.
If a database is modified by another instance of XCA the passive
instance reloads and displays the changed parts.
2019-03-25 06:47:25 +01:00
Christian Hohnstaedt
026d8f8e6d Extend PEM files by human readable information about the item
This can be enabled or disabled during export.
Move from FILE* to QFile
2019-03-18 06:25:20 +01:00
Christian Hohnstaedt
96d8c5cf37 Generalize handling of DateTime columns 2018-06-26 23:32:40 +02:00
Christian Hohnstaedt
b10b4f7a53 Inspired by #42: display insertion date relative
Easy to find the most recent entry, because it says
"3 seconds ago"
2018-06-25 21:20:25 +02:00
Christian Hohnstaedt
dc36728df8 Generate calender (.ics) files for certificate and CRL expiries
Also support consolidated calendar entries for a CA,
containing the CA, all issued certificates and the CRL expiry dates.
2018-05-10 12:49:59 +02:00
Christian Hohnstaedt
8d64db6be3 Const-ify remFromCont() 2018-04-24 23:10:46 +02:00
Christian Hohnstaedt
14421f4ed3 Update Issuer and Key name in the Certificate, Request and CRL details
after editing double-clicked element.
2018-03-05 07:46:11 +01:00
Christian Hohnstaedt
d079dbde09 Collect affected items 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
d36e6eb0cb Implement nested transactions.
The DbTransaction class automatically rolls back when the scope
is left (destructor) and no commit happenned.

Every transaction begin will increment the counter,
each commit/rollback will decrement it. Only if all transactions
finished with a commit, a final database commit will be performed.
2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
24d1f85a26 Make use of C++ templates for more type-safety 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
2a0a4630ae Extend authority table and fix CaProperties 2018-03-05 07:46:09 +01:00
Christian Hohnstaedt
4b3ee2c705 Switch database format to SQL(ite)
This is a large squash of many small commits.

Allow porting data from the legacy format to SQL.
Store Binaries base64 encoded and use db->transaction
Update password hash to be 8000 x SHA512 with 8 byte Salt
Add revocations table and fixup CRL generation
Add comment and insertion date columns

Fix column saving, remove trust, add XcaDialog
Allow changing the internal name and comment in Cert/Req details view
Extend Comment functionality, Replace About.ui by XcaDialog.ui
2018-03-05 07:42:36 +01:00
Christian Hohnstaedt
bdbaa0a946 Support Dragging certificates and other items as PEM text
Also dragging PEM test into XCA opens the import Dialog
2018-02-20 23:47:17 +01:00