security.h
/***************************************************************************
security.h - description
-------------------
begin : Thu Jun 24 11:22:12 2004
copyright : (C) 2004, 2005 by Andras Mantia <amantia@kde.org>
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as *
* published by the Free Software Foundation; version 2 of the License. *
* *
***************************************************************************/
#ifndef SECURITY_H
#define SECURITY_H
//qt includes
#include <qmap.h>
#include <qobject.h>
class KProcIO;
class KProcess;
struct KeyStruct {
QString id;
QString name;
QString mail;
bool trusted;
bool secret;
};
namespace KNS {
class Security : public QObject
{
Q_OBJECT
public:
static Security* const ref()
{
static Security *m_ref;
if (!m_ref) m_ref = new Security();
return m_ref;
}
~Security();
void checkValidity(const QString &fileName);
void signFile(const QString &fileName);
KeyStruct signatureKey() {return m_signatureKey;}
enum Results {
MD5_OK = 1,
SIGNED_OK = 2,
SIGNED_BAD = 4,
TRUSTED = 8,
UNKNOWN = 16,
SIGNED_BAD_CLEAR = 27,
BAD_PASSPHRASE = 32
};
public slots:
void readKeys();
void readSecretKeys();
void slotCheckValidity();
void slotSignFile();
private:
Security();
enum RunMode {
List = 0,
ListSecret,
Verify,
Sign
};
KeyStruct m_signatureKey;
int m_result;
int m_runMode;
bool m_gpgRunning;
bool m_keysRead;
QMap<QString, KeyStruct> m_keys;
QString m_fileName;
QString m_secretKey;
private slots:
void slotProcessExited(KProcess *process);
void slotDataArrived(KProcIO *process);
signals:
void validityResult(int result);
void fileSigned(int result);
};
}
#endif

KDE Home | KDE Accessibility Home | Description of Access Keys