Commit Graph

267 Commits

Author SHA1 Message Date
Christian Hohnstaedt
53cbeea783 Close #152: How can we specify the Cryptographic Service Provider
Some checks failed
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Has been cancelled
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Has been cancelled
A comment line of the format "CSP: <Provider Name>"
in the private key will be used as CSP during PKCS#12 / PFX
export.
2024-09-30 19:07:12 +02:00
Christian Hohnstaedt
4b76522d9e Close #199: Templates and Key Identifiers
Extend all 3 templates.
Skip AKID for self-signed certificates.

Visualize this by disabling the AKID checkbox
if a self-signed certificate is going to be created.
2024-09-29 18:39:00 +02:00
Christian Hohnstaedt
2e7cb9f2b1 Fix uic warning 2024-09-29 14:20:15 +02:00
Christian Hohnstaedt
7d3ff4f0f9 Add OpenSSL PURPOSE and validation results
A new tab on the certificate details dialog
shows the result of the OpenSSL validation process
and the calculated OpenSSL Purpose.

The translation of the OpenSSL X509_V_ERR.... messsages
back to strings is done by grepping them from "openssl/x509_vfy.h"
and wrapping them into a macro-call.
Additionally guard them by an #ifdef (Zombieland rule #2: Double-Tap)
This way:
 - I don't need to test and check in which versions of OpenSSL
   which errors are available or not
 - New errors will be picked up automatically, as long as they
   match the "X509_V_ERR_" pattern
2024-09-29 14:12:17 +02:00
Christian Hohnstaedt
cb1f02502d Close #90, #361: Name Constraints (RFC5280 section 4.2.1.10)
Some checks failed
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Has been cancelled
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Has been cancelled
Conversion of name constraints from certificate to Template
(Advanced Tab) and using them from there was working since long.

Now there is an additional input line, like (and next to)
SubjectAlternativeName with live validation and edit button
with guided input.

The conversion from cert to template now puts the extension
into the correct LineEdit and not on the Advanced Tab anymore.

However, XCA does NOT follow the constraints, yet.
It is still possible to issue certificates with arbitrary
names, independent of any "Name Constraints" in the CA.

This is what issue #239 asks for.
2024-09-14 23:53:59 +02:00
Christian Hohnstaedt
ec3dec0b44 Relates #88: Select a common or individual passwords
When exporting items into encrypted files, the checkbox
"Same encryption password for all items" may be used to enter
one password once for all items.

Otherwise a new password dialog opens for each exported entry.
2024-09-14 01:13:18 +02:00
Christian Hohnstaedt
46c1b78577 Close #88: Export to multiple files
Extend the ExportFile dialog by a checkbox to
switch between "all-in-one-file" or every item in a separate
file. It is only visible if more than one file is selected.
Activating the checkbox will:
 - Change the file-input into a directory-input and cut off the
   file name
 - Disabling all formats that are intended for multiple items.
De-activating the checkbox will:
 - Change the directory-input back into a file-input
   and append the previously erased file name again.
 - Disabling all export-formats that are only useful for single items.
2024-09-14 01:13:18 +02:00
Christian Hohnstaedt
7f5bdb7dec Close #287: template don't save/restore correctly
Use the probably modified internal name of the template
in the template-details dialog before import.

Therefore the name of the qlineedit of the internal name of
all other details dialogs changed from "descr" to "description"
to match the name in the NewX509 dialog and to be found
by the "XcaDetails" class.

When exporting the template data, add the internal name and the comment
to the exported data.
The XCA template data is defined by us and can be modified.
This change is backwards and upwards compatible:
  New versions of XCA can read an old Template export and vice-versa.
2024-08-31 14:48:43 +02:00
Christian Hohnstaedt
3ac87b580b Drop unused, leftover UI description TrustState.ui
Obsoleted by:
  4b3ee2c705
  Author: Christian Hohnstaedt <christian@hohnstaedt.de>
  Date:   Sat Sep 26 18:18:10 2015 +0200
2024-08-24 15:09:00 +02:00
Christian Hohnstaedt
3a8ddf486b Reorganize exportdialog 2024-02-16 17:42:13 +01: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
5ed19e689e Optical improvement of main- and help-window 2023-09-15 09:38:29 +02:00
Tobias Wich
097cbfb815 Add PKCS12 enc algo setting and use it when exporting PKCS12 2022-10-06 15:32:30 +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 Hohnstädt
3e858c877f Merge remote-tracking branch 'github/master' into main 2021-10-24 14:56:38 +02:00
pf
8af3cabfa8 Replace certificate while renewing it
This commit also changes the default state of
the "Revoke old certificate" checkbox to unchecked.
The reasoning for this is that by renewing a certificate
its lifetime and subsequently validity are prolonged,
which therefore implies equal trustworthiness
for both new and old certificates, which does not intend
the revocation of the latter.
2021-06-01 20:25:13 +03: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
7d564132ba Move ca-properties dialog to the certificate view
Reduce UI from QDialog to QWidget and display it in the XcaDialog frame.
Also move user interface specific code from the db_x509 class
into the CertTreeView class
2021-05-10 20:41:12 +02:00
Christian Hohnstaedt
4906715242 Fix header build 2021-05-01 21:37:51 +02:00
Christian Hohnstädt
4632a457fa KeyDetail with ReadOnly option
When the public key of a certificate is shown
it is not in the database and the name should not be editable
2021-04-24 23:16:36 +02:00
Christian Hohnstaedt
ff7704ff0b Add context sensitive documentation
All dialogs get the "Qt::WindowModal" modality to
operate the Help window in parallel
while also blocking the dialog parent windows.

The manageRevocations() moved from model to view

The Details dialogs become more self-sufficient.
There is a statc start method that shows the dialog and
updates name and comment after accept().
This allows recursive starts of certificate details and
independence of mainwin.
It is necessary to set the current toplevel widget as parent
for the next dialog to not block the application.
2021-04-23 15:50:13 +02:00
Christian Hohnstaedt
4f706fb3de Move Help window into separate class
Start it on application start and keep it around
for context sensitive help.
2021-04-09 17:36:03 +02:00
Christian Hohnstädt
6f8a543761 Improve Item properties dialog
Change form layout to table layout, which is nicer and matches better
2020-10-14 22:00:20 +02:00
Christian Hohnstaedt
c528c37986 Merge branch 'master' into develop 2020-04-05 10:58:47 +02:00
Christian Hohnstaedt
2d0980d4f6 Use pkcs11_lib_list as model for Options:pkcs11list
Change pkcs11List from QListWidget to QListView
The pkcs11_lib_list holds the data of the loaded libraries.
For the model a QList "model_data" is used to
hold indexes into QList dirs to allow duplicates,
moves and removes.

On windows it now displays the paths with \ separators.
2020-04-05 09:16:12 +02:00
Christian Hohnstaedt
def5f8e72e Abbreviate "adapt_explicit_subject" to fit into CHAR(20) of settings.key_
SQLite does not care, but PostgreSQL does.
2020-04-03 13:38:24 +02:00
Christian Hohnstaedt
5543ec2fb8 Merge branch 'master' into develop 2020-04-02 07:35:18 +02:00
Christian Hohnstaedt
98e5e0e246 Improve ExportDialog layout 2020-04-01 12:29:55 +02:00
Christian Hohnstaedt
4f1103a64f Close #72: Add checkbox for OCSP staple feature
Also support them in XCA template and transformation from
certificate and request.
2020-03-29 22:23:21 +02:00
Christian Hohnstaedt
c4eb23f2af Close #172 #46: Multiple OCSP Responders
also fixes "#46 AIA, simultaneous OCSP and caIssuers"

Move "OCSP/caIssuers" index from a separate drop down
into the single dropdown of URI/IP/DNS...

This change not only fixes the bug, but also removes some
special handling for the AIA extension.

Adding features by deleting code is highly appreciated :-)
2020-03-20 16:29:43 +01:00
Christian Hohnstaedt
0cbf179074 Close #172 #46: Multiple OCSP Responders
also fixes "#46 AIA, simultaneous OCSP and caIssuers"

Move "OCSP/caIssuers" index from a separate drop down
into the single dropdown of URI/IP/DNS...

This change not only fixes the bug, but also removes some
special handling for the AIA extension.

Adding features by deleting code is highly appreciated :-)
2020-03-18 05:26:16 +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
953d26c419 Close #21 Support for ODBC (MSSQL)
Add ODBC QSQL Database driver

Column "public" in public_keys table is a keyword in
MSSQL. Double quote it.
Double quotes are invalid on MySQL in non-ANSI mode.
Force ANSI mode for MySQL/MariaDB databases.

MSSQL also has a maximum VARCHAR of 8000

Schema updates are not performed for each new database.
New databases are immediately created conforming to schema:7
Schema 5 and 6 get updated to 7.
Schemas < 5 never have been released officially. (pre 2.0.0)

Switch "Database name" label to "DSN" for ODBC databases.
2020-01-13 07:24:08 +01:00
Christian Hohnstaedt
2397ab72de Close #140: Certificate renewal with option to preserved serial number
Add checkbox (unchecked by default) to keep the old serial number
while renewing certificates
2019-12-06 15:28:09 +01:00
Christian Hohnstaedt
ced0995862 Close #91: Change order of "PKCS#11 provider"
With this commit PKCS#11 libraries may be reordered
and enabled or disabled.

The slot selection dialog iterates over all enabled and successfully
loaded libraries in the configured order and collects the slots
of each of them.

In the options dialog the library info is shown in the tool-tip
2019-03-21 06:12:51 +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
a20afb3fd4 Fix Layout of token details
Replace form-layout by grid-layout
2019-03-14 06:41:25 +01:00
Christian Hohnstaedt
1bc340a0ef Close #104: Also show sha256 digests of public keys
Print digest of public keys in the key details in different formats:

Print SHA256 SSH digest as used to by SSH users:
	ssh-keygen -l -f ~/.ssh/id_rsa.pub

Print SHA1 X509 key digest as shown in the
	Subject key identifier of a certificate

Print SHA256 digest as in:
	openssl pkey -pubout -outform DER < key.pem | sha256sum
as requested by this issue.

Refactored digesting functionality by a generic Digest()
function working with QByteArrays.
The function formatHash() now also expects a QByteArray input.
2019-03-14 06:35:24 +01:00
Christian Hohnstaedt
bdfa10d4d5 Close #45: Unable to view Public Key
Allow displaying the public key of a certificate
or request without importing it.

When importing certificates or CRLs,
display the issuer if it exists in the database.
2018-07-01 14:58:23 +02:00
Christian Hohnstaedt
bd0def22dd Update translation 2018-06-27 17:14:23 +02:00
Christian Hohnstaedt
fa41eb6d5f Close #41: Generate CRL option 'Midnight' not working
Re-add lost connection between "Midnight" button and
date-time displays
2018-06-24 11:14:16 +02:00
Christian Hohnstaedt
3c87ff1ea0 Remove code duplication with CSR information
Unstructured name and challange password use the
distinguished name code (setupExplicitInputs)
2018-06-22 06:21:37 +02:00
Christian Hohnstaedt
5703ad855a Separate the internal name from distinguished name 2018-06-22 06:20:33 +02:00
Christian Hohnstaedt
15d33fdcfc Make the dynamic DN entry adaption configurable.
If the option is selected, the behavior from the
previous commit is enabled. Otherwise, the
explicit DN entries stay as configured.
2018-06-21 20:29:45 +02:00
Christian Hohnstaedt
22966937de Close #36: Support adding CN to X509v3 SAN automatically
Translate the special text "DNS:copycn" in the SAN to
the final common name.

Add checkobox "Copy Common Name" to the SAN Edit box,
for a user-friendly editing of the "DNS:copycn"

During certificate creation, an empty common name together with
"DNS:copycn" in the SAN will raise a warning message and the
opportunity to change the settings.

Change the SAN in the HTTP-server XCA template from
"DNS:your.server.name.here" to "DNS:copycn" to already
take advantage of this feature in the default template.
2018-05-19 22:14:08 +02:00
Christian Hohnstaedt
f0e6dc1f1b Close #35: Configurable size of serial number.
Allow to configure the previously fixed serial number length
of 64 bit between 8 and 256 bit
2018-05-19 18:09:28 +02:00
Christian Hohnstaedt
0c8df14b7e Close #27: Configurable certificate expiry warning threshold
Add configuration values in the Options dialog to
control the time when certificates get marked yellow and
the expiration alarm time in calendar entries.
2018-05-11 09:19:12 +02:00
Christian Hohnstaedt
3eef4bd12b Fix translation artefacts.
No need to translate "X Certificate and Key management",
"Form", "Dialog" or "TimeInput"

"Select Token" and "New Key" window titles were never shown.
Remove them.
2018-03-28 08:13:22 +02:00
Christian Hohnstaedt
64c9c5ccab Add table prefix to be prepended to each table
This allows multiple independent xca databases in one database
2018-03-19 06:14:06 +01:00
Christian Hohnstaedt
d22cfb0b53 Allow editing of revocations 2018-03-11 09:31:16 +01:00