This file is indexed.

/usr/include/signon-extension/SignOn/abstract-key-manager.h is in signond-dev 8.56+14.04.20140307-0ubuntu2.

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
/*
 * This file is part of signon
 *
 * Copyright (C) 2010 Nokia Corporation.
 *
 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 */
/*!
 * @copyright Copyright (C) 2009-2011 Nokia Corporation.
 * @license LGPL
 */

#ifndef SIGNON_ABSTRACT_KEY_MANAGER_H
#define SIGNON_ABSTRACT_KEY_MANAGER_H

#include <SignOn/extension-interface.h>

#include <QObject>
#include <QString>

namespace SignOn {

class AbstractKeyManagerPrivate;

typedef QByteArray Key;

/*!
 * @class AbstractKeyManager
 * @brief Base class for KeyManager implementations.
 *
 * The AbstractKeyManager is the base class for implementing signond key
 * managers. A key manager is an object which signond uses to get the keys
 * needed to access the encrypted storage. It emits signals whenever new keys
 * exist, when keys are disabled or removed. For example, a simple password
 * based key manager would:
 * @li query the user for the password when queryKeys() is called.
 * @li emit keyInserted() whenever the user enters the password.
 * @li if the password automatically expires after some time, emit keyDisabled
 * @li if the user changes the password, emit keyInserted() with the new
 * passord, and keyRemoved() for the old one.
 */
class SIGNON_EXPORT AbstractKeyManager: public QObject
{
    Q_OBJECT

public:
    /*!
     * Constructor
     */
    explicit AbstractKeyManager(QObject *parent = 0);

    /*!
     * Destructor
     */
    virtual ~AbstractKeyManager();

    /*!
     * This method initializes the key manager. Implementations can start
     * emitting signals during this method's execution.
     */
    virtual void setup() = 0;

    /*!
     * Signond calls this method if a key (typically a new key emitted with
     * the keyInserted() signal) needs to be authorized. Authorizing a key
     * means allowing the key to be used to mount the secure storage. The base
     * implementation of this method just emits the keyAuthorized() signal
     * denying the authorization, but specific implementations could delegate
     * the authorization to the user.
     * @param key The key that needs authorization.
     * @param message An optional message that might be shown to the user.
     *
     * @deprecated This method is deprecated and should not be
     * used or implemented in subclasses.
     */
    virtual void authorizeKey(const Key &key,
                              const QString &message = QString::null);

    /*!
     * Signond calls this method when there are no active keys. This might
     * happen when signond is just starting, or when all existing keys have
     * been disabled (which would cause the secure storage to be unmounted).
     * The key manager <em>must</em> emit keyInserted() in response to this
     * call, either with a valid key or with an empty one.
     */
    virtual void queryKeys();

    /*!
     * Gets a description for the key.
     * @param key The key whose name is to be returned
     * @return A description or name that could be shown to the user to
     * identify the key
     */
    virtual QString describeKey(const Key &key);

    /*!
     * @returns Whether the extension is able to authorize keys or not.
     * The default implementation just returns false.
     *
     * @deprecated This method is deprecated and should not be
     * used or implemented in subclasses.
     */
    virtual bool supportsKeyAuthorization() const;

Q_SIGNALS:
    /*!
     * Emitted when a new key is available. If the key is not yet known to
     * signond, signond will call authorizeKey on the key managers before
     * accepting it.
     * @param key The new key
     */
    void keyInserted(const SignOn::Key key);

    /*!
     * Emitted when a key is disabled. For instance, this signal can be
     * emitted when a password expires or when a hardware key is removed.
     * @param key The key which has been disabled
     */
    void keyDisabled(const SignOn::Key key);

    /*!
     * Emitted when a key is to be removed. This means that the key will never
     * be used again to access the secure storage; if it will be inserted
     * again, it will have to be re-authenticated.
     * It is not necessary to emit keyDisabled() before keyRemoved(): the key
     * will be disabled anyway when keyRemoved is emitted.
     * @param key The key which has to be removed
     */
    void keyRemoved(const SignOn::Key key);

    /*!
     * The key manager emits this when it has decided whether to authorized
     * the key. If more than one key manager is installed, signond will
     * authorized the key as soon as the first key manager emits this signal
     * with authorized set to true.
     * @param key The key which underwent the authorization step
     * @param authorized The result of the authorization
     *
     * @deprecated This signal is deprecated and should not be
     * used or emitted in subclasses.
     */
    void keyAuthorized(const SignOn::Key key, bool authorized);

private:
    AbstractKeyManagerPrivate *d;
};

} // namespace

#endif // SIGNON_ABSTRACT_KEY_MANAGER_H