Bug 175980

Summary: --query and --external command line options missing
Product: [Applications] kleopatra Reporter: Volker Krause <vkrause>
Component: generalAssignee: Andre Heinecke <aheinecke>
Status: RESOLVED FIXED    
Severity: wishlist CC: emanuel, kdepim-bugs, lindsay.mathieson
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: A screenshot of kleopatra 0.40

Description Volker Krause 2008-11-24 14:14:56 UTC
Version:            (using Devel)
Installed from:    Compiled sources

<vkrause> marc_office: first, the --query command line option seems to be gone in e4
<vkrause> marc_office: how do I port code using it?
<vkrause> marc_office: this is about the key selection dialog offering an external search if no key was found
<marc_office> vkrause: hmmm
<marc_office> vkrause: my first reaction was: use libkleopatraclient
<marc_office> at least then we would get test coverage of that, but the on-demand starting of Kleo isn't implemented there yet
<marc_office> I guess we should do both: implement the --query and --external cmdline options again, and provide the same functionality as libkleopatraclient commands
<marc_office> vkrause: can you please make bug reports for the above in b.k.o?
Comment 1 Emanuel Schütze 2013-05-08 10:14:47 UTC
Andre, can you check this issue with current Kleopatra?
Comment 2 Blackpaw 2013-07-27 08:10:47 UTC
What is "--external" meant to do? from kdepim it seems to be invoked as

kleopatra  --external  --query <key fingerprint>

I have a patch that adds back --query support and was about to commit it until I found this bug report. I might as well add --external support to, once I know what its meant to do ;)
Comment 3 Andre Heinecke 2013-07-29 11:12:01 UTC
Created attachment 81418 [details]
A screenshot of kleopatra 0.40

Great that you are working on this.
In the olden times Kleopatra had the two query modes "local and external" to search for certificates. One would use ldap to look up a certificate if it is configured and the other would be local.

If you call 
kleopatra --query aheinecke@intevation.de it would search for the local keys.
kleopatra --external --query aheinecke@intevation.de it would use the external mode

As I understand it a KDE 4 kleo equivalent would be to open the "Certificate Server Certificate Lookup" (ugh what a name ;) ) when the --external argument is added.
Comment 4 Blackpaw 2013-07-29 11:44:50 UTC
Thanks Andre, that makes sense.

As I've currently implemented it --query <fingerprint>
- searchs the local keys, shows detail if found
- if nothing is found, invokes the "Certificate Server Certificate Lookup" 

The idea being, when invoke from kmail it displays the key detail if founds, otherwise searches the key servers for it. No need for a --external

Does that break needed functionality or other clients?
Comment 5 Andre Heinecke 2013-07-29 12:57:30 UTC
Sounds good to me, and as query has not been implemented for some years now I doubt that there is any functionality based on this that will break if it behaves differently then before.
Comment 6 Blackpaw 2013-07-29 13:02:08 UTC
Cool, thanks Andre.
Comment 8 Andre Heinecke 2015-11-10 15:26:12 UTC
Git commit fcf92035b9a44f51d89e02268f1fdbc3e4c2ca3a by Andre Heinecke.
Committed on 10/11/2015 at 15:25.
Pushed by aheinecke into branch 'master'.

Add --search command line option.

This option runs the lookupcertificatescommand with the provided
search string. This basically opens the external keysearch dialog.

The option implements the KDE 3 behavior of kleopatras
--query --external but I found it easier to understand if It is
named like the GnuPG --search option and does not mix the
"open certificate details / search on keyserver" options.

Behavior of the --query option is not documented a bit more
detailed in the help string.

M  +7    -1    kleopatra/kleopatra_options.h
M  +31   -19   kleopatra/kleopatraapplication.cpp

http://commits.kde.org/kdepim/fcf92035b9a44f51d89e02268f1fdbc3e4c2ca3a
Comment 9 Andre Heinecke 2015-11-10 15:26:13 UTC
Git commit d591b2bbfa132632901870dedf00994009a37666 by Andre Heinecke.
Committed on 10/11/2015 at 15:25.
Pushed by aheinecke into branch 'master'.

Make "Search for External Certificates" work again

This uses the newly added search option to open kleopatra's
Keyserver search dialog instead of just opening Kleopatra.

M  +2    -6    libkleo/src/ui/keyselectiondialog.cpp

http://commits.kde.org/kdepim/d591b2bbfa132632901870dedf00994009a37666
Comment 10 Andre Heinecke 2016-01-27 11:05:57 UTC
Git commit 0df8c74d5869612667e6f72b3de368fa8a77c9b4 by Andre Heinecke.
Committed on 27/01/2016 at 10:58.
Pushed by aheinecke into branch 'vendor/intevation/4.14'.

Backport fixes for search external certificates

Do not prefix query with 0x and show prefix info.

This generalizes the lookupcertificatescommand again so that
it can be used with a generic query. Prefixing 0x this low was wrong
and is also not necessary at least with SKS Keyservers.

Accordingly don't show the information text about how adding
or leaving out the 0x prefix might change results. Only show
it in case a search for a keyid or fingerprint does not return
a result.

(cherry picked from commit c2a6ef0c41598ef801a5b8a0438e59a7e2ae9b97)

Conflicts:
	kleopatra/commands/lookupcertificatescommand.cpp

Add --search command line option.

This option runs the lookupcertificatescommand with the provided
search string. This basically opens the external keysearch dialog.

The option implements the KDE 3 behavior of kleopatras
--query --external but I found it easier to understand if It is
named like the GnuPG --search option and does not mix the
"open certificate details / search on keyserver" options.

Behavior of the --query option is not documented a bit more
detailed in the help string.
(cherry picked from commit fcf92035b9a44f51d89e02268f1fdbc3e4c2ca3a)

Conflicts:
	kleopatra/kleopatra_options.h
	kleopatra/kleopatraapplication.cpp

Make "Search for External Certificates" work again

This uses the newly added search option to open kleopatra's
Keyserver search dialog instead of just opening Kleopatra.
(cherry picked from commit d591b2bbfa132632901870dedf00994009a37666)

Conflicts:
	libkleo/src/ui/keyselectiondialog.cpp

M  +43   -34   kleopatra/commands/lookupcertificatescommand.cpp
M  +30   -14   kleopatra/kleopatraapplication.cpp
M  +1    -6    libkleo/ui/keyselectiondialog.cpp

http://commits.kde.org/kdepim/0df8c74d5869612667e6f72b3de368fa8a77c9b4