This file is indexed.

/usr/include/KF5/libkleo/keycache.h is in libkf5libkleo-dev 4:17.12.3-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/* -*- mode: c++; c-basic-offset:4 -*-
    models/keycache.h

    This file is part of Kleopatra, the KDE keymanager
    Copyright (c) 2007 Klarälvdalens Datakonsult AB

    Kleopatra is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    Kleopatra is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

    In addition, as a special exception, the copyright holders give
    permission to link the code of this program with any edition of
    the Qt library by Trolltech AS, Norway (or with modified versions
    of Qt that use the same license as Qt), and distribute linked
    combinations including the two.  You must obey the GNU General
    Public License in all respects for all of the code used other than
    Qt.  If you modify this file, you may extend this exception to
    your version of the file, but you are not obligated to do so.  If
    you do not wish to do so, delete this exception statement from
    your version.
*/

#ifndef __KLEOPATRA_MODELS_KEYCACHE_H__
#define __KLEOPATRA_MODELS_KEYCACHE_H__

#include <QObject>

#include <kleo_export.h>

#include <gpgme++/global.h>

#include <memory>
#include <string>
#include <vector>

namespace GpgME
{
class Key;
class DecryptionResult;
class VerificationResult;
class KeyListResult;
class Subkey;
}

namespace KMime
{
namespace Types
{
class Mailbox;
}
}

namespace Kleo
{

class FileSystemWatcher;

class KLEO_EXPORT KeyCache : public QObject
{
    Q_OBJECT
protected:
    explicit KeyCache();
public:
    static std::shared_ptr<const KeyCache> instance();
    static std::shared_ptr<KeyCache> mutableInstance();

    ~KeyCache();

    void insert(const GpgME::Key &key);
    void insert(const std::vector<GpgME::Key> &keys);

    void refresh(const std::vector<GpgME::Key> &keys);

    void remove(const GpgME::Key &key);
    void remove(const std::vector<GpgME::Key> &keys);

    void addFileSystemWatcher(const std::shared_ptr<FileSystemWatcher> &watcher);

    void enableFileSystemWatcher(bool enable);

    void setRefreshInterval(int hours);
    int refreshInterval() const;

    const std::vector<GpgME::Key> &keys() const;
    std::vector<GpgME::Key> secretKeys() const;

    const GpgME::Key &findByFingerprint(const char *fpr) const;
    const GpgME::Key &findByFingerprint(const std::string &fpr) const;

    std::vector<GpgME::Key> findByEMailAddress(const char *email) const;
    std::vector<GpgME::Key> findByEMailAddress(const std::string &email) const;

    const GpgME::Key &findByShortKeyID(const char *id) const;
    const GpgME::Key &findByShortKeyID(const std::string &id) const;

    const GpgME::Key &findByKeyIDOrFingerprint(const char *id) const;
    const GpgME::Key &findByKeyIDOrFingerprint(const std::string &id) const;

    std::vector<GpgME::Key> findByKeyIDOrFingerprint(const std::vector<std::string> &ids) const;

    std::vector<GpgME::Subkey> findSubkeysByKeyID(const std::vector<std::string> &ids) const;

    std::vector<GpgME::Key> findRecipients(const GpgME::DecryptionResult &result) const;
    std::vector<GpgME::Key> findSigners(const GpgME::VerificationResult &result) const;

    std::vector<GpgME::Key> findSigningKeysByMailbox(const QString &mb) const;
    std::vector<GpgME::Key> findEncryptionKeysByMailbox(const QString &mb) const;

    enum Option {
        NoOption = 0,
        RecursiveSearch = 1,
        IncludeSubject = 2
    };
    Q_DECLARE_FLAGS(Options, Option)

    std::vector<GpgME::Key> findSubjects(const GpgME::Key &key, Options option = RecursiveSearch) const;
    std::vector<GpgME::Key> findSubjects(const std::vector<GpgME::Key> &keys, Options options = RecursiveSearch) const;
    std::vector<GpgME::Key> findSubjects(std::vector<GpgME::Key>::const_iterator first, std::vector<GpgME::Key>::const_iterator last, Options options = RecursiveSearch) const;

    std::vector<GpgME::Key> findIssuers(const GpgME::Key &key, Options options = RecursiveSearch) const;
    std::vector<GpgME::Key> findIssuers(const std::vector<GpgME::Key> &keys, Options options = RecursiveSearch) const;
    std::vector<GpgME::Key> findIssuers(std::vector<GpgME::Key>::const_iterator first, std::vector<GpgME::Key>::const_iterator last, Options options = RecursiveSearch) const;

    /** Check if at least one keylisting was finished. */
    bool initialized() const;

public Q_SLOTS:
    void clear();
    void startKeyListing(GpgME::Protocol proto = GpgME::UnknownProtocol)
    {
        reload(proto);
    }
    void reload(GpgME::Protocol proto = GpgME::UnknownProtocol);
    void cancelKeyListing();

Q_SIGNALS:
    //void changed( const GpgME::Key & key );
    void aboutToRemove(const GpgME::Key &key);
    void added(const GpgME::Key &key);
    void keyListingDone(const GpgME::KeyListResult &result);
    void keysMayHaveChanged();

private:
    class RefreshKeysJob;

    class Private;
    QScopedPointer<Private> const d;
};

}

Q_DECLARE_OPERATORS_FOR_FLAGS(Kleo::KeyCache::Options)

#endif /* __KLEOPATRA_MODELS_KEYCACHE_H__ */