25 Commits

Author SHA1 Message Date
Saleem Edah-Tally
be47316219 Expand developer string. 2022-11-19 15:56:56 +01:00
SET
20cf898a72 Remove unused includes. 2020-11-26 22:29:43 +01:00
SET
b90ec093ad Use local scope ::Context when creating keys.
The created key was searched with FindKey(), that operates on the class
scope ::Context. The latter does not use loopback pinentry. Even though,
the created key was found, the passphrase for the created key being
cached in gpg-agent.
2020-11-26 21:03:35 +01:00
SET
4d5d426f30 Remove unused function.
We don't need CheckPassphrase() anymore.
2020-11-25 21:34:18 +01:00
SET
b68bee813d Allow to export private keys.
Using a workaround that validates passphrase for a secret key.

With GnuPG 2.2.23 and GpgME 1.1.15, a secret key can be exported when the right
passphrase is provided. With a bad passphrase, application crashes.

See https://dev.gnupg.org/T5151

Application may validate a passphrase before invoking engine. Until it is
hopefully fixed in upstream and available in mainstream.
2020-11-24 22:19:27 +01:00
SET
b761c366f7 Merge branch 'master' into TestExportPrivateKeys 2020-11-24 20:13:23 +01:00
SET
b726b89086 Use new Context::setExpire to set expiration dates.
If no subkey is found (wrong fpr) or not provided, the expiry time of 
the key is set instead.

setExpire() allows to expire all subkeys at once. Not implemented here.

Requires GPGME >= 1.15.0.
2020-11-23 11:46:41 +01:00
SET
110e5e4fb3 Allow revoking key certifications.
Certified user identities in keys can be revoked using the same popup
for certification.

Requires GnuPG 2.2.24 (not available in distro's repository, not fully
tested to date).
2020-11-22 14:22:08 +01:00
SET
e9a55a1f69 Allow changing subkey expiry time.
Needs GPGME 1.15.0.
Using the same UI for changing expiry time of the primary secret key.
2020-11-21 20:59:32 +01:00
SET
82b8810f62 Allow exporting secret keys.
Requests the passphrase with a popup.

As from GPGME 1.15.0, the loopback pinentry is functional when exporting secret keys. It works fine when the exact passphrase is provided. If it's a wrong passphrase, GPGME does not generate an ::Error, but the app crashes with 'free(): double free detected in tcache 2'.

Hence, this patch cannot be committed to master.

Status : dangerous
Result : works and works not
Reason : a wrong passphrase means a crash
2020-11-20 22:41:29 +01:00
SET
43e1eff221 Add function to revoke a user identity.
Done with Context::revUid, not with UserID::revoke.

Does not remove the identity.

N.B. : if the uid is revoked a second time, Error::code is 0.
2020-11-18 20:48:15 +01:00
SET
98c4fa2b22 Use right uid string.
Correct format :
        name (comment) <email>
Was :
        name <email> (comment)

3ac566fbf was wrong.
2020-11-18 20:40:16 +01:00
SET
da3f5c3516 Add function to add a new user identity to a key.
The email parameter must have a valid email address format here, else
GPGME will refuse to create the identity. This is not the case when
creating a key, where any string is accepted.
2020-11-16 15:58:50 +01:00
SET
3ac566fbfe Format uid string correctly when creating keys.
Correct format :
	name <email> (comment)
Was :
	name <email> comment

Though the 'comment' part was visible with the cli gpg app, it was not
shown in kleopatra and in K7.
2020-11-16 14:39:57 +01:00
SET
7633ef9d60 Add function to export public keys.
Expects a fingerprint to export a single public key in armor mode.
2020-11-15 11:58:07 +01:00
SET
e944da9eda Test export private keys in C++.
Result : fails.
Reason : loopback passphrase provider is never called.

With default pinentry mode, the passphrase is requested normally 
and the private key is exported. But this can't be done on a web server.

Enclosed in #ifdef DEVTIME.
2020-11-15 11:53:03 +01:00
SET
b9b4396b12 Fix key generation functions.
Created key must always be looked for as it is not assigned to the
passed in null key.
Delete local context and loopback passphrase provider.
Parameter expires was ignored in CreateKeyWithEngineDefaultAlgo.
2020-11-12 22:38:10 +01:00
SET
4f8ea18a66 Use fingerprint instead of keyid when importing and deleting keys. 2020-11-11 21:09:43 +01:00
SET
9cce0febdb Add key creation functions.
- create a pair of keys with default engine algorithms
 - create a secret key
 - create a subkey (public) and add it to a secret key.
2020-11-11 14:47:05 +01:00
SET
2bddf29596 Allow to change key expiry date.
Select new date in a popup. Controlled by a specific configuration flag.
2020-11-07 22:25:07 +01:00
SET
ffd9692504 List key certifications
Set context KeyListMode to ::Signatures | ::Validate.
List certification on public key only.
2020-11-07 12:21:49 +01:00
SET
7f8af95d3a Certify key.
In-place editing with a popup if user is allowed in app config file.
User must of course manage at least a private key. User identities of
target key may be selectively chosen. Optionally, certification may be
exportable and non-revocable.
2020-11-03 11:06:25 +01:00
SET
e434315940 Edit owner trust level.
Inplace editing with a combobox if user is allowed. in app config file.
2020-10-25 17:28:47 +01:00
SET
b1ab6ba97d Fix typo 2020-06-05 20:35:11 +02:00
SET
47e78be7e9 Initial commit 2019-10-25 20:16:43 +02:00