Plasma
credentials.h
Go to the documentation of this file.
00001 /* 00002 * Copyright © 2009 Rob Scheepmaker <r.scheepmaker@student.utwente.nl> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License version 2 as 00006 * published by the Free Software Foundation 00007 * 00008 * This program is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 * GNU General Public License for more details 00012 * 00013 * You should have received a copy of the GNU Library General Public 00014 * License along with this program; if not, write to the 00015 * Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef CREDENTIALS_H 00020 #define CREDENTIALS_H 00021 00022 #include "plasma.h" 00023 00024 #include <QtCore/QObject> 00025 #include <QtCore/QDataStream> 00026 #include <QtCore/QMetaType> 00027 00028 namespace Plasma { 00029 00030 class CredentialsPrivate; 00031 00042 class Credentials 00043 { 00044 public: 00048 Credentials(); 00049 00053 Credentials(const Credentials &other); 00054 00055 ~Credentials(); 00056 00057 Credentials &operator=(const Credentials &other); 00058 00062 static Credentials createCredentials(const QString &name); 00063 00071 TrustLevel trustLevel() const; 00072 00077 bool isValid() const; 00078 00084 QString name() const; 00085 00090 QString id() const; 00091 00095 bool isValidSignature(const QByteArray &signature, const QByteArray &message); 00096 00101 bool canSign() const; 00102 00106 QByteArray signMessage(const QByteArray &message); 00107 00112 Credentials toPublicCredentials() const; 00113 00114 friend QDataStream &operator<<(QDataStream &, const Credentials &); 00115 friend QDataStream &operator>>(QDataStream &, Credentials &); 00116 00117 private: 00118 Credentials(const QString &id, const QString &name, const QString &key, 00119 bool privateKey = false); 00120 00121 CredentialsPrivate *const d; 00122 00123 friend class AuthorizationManagerPrivate; 00124 friend class CredentialsPrivate; 00125 }; 00126 00130 QDataStream &operator<<(QDataStream &, const Credentials &); 00131 QDataStream &operator>>(QDataStream &, Credentials &); 00132 00133 } 00134 00135 #endif // IDENTITY_H
KDE 4.6 API Reference