source: psi/trunk/src/tools/openpgp/gnupg.h

Last change on this file was 2, checked in by dmik, 19 years ago

Imported original Psi 0.10 sources from Affinix

File size: 1.9 KB
Line 
1/*
2 * gnupg.h - OpenPGP interface to GnuPG
3 * Copyright (C) 2003 Justin Karneges
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21#ifndef GNUPG_H
22#define GNUPG_H
23
24#include"openpgp.h"
25
26class GnuPG : public OpenPGP::Engine
27{
28 Q_OBJECT
29public:
30 GnuPG(QObject *parent=0);
31 ~GnuPG();
32
33 void setTryAgent(bool);
34
35 bool checkAvailability();
36 QString id() const;
37 QString name() const;
38
39 void init();
40 OpenPGP::KeyList secretKeys() const;
41 OpenPGP::KeyList publicKeys() const;
42
43protected:
44 void encrypt(OpenPGP::Request *, const QByteArray &in, const QStringList &keys);
45 void decrypt(OpenPGP::Request *, const QString &in);
46 void sign(OpenPGP::Request *, const QByteArray &in, const QString &keyID);
47 void verify(OpenPGP::Request *, const QByteArray &in, const QString &sig);
48 void submitPassphrase(OpenPGP::Request *, const QString &);
49
50private slots:
51 void gpg_finished(bool);
52 void gpg_needPassphrase();
53
54 void req_destroyed();
55 void doNext();
56 void fileChanged();
57
58public:
59 class Item;
60private:
61 class Private;
62 Private *d;
63
64 void tryNext();
65
66 Item *find(OpenPGP::Request *) const;
67 void hook(Item *);
68 OpenPGP::Request *unhook(Item *);
69 OpenPGP::Request *unhookFirst();
70
71 void handleDirtyRings();
72 void doInitFinished(bool, const QString &);
73};
74
75#endif
Note: See TracBrowser for help on using the repository browser.